|author||Phil Sutter <firstname.lastname@example.org>||2020-01-14 16:50:35 +0100|
|committer||Phil Sutter <email@example.com>||2020-01-16 16:06:14 +0100|
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 run-tests.sh 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 <firstname.lastname@example.org> Acked-by: Pablo Neira Ayuso <email@example.com>
Diffstat (limited to 'tests/shell/testcases/listing/0013objects_0')
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/shell/testcases/listing/0013objects_0 b/tests/shell/testcases/listing/0013objects_0
index f6915796..4d39143d 100755
@@ -42,7 +42,6 @@ $NFT add table test-ip
GET="$($NFT list table test)"
if [ "$EXPECTED" != "$GET" ] ; then
- DIFF="$(which diff)"
- [ -x $DIFF ] && $DIFF -u <(echo "$EXPECTED") <(echo "$GET")
+ $DIFF -u <(echo "$EXPECTED") <(echo "$GET")