diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-03-22 08:42:02 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-03-22 15:57:56 +0100 |
commit | c725631f4bebe9ead39c6371431e0b6be8eab2c1 (patch) | |
tree | 369f0e41594eb52bc87d8a14c8c17ef842bf47ce /test/test-execute | |
parent | b1ffacb631d2209174353e35a7ff6acb35c389be (diff) | |
download | systemd-c725631f4bebe9ead39c6371431e0b6be8eab2c1.tar.gz |
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.
Diffstat (limited to 'test/test-execute')
-rw-r--r-- | test/test-execute/exec-capabilityboundingset-invert.service | 2 | ||||
-rw-r--r-- | test/test-execute/exec-privatenetwork-yes.service | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/test/test-execute/exec-capabilityboundingset-invert.service b/test/test-execute/exec-capabilityboundingset-invert.service index fd5d248702..1abe390601 100644 --- a/test/test-execute/exec-capabilityboundingset-invert.service +++ b/test/test-execute/exec-capabilityboundingset-invert.service @@ -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 diff --git a/test/test-execute/exec-privatenetwork-yes.service b/test/test-execute/exec-privatenetwork-yes.service index 3df543ec93..5077f7eed2 100644 --- a/test/test-execute/exec-privatenetwork-yes.service +++ b/test/test-execute/exec-privatenetwork-yes.service @@ -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 |