]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: avoid a failure when there isn't a name for all user IDs
authorPádraig Brady <P@draigBrady.com>
Sun, 22 Sep 2013 01:49:40 +0000 (02:49 +0100)
committerPádraig Brady <P@draigBrady.com>
Sun, 22 Sep 2013 01:51:37 +0000 (02:51 +0100)
* tests/misc/id-zero.sh: Don't check exit status when in -n mode.

Prompted by the continuous integration build failure at:
http://hydra.nixos.org/build/6196762

tests/misc/id-zero.sh

index cef5672fc01142835e0285d64766447801de3f88..61a2c07cee15dd38156fadf309061f5a128692df 100755 (executable)
@@ -49,8 +49,10 @@ while read u ; do
     for n in '' n ; do
       printf   '%s: ' "id -${o}${n}[z] $u" >> exp || framework_failure_
       printf '\n%s: ' "id -${o}${n}[z] $u" >> out || framework_failure_
-      id -${o}${n}  $u >> exp || fail=1
-      id -${o}${n}z $u  > tmp || fail=1
+      # There may be no name corresponding to an id, so don't check
+      # exit status when in name lookup mode
+      id -${o}${n}  $u >> exp || { test -z "$n" && fail=1; }
+      id -${o}${n}z $u  > tmp || { test -z "$n" && fail=1; }
       head -c-1 < tmp >> out || framework_failure_
     done
   done