summaryrefslogtreecommitdiffstats
path: root/tests/check_cidrs.sh
diff options
context:
space:
mode:
authorNeutron Soutmun <neo.neutron@gmail.com>2014-04-04 10:24:22 +0700
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2014-04-07 21:56:45 +0200
commitf7cafd65feda94b6f21c6b6e36e2bf258e2563d3 (patch)
tree8e470a67c40a97c012ccb737a9e9d878060e05a4 /tests/check_cidrs.sh
parent485b3a2d8f46354ebde6017c9bab528108742268 (diff)
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 <neo.neutron@gmail.com> Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Diffstat (limited to 'tests/check_cidrs.sh')
-rwxr-xr-xtests/check_cidrs.sh18
1 files changed, 9 insertions, 9 deletions
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