diff options
author | Neutron Soutmun <neo.neutron@gmail.com> | 2014-04-04 10:24:22 +0700 |
---|---|---|
committer | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2014-04-07 21:56:45 +0200 |
commit | f7cafd65feda94b6f21c6b6e36e2bf258e2563d3 (patch) | |
tree | 8e470a67c40a97c012ccb737a9e9d878060e05a4 /tests/runtest.sh | |
parent | 485b3a2d8f46354ebde6017c9bab528108742268 (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/runtest.sh')
-rwxr-xr-x | tests/runtest.sh | 8 |
1 files changed, 5 insertions, 3 deletions
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) |