]> git.proxmox.com Git - mirror_ovs.git/blob - tests/drop-stats.at
conntrack: Rename "master" connection to "parent" connection.
[mirror_ovs.git] / tests / drop-stats.at
1 AT_BANNER([drop-stats])
2
3 AT_SETUP([drop-stats - cli tests])
4
5 OVS_VSWITCHD_START([dnl
6 set bridge br0 datapath_type=dummy \
7 protocols=OpenFlow10,OpenFlow13,OpenFlow14,OpenFlow15 -- \
8 add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
9
10 AT_DATA([flows.txt], [dnl
11 table=0,in_port=1,actions=drop
12 ])
13
14 AT_CHECK([
15 ovs-ofctl del-flows br0
16 ovs-ofctl -Oopenflow13 add-flows br0 flows.txt
17 ovs-ofctl -Oopenflow13 dump-flows br0 | ofctl_strip | sort | grep actions ], [0], [dnl
18 in_port=1 actions=drop
19 ])
20
21 AT_CHECK([
22 ovs-appctl netdev-dummy/receive p1 'in_port(1),packet_type(ns=0,id=0),eth(src=3a:6d:d2:09:9c:ab,dst=1e:2c:e9:2a:66:9e),ipv4(src=192.168.10.10,dst=192.168.10.30,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
23 ovs-appctl netdev-dummy/receive p1 'in_port(1),packet_type(ns=0,id=0),eth(src=3a:6d:d2:09:9c:ab,dst=1e:2c:e9:2a:66:9e),ipv4(src=192.168.10.10,dst=192.168.10.30,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
24 ovs-appctl netdev-dummy/receive p1 'in_port(1),packet_type(ns=0,id=0),eth(src=3a:6d:d2:09:9c:ab,dst=1e:2c:e9:2a:66:9e),ipv4(src=192.168.10.10,dst=192.168.10.30,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
25 ], [0], [ignore])
26
27 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.0/' | sort], [0], [flow-dump from the main thread:
28 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), packets:2, bytes:212, used:0.0, actions:drop
29 ])
30
31 ovs-appctl time/warp 5000
32
33 AT_CHECK([
34 ovs-appctl coverage/read-counter drop_action_of_pipeline
35 ], [0], [dnl
36 3
37 ])
38
39
40 OVS_VSWITCHD_STOP
41 AT_CLEANUP
42
43 AT_SETUP([drop-stats - pipeline and recurssion drops])
44
45 OVS_VSWITCHD_START([dnl
46 set bridge br0 datapath_type=dummy \
47 protocols=OpenFlow10,OpenFlow13,OpenFlow14,OpenFlow15 -- \
48 add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
49 add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2])
50
51 AT_DATA([flows.txt], [dnl
52 table=0,in_port=1,actions=drop
53 ])
54
55 AT_CHECK([
56 ovs-ofctl del-flows br0
57 ovs-ofctl -Oopenflow13 add-flows br0 flows.txt
58 ovs-ofctl -Oopenflow13 dump-flows br0 | ofctl_strip | sort | grep actions ], [0], [dnl
59 in_port=1 actions=drop
60 ])
61
62 AT_CHECK([
63 ovs-appctl netdev-dummy/receive p1 'in_port(1),packet_type(ns=0,id=0),eth(src=3a:6d:d2:09:9c:ab,dst=1e:2c:e9:2a:66:9e),ipv4(src=192.168.10.10,dst=192.168.10.30,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
64 ], [0], [ignore])
65
66 ovs-appctl time/warp 5000
67
68 AT_CHECK([
69 ovs-appctl coverage/read-counter drop_action_of_pipeline
70 ], [0], [dnl
71 1
72 ])
73
74
75 AT_DATA([flows.txt], [dnl
76 table=0, in_port=1, actions=goto_table:1
77 table=1, in_port=1, actions=goto_table:2
78 table=2, in_port=1, actions=resubmit(,1)
79 ])
80
81 AT_CHECK([
82 ovs-ofctl del-flows br0
83 ovs-ofctl -Oopenflow13 add-flows br0 flows.txt
84 ovs-ofctl -Oopenflow13 dump-flows br0 | ofctl_strip | sort | grep actions ], [0], [ignore])
85
86 AT_CHECK([
87 ovs-appctl netdev-dummy/receive p1 'in_port(1),packet_type(ns=0,id=0),eth(src=3a:6d:d2:09:9c:ab,dst=1e:2c:e9:2a:66:9e),ipv4(src=192.168.10.10,dst=192.168.10.30,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
88 ], [0], [ignore])
89
90 ovs-appctl time/warp 5000
91
92 AT_CHECK([
93 ovs-appctl coverage/read-counter drop_action_recursion_too_deep
94 ], [0], [dnl
95 1
96 ])
97
98
99 OVS_VSWITCHD_STOP(["/|WARN|/d"])
100 AT_CLEANUP
101
102 AT_SETUP([drop-stats - too many resubmit])
103 OVS_VSWITCHD_START
104 add_of_ports br0 1
105 (for i in `seq 1 64`; do
106 j=`expr $i + 1`
107 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
108 done
109 echo "in_port=65, actions=local") > flows.txt
110
111 AT_CHECK([
112 ovs-ofctl del-flows br0
113 ovs-ofctl -Oopenflow13 add-flows br0 flows.txt ], [0], [ignore])
114
115 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x1234)'
116
117 ovs-appctl time/warp 5000
118
119 AT_CHECK([
120 ovs-appctl coverage/read-counter drop_action_too_many_resubmit
121 ], [0], [dnl
122 1
123 ])
124
125 OVS_VSWITCHD_STOP(["/|WARN|/d"])
126 AT_CLEANUP
127
128
129 AT_SETUP([drop-stats - stack too deep])
130 OVS_VSWITCHD_START
131 add_of_ports br0 1
132 (for i in `seq 1 12`; do
133 j=`expr $i + 1`
134 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
135 done
136 push="push:NXM_NX_REG0[[]]"
137 echo "in_port=13, actions=$push,$push,$push,$push,$push,$push,$push,$push") > flows
138
139 AT_CHECK([ovs-ofctl add-flows br0 flows])
140
141 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x1234)'
142
143 ovs-appctl time/warp 5000
144
145 AT_CHECK([
146 ovs-appctl coverage/read-counter drop_action_stack_too_deep
147 ], [0], [dnl
148 1
149 ])
150
151
152 OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of stack/d"])
153 AT_CLEANUP
154
155 AT_SETUP([drop-stats - too many mpls labels])
156
157 OVS_VSWITCHD_START([dnl
158 set bridge br0 datapath_type=dummy \
159 protocols=OpenFlow10,OpenFlow13,OpenFlow14,OpenFlow15 -- \
160 add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
161 add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2])
162
163 AT_DATA([flows.txt], [dnl
164 table=0, in_port=1, actions=push_mpls:0x8847, resubmit:3
165 table=0, in_port=3, actions=push_mpls:0x8847, set_field:10->mpls_label, set_field:15->mpls_label, resubmit:4
166 table=0, in_port=4, actions=push_mpls:0x8847, set_field:11->mpls_label, resubmit:5
167 table=0, in_port=5, actions=push_mpls:0x8847, set_field:12->mpls_label, resubmit:6
168 table=0, in_port=6, actions=push_mpls:0x8847, set_field:13->mpls_label, output:2
169 ])
170
171 AT_CHECK([
172 ovs-ofctl del-flows br0
173 ovs-ofctl -Oopenflow13 add-flows br0 flows.txt
174 ])
175
176 AT_CHECK([
177 ovs-appctl netdev-dummy/receive p1 'in_port(1),packet_type(ns=0,id=0),eth(src=3a:6d:d2:09:9c:ab,dst=1e:2c:e9:2a:66:9e),ipv4(src=192.168.10.10,dst=192.168.10.30,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
178 ], [0], [ignore])
179
180 ovs-appctl time/warp 5000
181
182 AT_CHECK([
183 ovs-appctl coverage/read-counter drop_action_too_many_mpls_labels
184 ], [0], [dnl
185 1
186 ])
187
188
189 OVS_VSWITCHD_STOP(["/|WARN|/d"])
190 AT_CLEANUP