]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-13-NSPAWN.nss-mymachines: Use negative matching switch
authorMichal Koutný <mkoutny@suse.com>
Tue, 25 Feb 2025 10:36:51 +0000 (11:36 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 4 Mar 2025 21:28:53 +0000 (21:28 +0000)
The test expects _not_ to find the patterns but the run_and_grep would
still print 'FAIL:' message. Use the dedicated -n option that inverts
the semantics cleaner than shell's !.

(cherry picked from commit c4b75966075e01d39556a87caa778eb63d96d6f6)

test/units/TEST-13-NSPAWN.nss-mymachines.sh

index 817431b449ad38ae2cc43bddec4e557b0d3288e2..cfae33b1b3b48e571692bc38b42220ca8227cafd 100755 (executable)
@@ -114,8 +114,8 @@ for i in {100..120}; do
     run_and_grep "^10\.2\.0\.$i\s+STREAM" getent ahostsv4 -s mymachines nss-mymachines-manyips
 done
 run_and_grep "^fd00:dead:beef:cafe::2\s+STREAM" getent ahostsv6 -s mymachines nss-mymachines-manyips
-(! run_and_grep "^fd00:" getent ahostsv4 -s mymachines nss-mymachines-manyips)
-(! run_and_grep "^10\.2:" getent ahostsv6 -s mymachines nss-mymachines-manyips)
+run_and_grep -n "^fd00:" getent ahostsv4 -s mymachines nss-mymachines-manyips
+run_and_grep -n "^10\.2:" getent ahostsv6 -s mymachines nss-mymachines-manyips
 
 # Multiple machines at once
 run_and_grep "^10\.1\.0\.2\s+nss-mymachines-singleip$" getent hosts -s mymachines nss-mymachines-{singleip,manyips}