test-execute: simplify checks if grep output is empty
grep already indicates if it matched anything by return value. Additional advantage is then that if the test fails, the unexpected matching lines are visible in the log output.
This commit is contained in:
@@ -2,6 +2,6 @@
|
||||
Description=Test for CapabilityBoundingSet
|
||||
|
||||
[Service]
|
||||
ExecStart=/bin/sh -x -c 'c=$$(capsh --print | grep "^Bounding set .*cap_chown"); test -z "$$c"'
|
||||
ExecStart=/bin/sh -x -c '! capsh --print | grep "^Bounding set .*cap_chown"'
|
||||
Type=oneshot
|
||||
CapabilityBoundingSet=~CAP_CHOWN
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
Description=Test for PrivateNetwork
|
||||
|
||||
[Service]
|
||||
ExecStart=/bin/sh -x -c 'i=$$(ip link | grep ": " | grep -v ": lo:"); test -z "$$i"'
|
||||
ExecStart=/bin/sh -x -c '! ip link | grep ": " | grep -v ": lo:"'
|
||||
Type=oneshot
|
||||
PrivateNetwork=yes
|
||||
|
||||
Reference in New Issue
Block a user