path: root/tests/shell/testcases/listing/0011sets_0
diff options
authorPhil Sutter <>2020-01-14 16:50:35 +0100
committerPhil Sutter <>2020-01-16 16:06:14 +0100
commit68310ba0f9c2066f7463d66a1a1938b66fb8a4c4 (patch)
treee1ce9632323f2cfc2d4a061d6e433ddd48dc17ec /tests/shell/testcases/listing/0011sets_0
parent488356b895024d0944b20feb1f930558726e0877 (diff)
tests: shell: Search diff tool once and for all
Instead of calling 'which diff' over and over again, just detect the tool's presence in and pass $DIFF to each testcase just like with nft binary. Fall back to using 'true' command to avoid the need for any conditional calling in test cases. While being at it, unify potential diff calls so that a string comparison in shell happens irrespective of diff presence. Signed-off-by: Phil Sutter <> Acked-by: Pablo Neira Ayuso <>
Diffstat (limited to 'tests/shell/testcases/listing/0011sets_0')
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/shell/testcases/listing/0011sets_0 b/tests/shell/testcases/listing/0011sets_0
index aac9eac9..b6f12b59 100755
--- a/tests/shell/testcases/listing/0011sets_0
+++ b/tests/shell/testcases/listing/0011sets_0
@@ -38,7 +38,6 @@ $NFT add rule inet filter test tcp dport {80, 443}
GET="$($NFT list sets)"
if [ "$EXPECTED" != "$GET" ] ; then
- DIFF="$(which diff)"
- [ -x $DIFF ] && $DIFF -u <(echo "$EXPECTED") <(echo "$GET")
+ $DIFF -u <(echo "$EXPECTED") <(echo "$GET")
exit 1