]> git.proxmox.com Git - mirror_iproute2.git/blame - testsuite/tests/ss/ssfilter.t
testsuite: ss: Fix spacing in expected output for ssfilter.t
[mirror_iproute2.git] / testsuite / tests / ss / ssfilter.t
CommitLineData
d67eb4fb
PS
1#!/bin/sh
2
3. lib/generic.sh
4
5# % ./misc/ss -Htna
6# LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
7# ESTAB 0 0 10.0.0.1:22 10.0.0.1:36266
8# ESTAB 0 0 10.0.0.1:36266 10.0.0.1:22
9# ESTAB 0 0 10.0.0.1:22 10.0.0.2:50312
10export TCPDIAG_FILE="$(dirname $0)/ss1.dump"
11
12ts_log "[Testing ssfilter]"
13
14ts_ss "$0" "Match dport = 22" -Htna dport = 22
6d1af9ab 15test_on "ESTAB 0 0 10.0.0.1:36266 10.0.0.1:22"
d67eb4fb
PS
16
17ts_ss "$0" "Match dport 22" -Htna dport 22
6d1af9ab 18test_on "ESTAB 0 0 10.0.0.1:36266 10.0.0.1:22"
d67eb4fb
PS
19
20ts_ss "$0" "Match (dport)" -Htna '( dport = 22 )'
6d1af9ab 21test_on "ESTAB 0 0 10.0.0.1:36266 10.0.0.1:22"
d67eb4fb
PS
22
23ts_ss "$0" "Match src = 0.0.0.0" -Htna src = 0.0.0.0
6d1af9ab 24test_on "LISTEN 0 128 0.0.0.0:22 0.0.0.0:*"
d67eb4fb
PS
25
26ts_ss "$0" "Match src 0.0.0.0" -Htna src 0.0.0.0
6d1af9ab 27test_on "LISTEN 0 128 0.0.0.0:22 0.0.0.0:*"
d67eb4fb
PS
28
29ts_ss "$0" "Match src sport" -Htna src 0.0.0.0 sport = 22
6d1af9ab 30test_on "LISTEN 0 128 0.0.0.0:22 0.0.0.0:*"
d67eb4fb
PS
31
32ts_ss "$0" "Match src and sport" -Htna src 0.0.0.0 and sport = 22
6d1af9ab 33test_on "LISTEN 0 128 0.0.0.0:22 0.0.0.0:*"
d67eb4fb
PS
34
35ts_ss "$0" "Match src and sport and dport" -Htna src 10.0.0.1 and sport = 22 and dport = 50312
6d1af9ab 36test_on "ESTAB 0 0 10.0.0.1:22 10.0.0.2:50312"
d67eb4fb
PS
37
38ts_ss "$0" "Match src and sport and (dport)" -Htna 'src 10.0.0.1 and sport = 22 and ( dport = 50312 )'
6d1af9ab 39test_on "ESTAB 0 0 10.0.0.1:22 10.0.0.2:50312"
d67eb4fb
PS
40
41ts_ss "$0" "Match src and (sport and dport)" -Htna 'src 10.0.0.1 and ( sport = 22 and dport = 50312 )'
6d1af9ab 42test_on "ESTAB 0 0 10.0.0.1:22 10.0.0.2:50312"
d67eb4fb
PS
43
44ts_ss "$0" "Match (src and sport) and dport" -Htna '( src 10.0.0.1 and sport = 22 ) and dport = 50312'
6d1af9ab 45test_on "ESTAB 0 0 10.0.0.1:22 10.0.0.2:50312"
d67eb4fb
PS
46
47ts_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'
6d1af9ab 48test_on "ESTAB 0 0 10.0.0.1:22 10.0.0.2:50312"