]> git.ipfire.org Git - thirdparty/ipset.git/commitdiff
tests: xlate: Test built binary by default
authorPhil Sutter <phil@nwl.cc>
Sun, 5 Mar 2023 11:43:23 +0000 (12:43 +0100)
committerPhil Sutter <phil@nwl.cc>
Fri, 10 Mar 2023 12:16:51 +0000 (13:16 +0100)
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 <phil@nwl.cc>
tests/xlate/ipset-translate [new symlink]
tests/xlate/runtest.sh

diff --git a/tests/xlate/ipset-translate b/tests/xlate/ipset-translate
new file mode 120000 (symlink)
index 0000000..91980c1
--- /dev/null
@@ -0,0 +1 @@
+../../src/ipset
\ No newline at end of file
index a2a02c05d75736d8b09b27d3d428296f3b0efc05..6a2f80c0d9e611d1c1dc00a85169c6fd62c66a09 100755 (executable)
@@ -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