From: Rob Browning Date: Sat, 22 Mar 2014 15:25:32 +0000 (-0500) Subject: test-ls.sh: get the group and gid from the filesystem. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=7ad76808399d91955111a53033d708be7c41e529;p=packages%2Fb%2Fbup.git test-ls.sh: get the group and gid from the filesystem. Get the expected gid from the filesystem, not "id", because on some platforms (BSDs, etc.) a new path's gid is taken from the parent directory, not the effective gid. Thanks to Thomas Klausner for reporting the problem and to him and Greg Troxel for helping craft the solution. Signed-off-by: Rob Browning --- diff --git a/t/test-ls.sh b/t/test-ls.sh index 4a9e5b1..c4f4a1a 100755 --- a/t/test-ls.sh +++ b/t/test-ls.sh @@ -132,9 +132,10 @@ symlink_date="$(WVPASS echo "$symlink_date" \ || exit $? uid="$(id -u)" || exit $? -gid="$(id -g)" || exit $? +gid="$(python -c 'import os; print os.stat("src").st_gid')" || exit $? user="$(id -un)" || exit $? -group="$(id -gn)" || exit $? +group="$(python -c 'import grp, os; +print grp.getgrgid(os.stat("src").st_gid)[0]')" || exit $? WVPASSEQ "$(bup ls -l src/latest"$tmpdir"/src | tr -s ' ' ' ')" \ "-rwx------ $user/$group 0 1969-07-20 20:18 executable