aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Junos <petoju@gmail.com>2020-01-29 23:33:48 +0100
committerStephen Hemminger <stephen@networkplumber.org>2020-02-04 03:21:06 -0800
commit39995691b51c448b4d58845efc32b65dafcc48d7 (patch)
treea31955bac9c36a48c649ecd5c506b40bb2714b80
parent8f9f2b9cdfbd1c7988542d81db1db854d48f2b0d (diff)
downloadiproute2-39995691b51c448b4d58845efc32b65dafcc48d7.tar.gz
ss: fix tests to reflect compact output
This fixes broken tests in commit c4f5862994589 ("ss: use compact output for undetected screen width") It also escapes stars as grep is used and more bugs could sneak under the radar with the previous solution. Signed-off-by: Peter Junos <petoju@gmail.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-rwxr-xr-xtestsuite/tests/ss/ssfilter.t24
1 files changed, 12 insertions, 12 deletions
diff --git a/testsuite/tests/ss/ssfilter.t b/testsuite/tests/ss/ssfilter.t
index 3091054f2..4c2315ca7 100755
--- a/testsuite/tests/ss/ssfilter.t
+++ b/testsuite/tests/ss/ssfilter.t
@@ -12,37 +12,37 @@ export TCPDIAG_FILE="$(dirname $0)/ss1.dump"
ts_log "[Testing ssfilter]"
ts_ss "$0" "Match dport = 22" -Htna dport = 22
-test_on "ESTAB 0 0 10.0.0.1:36266 10.0.0.1:22"
+test_on "ESTAB 0 0 10.0.0.1:36266 10.0.0.1:22"
ts_ss "$0" "Match dport 22" -Htna dport 22
-test_on "ESTAB 0 0 10.0.0.1:36266 10.0.0.1:22"
+test_on "ESTAB 0 0 10.0.0.1:36266 10.0.0.1:22"
ts_ss "$0" "Match (dport)" -Htna '( dport = 22 )'
-test_on "ESTAB 0 0 10.0.0.1:36266 10.0.0.1:22"
+test_on "ESTAB 0 0 10.0.0.1:36266 10.0.0.1:22"
ts_ss "$0" "Match src = 0.0.0.0" -Htna src = 0.0.0.0
-test_on "LISTEN 0 128 0.0.0.0:22 0.0.0.0:*"
+test_on "LISTEN 0 128 0.0.0.0:22 0.0.0.0:\*"
ts_ss "$0" "Match src 0.0.0.0" -Htna src 0.0.0.0
-test_on "LISTEN 0 128 0.0.0.0:22 0.0.0.0:*"
+test_on "LISTEN 0 128 0.0.0.0:22 0.0.0.0:\*"
ts_ss "$0" "Match src sport" -Htna src 0.0.0.0 sport = 22
-test_on "LISTEN 0 128 0.0.0.0:22 0.0.0.0:*"
+test_on "LISTEN 0 128 0.0.0.0:22 0.0.0.0:\*"
ts_ss "$0" "Match src and sport" -Htna src 0.0.0.0 and sport = 22
-test_on "LISTEN 0 128 0.0.0.0:22 0.0.0.0:*"
+test_on "LISTEN 0 128 0.0.0.0:22 0.0.0.0:\*"
ts_ss "$0" "Match src and sport and dport" -Htna src 10.0.0.1 and sport = 22 and dport = 50312
-test_on "ESTAB 0 0 10.0.0.1:22 10.0.0.2:50312"
+test_on "ESTAB 0 0 10.0.0.1:22 10.0.0.2:50312"
ts_ss "$0" "Match src and sport and (dport)" -Htna 'src 10.0.0.1 and sport = 22 and ( dport = 50312 )'
-test_on "ESTAB 0 0 10.0.0.1:22 10.0.0.2:50312"
+test_on "ESTAB 0 0 10.0.0.1:22 10.0.0.2:50312"
ts_ss "$0" "Match src and (sport and dport)" -Htna 'src 10.0.0.1 and ( sport = 22 and dport = 50312 )'
-test_on "ESTAB 0 0 10.0.0.1:22 10.0.0.2:50312"
+test_on "ESTAB 0 0 10.0.0.1:22 10.0.0.2:50312"
ts_ss "$0" "Match (src and sport) and dport" -Htna '( src 10.0.0.1 and sport = 22 ) and dport = 50312'
-test_on "ESTAB 0 0 10.0.0.1:22 10.0.0.2:50312"
+test_on "ESTAB 0 0 10.0.0.1:22 10.0.0.2:50312"
ts_ss "$0" "Match (src or src) and dst" -Htna '( src 0.0.0.0 or src 10.0.0.1 ) and dst 10.0.0.2'
-test_on "ESTAB 0 0 10.0.0.1:22 10.0.0.2:50312"
+test_on "ESTAB 0 0 10.0.0.1:22 10.0.0.2:50312"