From ed57568ea5fc9dcca8fd4dce00bb3085727e119a Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 8 Jul 2017 12:01:34 +0200 Subject: [PATCH] tests: groups-dash.sh: avoid false failure MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * tests/misc/groups-dash.sh: Avoid false failure on a system for which "none" is a valid user name. The first invocation would succeed, and the second would fail with "groups: ‘--’: no such user". Use a user name that cannot exist. --- tests/misc/groups-dash.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/misc/groups-dash.sh b/tests/misc/groups-dash.sh index ca81cb40b4..37675b4db6 100755 --- a/tests/misc/groups-dash.sh +++ b/tests/misc/groups-dash.sh @@ -19,12 +19,14 @@ . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src print_ver_ groups +# An invalid user name +user=:invalid + +printf '%s\n' "groups: ':invalid': no such user" > exp || framework_failure_ + # Coreutils 6.9 and earlier failed to display information on first argument # if later argument was --. -groups none -- > out 2>&1 && fail=1 -echo $? >> out -groups -- none -- > exp 2>&1 && fail=1 -echo $? >> exp +returns_ 1 groups $user -- > out 2>&1 || fail=1 compare exp out || fail=1 -- 2.47.2