From f7cafd65feda94b6f21c6b6e36e2bf258e2563d3 Mon Sep 17 00:00:00 2001 From: Neutron Soutmun Date: Fri, 4 Apr 2014 10:24:22 +0700 Subject: ipset: Pass IPSET_BIN to test scripts to change binary location In the "as-installed" package testing situation, the test scripts should invokes the system installed "ipset" binary. Therefore, the IPSET_BIN could be passed to change the binary location. IPSET_BIN=/sbin/ipset ./runtest.sh The test scripts run fine in build source tree without IPSET_BIN. Signed-off-by: Neutron Soutmun Signed-off-by: Jozsef Kadlecsik --- tests/runtest.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tests/runtest.sh') diff --git a/tests/runtest.sh b/tests/runtest.sh index 99e5e6c..fbfa154 100755 --- a/tests/runtest.sh +++ b/tests/runtest.sh @@ -2,6 +2,8 @@ # set -x +ipset=${IPSET_BIN:-../src/ipset} + tests="init" tests="$tests ipmap bitmap:ip" tests="$tests macipmap portmap" @@ -65,7 +67,7 @@ fi chmod a+x check_* *.sh for types in $tests; do - ../src/ipset -X test >/dev/null 2>&1 + $ipset -X test >/dev/null 2>&1 if [ -f $types ]; then filename=$types else @@ -92,7 +94,7 @@ for types in $tests; do ;; esac echo -ne "$types: $what: " - cmd=`echo $cmd | sed 's/ipset/..\/src\/ipset 2>.foo.err/'` + cmd=`echo $cmd | sed "s|ipset|$ipset 2>.foo.err|"` eval $cmd r=$? # echo $ret $r @@ -108,7 +110,7 @@ for types in $tests; do done < $filename done # Remove test sets created by setlist.t -../src/ipset -X >/dev/null 2>&1 +$ipset -X >/dev/null 2>&1 for x in $tests; do case $x in init) -- cgit v1.2.3