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/check_cidrs.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tests/check_cidrs.sh') diff --git a/tests/check_cidrs.sh b/tests/check_cidrs.sh index ee89e37..38f735f 100755 --- a/tests/check_cidrs.sh +++ b/tests/check_cidrs.sh @@ -2,22 +2,22 @@ set -e -cmd=../src/ipset +ipset=${IPSET_BIN:-../src/ipset} -$cmd f -$cmd x -$cmd n test hash:net +$ipset f +$ipset x +$ipset n test hash:net for x in `seq 1 32`; do - $cmd a test 10.0.0.0/$x - n=`$cmd l test | wc -l` + $ipset a test 10.0.0.0/$x + n=`$ipset l test | wc -l` n=$((n - 7)) test $n -eq $x || exit 1 done for x in `seq 32 -1 1`; do - $cmd d test 10.0.0.0/$x - n=`$cmd l test | wc -l` + $ipset d test 10.0.0.0/$x + n=`$ipset l test | wc -l` # We deleted one element n=$((n - 7 + 1)) test $n -eq $x || exit 1 done -$cmd x test +$ipset x test -- cgit v1.2.3