From 621f3a27d058d1e2e3e884fa70503e2de5b6c742 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Sun, 5 Mar 2023 12:43:23 +0100 Subject: tests: xlate: Test built binary by default Testing the host's iptables-translate by default is unintuitive. Since the ipset-translate symlink is created upon 'make install', add a local symlink to the repository pointing at a built binary in src/. Using this by default is consistent with the regular testsuite. Signed-off-by: Phil Sutter --- tests/xlate/ipset-translate | 1 + tests/xlate/runtest.sh | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) create mode 120000 tests/xlate/ipset-translate diff --git a/tests/xlate/ipset-translate b/tests/xlate/ipset-translate new file mode 120000 index 0000000..91980c1 --- /dev/null +++ b/tests/xlate/ipset-translate @@ -0,0 +1 @@ +../../src/ipset \ No newline at end of file diff --git a/tests/xlate/runtest.sh b/tests/xlate/runtest.sh index a2a02c0..6a2f80c 100755 --- a/tests/xlate/runtest.sh +++ b/tests/xlate/runtest.sh @@ -6,14 +6,10 @@ if [ ! -x "$DIFF" ] ; then exit 1 fi -IPSET_XLATE=$(which ipset-translate) -if [ ! -x "$IPSET_XLATE" ] ; then - echo "ERROR: ipset-translate is not installed yet" - exit 1 -fi +ipset_xlate=${IPSET_XLATE_BIN:-$(dirname $0)/ipset-translate} TMP=$(mktemp) -ipset-translate restore < xlate.t &> $TMP +$ipset_xlate restore < xlate.t &> $TMP if [ $? -ne 0 ] then cat $TMP -- cgit v1.2.3