Skip to content

Commit

Permalink
edit toplevel-perms test to also check for user/group ownership
Browse files Browse the repository at this point in the history
  • Loading branch information
ezrizhu committed Mar 8, 2024
1 parent 411ca92 commit 9165206
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions test/toplevel-perms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ cd "$try_workspace" || return 9
touch test

cmd="$(mktemp)"
echo "find / -maxdepth 1 -print0 | xargs -0 ls -ld | awk '{print substr(\$1, 1, 10), \$9, \$10, \$11}' | grep -v 'proc' | grep -v 'swap'" > "$cmd"
# Use this after gidmapper to show user and group ownership
#echo "find / -maxdepth 1 -print0 | xargs -0 ls -ld | awk '{print substr(\$1, 1, 10), \$3, \$4, \$9, \$10, \$11}' | grep -v 'proc' | grep -v 'swap'" > "$cmd"
echo "find / -maxdepth 1 -print0 | xargs -0 ls -ld | awk '{print substr(\$1, 1, 10), \$3, \$4, \$9, \$10, \$11}' | grep -v 'proc' | grep -v 'swap'" > "$cmd"

# Set up expected output
expected="$(mktemp)"
Expand All @@ -45,6 +43,5 @@ sh "$cmd" >"$expected"
# Set up target output
target="$(mktemp)"

"$TRY" "sh $cmd" > "$target" || return 1
#diff -q "$expected" "$target"
sudo "$TRY" "sh $cmd" > "$target" || return 1
diff "$expected" "$target"

0 comments on commit 9165206

Please sign in to comment.