From: Giuseppe Scrivano Date: Sat, 4 Jul 2009 08:14:31 +0000 (+0200) Subject: tests: use the "nobody" user's group as the default group id X-Git-Tag: v7.5~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42cd6653b06e63fc36ef3f105fd37de036012e05;p=thirdparty%2Fcoreutils.git tests: use the "nobody" user's group as the default group id * tests/chroot/credentials: Use the group id, not its name. * tests/test-lib.sh (NON_ROOT_GROUP): Use the "nobody" user's group in place of "nogroup". --- diff --git a/tests/chroot/credentials b/tests/chroot/credentials index 58c098f537..f200f14ab0 100755 --- a/tests/chroot/credentials +++ b/tests/chroot/credentials @@ -37,7 +37,7 @@ test "$(chroot --userspec=$NON_ROOT_USERNAME:$NON_ROOT_GROUP / whoami)" != root || fail=1 # Verify that there are no additional groups. -test "$(chroot --userspec=$NON_ROOT_USERNAME:$NON_ROOT_GROUP --groups=$NON_ROOT_GROUP / id -nG)"\ +test "$(chroot --userspec=$NON_ROOT_USERNAME:$NON_ROOT_GROUP --groups=$NON_ROOT_GROUP / id -G)"\ = $NON_ROOT_GROUP || fail=1 # Verify that when specifying only the user name we get the current diff --git a/tests/test-lib.sh b/tests/test-lib.sh index d99e3a9662..9797b552e3 100644 --- a/tests/test-lib.sh +++ b/tests/test-lib.sh @@ -209,7 +209,7 @@ require_root_() { uid_is_privileged_ || skip_test_ "must be run as root" NON_ROOT_USERNAME=${NON_ROOT_USERNAME=nobody} - NON_ROOT_GROUP=${NON_ROOT_GROUP=nobody} + NON_ROOT_GROUP=${NON_ROOT_GROUP=$(id -g $NON_ROOT_USERNAME)} } skip_if_root_() { uid_is_privileged_ && skip_test_ "must be run as non-root"; }