diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2018-03-03 13:59:05 +0100 |
---|---|---|
committer | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2018-03-03 13:59:05 +0100 |
commit | 36b914d87d3b3a9cb9554507d3f6702c89154f29 (patch) | |
tree | c1561fedf9366b4f47b789e7785b1ea2641b4cdb /tests | |
parent | 51b09500eaf48825d2663527da4ccb39f226a1db (diff) |
Use 'ss' in runtest.sh but fall back to deprecated 'net-tools' command
Fixes bugzilla id #1209.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runtest.sh | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/runtest.sh b/tests/runtest.sh index 8f4c02a..7afa1dd 100755 --- a/tests/runtest.sh +++ b/tests/runtest.sh @@ -45,12 +45,22 @@ add_tests() { `$cmd -t filter | grep ACCEPT | wc -l` -eq 3 ]; then if [ -z "`which sendip`" ]; then echo "sendip utility is missig: skipping $1 match and target tests" - elif [ -n "`netstat --protocol $1 -n | grep $2`" ]; then - echo "Our test network $2 in use: skipping $1 match and target tests" + return + elif [ -n "`which ss`" ]; then + if [ -n "`ss -f $1 -t -u -a | grep $2`" ]; then + echo "Our test network $2 in use: skipping $1 match and target tests" + return + fi + elif [ -n "`which netstat`" ]; then + if [ -n "`netstat --protocol $1 -n | grep $2`" ]; then + echo "Our test network $2 in use: skipping $1 match and target tests" + return + fi else - tests="$tests $add" + echo "Cannot check test network, skipping $1 match and target tests" + return fi - : + tests="$tests $add" else echo "You have got iptables rules: skipping $1 match and target tests" fi |