From acb422bdd1b325285bb46883f02d8fc6402efd14 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Thu, 26 Jun 2014 12:41:01 +0100 Subject: tests: use predetermined NON_ROOT_GID * HACKING: GID is more useful in tests than group name, so rename input param from NON_ROOT_GROUP to NON_ROOT_GID to make it obvious that only a group ID is now acceptable, thus allowing GID lookups to be avoided throughout the tests. * init.cfg (require_root_): Likewise. * tests/misc/truncate-owned-by-other.sh: Avoid looking up the GID. * tests/touch/now-owned-by-other.sh: Likewise. * tests/misc/chroot-credentials.sh: Likewise. Also fix an instance of comparison against NON_ROOT_GROUP which would have given a false failure if a non numeric value was passed in. * tests/id/setgid.sh: Use previously looked up gid as a more accurate base for the subsequent adjustment, and move the uid lookup within chroot, rather than having the overhead of a separate `id` invocation. --- HACKING | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'HACKING') diff --git a/HACKING b/HACKING index 0b0c6d698..393a6236f 100644 --- a/HACKING +++ b/HACKING @@ -453,7 +453,7 @@ Variables that are significant for tests with their default values are: RUN_VERY_EXPENSIVE_TESTS=no SHELL=/bin/sh NON_ROOT_USERNAME=nobody - NON_ROOT_GROUP=$(id -g $NON_ROOT_USERNAME) + NON_ROOT_GID=$(id -g $NON_ROOT_USERNAME) COREUTILS_GROUPS=$(id -G) There are hundreds of tests in the tests/ directories. You can use -- cgit v1.2.3-54-g00ecf