]> git.proxmox.com Git - mirror_ovs.git/blame - tests/ofp-actions.at
ofproto-dpif: Increase recursion limit.
[mirror_ovs.git] / tests / ofp-actions.at
CommitLineData
f25d0cf3
BP
1AT_BANNER([OpenFlow actions])
2
3AT_SETUP([OpenFlow 1.0 action translation])
4AT_KEYWORDS([OF1.0])
5AT_DATA([test-data], [dnl
6# actions=LOCAL
70000 0008 fffe 04d2
8
9# actions=CONTROLLER:1234
100000 0008 fffd 04d2
11
12# actions=mod_vlan_vid:9
130001 0008 0009 0000
14
15# actions=mod_vlan_pcp:6
160002 0008 06 000000
17
18# actions=strip_vlan
190003 0008 00000000
20
21# actions=mod_dl_src:00:11:22:33:44:55
220004 0010 001122334455 000000000000
23
24# actions=mod_dl_dst:10:20:30:40:50:60
250005 0010 102030405060 000000000000
26
27# actions=mod_nw_src:1.2.3.4
280006 0008 01020304
29
30# actions=mod_nw_dst:192.168.0.1
310007 0008 c0a80001
32
33# actions=mod_nw_tos:48
340008 0008 30 000000
35
36# actions=mod_tp_src:80
370009 0008 0050 0000
38
39# actions=mod_tp_dst:443
40000a 0008 01bb 0000
41
42# actions=enqueue:10q55
43000b 0010 000a 000000000000 00000037
44
45# actions=resubmit:5
46ffff 0010 00002320 0001 0005 00000000
47
48# actions=set_tunnel:0x12345678
49ffff 0010 00002320 0002 0000 12345678
50
51# actions=set_queue:2309737729
52ffff 0010 00002320 0004 0000 89abcd01
53
54# actions=pop_queue
55ffff 0010 00002320 0005 000000000000
56
57# actions=move:NXM_OF_IN_PORT[]->NXM_OF_VLAN_TCI[]
58ffff 0018 00002320 0006 0010 0000 0000 00000002 00000802
59
60# actions=load:0xf009->NXM_OF_VLAN_TCI[]
61ffff 0018 00002320 0007 000f 00000802 000000000000f009
62
63# actions=note:11.e9.9a.ad.67.f3
64ffff 0010 00002320 0008 11e99aad67f3
65
66# actions=set_tunnel64:0xc426384d49c53d60
67ffff 0018 00002320 0009 000000000000 c426384d49c53d60
68
69# actions=set_tunnel64:0x885f3298
70ffff 0018 00002320 0009 000000000000 00000000885f3298
71
72# actions=multipath(eth_src,50,modulo_n,1,0,NXM_NX_REG0[])
73ffff 0020 00002320 000a 0000 0032 0000 0000 0000 0000 0000 0000 001f 00010004
74
75# actions=autopath(2,NXM_NX_REG0[2..30])
76ffff 0018 00002320 000b 009c 00010004 00000002 00000000
77
78# actions=bundle(eth_src,0,hrw,ofport,slaves:4,8)
79ffff 0028 00002320 000c 0001 0000 0000 00000002 0002 0000 00000000 00000000 dnl
800004 0008 00000000
81
82# actions=bundle_load(eth_src,0,hrw,ofport,NXM_NX_REG0[],slaves:4,8)
83ffff 0028 00002320 000d 0001 0000 0000 00000002 0002 001f 00010004 00000000 dnl
840004 0008 00000000
85
86# actions=resubmit(10,5)
87ffff 0010 00002320 000e 000a 05 000000
88
89# actions=output:NXM_NX_REG1[5..10]
90ffff 0018 00002320 000f 0145 00010204 ffff 000000000000
91
92# actions=learn(table=2,idle_timeout=10,hard_timeout=20,fin_idle_timeout=2,fin_hard_timeout=4,priority=80,cookie=0x123456789abcdef0,NXM_OF_VLAN_TCI[0..11],NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],output:NXM_OF_IN_PORT[])
93ffff 0048 00002320 0010 000a 0014 0050 123456789abcdef0 0000 02 00 0002 0004 dnl
94000c 00000802 0000 00000802 0000 dnl
950030 00000406 0000 00000206 0000 dnl
961010 00000002 0000 dnl
9700000000
98
99# actions=exit
100ffff 0010 00002320 0011 000000000000
101
102# actions=dec_ttl
103ffff 0010 00002320 0012 000000000000
104
105# actions=fin_timeout(idle_timeout=10,hard_timeout=20)
106ffff 0010 00002320 0013 000a 0014 0000
107
108# actions=controller(reason=invalid_ttl,max_len=1234,id=5678)
109ffff 0010 00002320 0014 04d2 162e 02 00
110
111])
112sed '/^[[#&]]/d' < test-data > input.txt
113sed -n 's/^# //p; /^$/p' < test-data > expout
114sed -n 's/^& //p' < test-data > experr
115AT_CAPTURE_FILE([input.txt])
116AT_CAPTURE_FILE([expout])
117AT_CAPTURE_FILE([experr])
118AT_CHECK(
119 [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp10-actions < input.txt],
120 [0], [expout], [experr])
121AT_CLEANUP
d01c980f
BP
122
123AT_SETUP([OpenFlow 1.1 action translation])
124AT_KEYWORDS([OF1.1])
125AT_DATA([test-data], [dnl
126# actions=LOCAL
1270000 0010 fffffffe 04d2 000000000000
128
129# actions=CONTROLLER:1234
1300000 0010 fffffffd 04d2 000000000000
131
132# actions=mod_vlan_vid:9
1330001 0008 0009 0000
134
135# actions=mod_vlan_pcp:6
1360002 0008 06 000000
137
138# actions=mod_dl_src:00:11:22:33:44:55
1390003 0010 001122334455 000000000000
140
141# actions=mod_dl_dst:10:20:30:40:50:60
1420004 0010 102030405060 000000000000
143
144# actions=mod_nw_src:1.2.3.4
1450005 0008 01020304
146
147# actions=mod_nw_dst:192.168.0.1
1480006 0008 c0a80001
149
150# actions=mod_nw_tos:48
1510007 0008 30 000000
152
153# actions=mod_tp_src:80
1540009 0008 0050 0000
155
156# actions=mod_tp_dst:443
157000a 0008 01bb 0000
158
159# actions=resubmit:5
160ffff 0010 00002320 0001 0005 00000000
161
162# actions=set_tunnel:0x12345678
163ffff 0010 00002320 0002 0000 12345678
164
165# actions=set_queue:2309737729
166ffff 0010 00002320 0004 0000 89abcd01
167
168# actions=pop_queue
169ffff 0010 00002320 0005 000000000000
170
171# actions=move:NXM_OF_IN_PORT[]->NXM_OF_VLAN_TCI[]
172ffff 0018 00002320 0006 0010 0000 0000 00000002 00000802
173
174# actions=load:0xf009->NXM_OF_VLAN_TCI[]
175ffff 0018 00002320 0007 000f 00000802 000000000000f009
176
177# actions=note:11.e9.9a.ad.67.f3
178ffff 0010 00002320 0008 11e99aad67f3
179
180# actions=set_tunnel64:0xc426384d49c53d60
181ffff 0018 00002320 0009 000000000000 c426384d49c53d60
182
183# actions=set_tunnel64:0x885f3298
184ffff 0018 00002320 0009 000000000000 00000000885f3298
185
186# actions=multipath(eth_src,50,modulo_n,1,0,NXM_NX_REG0[])
187ffff 0020 00002320 000a 0000 0032 0000 0000 0000 0000 0000 0000 001f 00010004
188
189# actions=autopath(2,NXM_NX_REG0[2..30])
190ffff 0018 00002320 000b 009c 00010004 00000002 00000000
191
192# actions=bundle(eth_src,0,hrw,ofport,slaves:4,8)
193ffff 0028 00002320 000c 0001 0000 0000 00000002 0002 0000 00000000 00000000 dnl
1940004 0008 00000000
195
196# actions=bundle_load(eth_src,0,hrw,ofport,NXM_NX_REG0[],slaves:4,8)
197ffff 0028 00002320 000d 0001 0000 0000 00000002 0002 001f 00010004 00000000 dnl
1980004 0008 00000000
199
200# actions=resubmit(10,5)
201ffff 0010 00002320 000e 000a 05 000000
202
203# actions=output:NXM_NX_REG1[5..10]
204ffff 0018 00002320 000f 0145 00010204 ffff 000000000000
205
206# actions=learn(table=2,idle_timeout=10,hard_timeout=20,fin_idle_timeout=2,fin_hard_timeout=4,priority=80,cookie=0x123456789abcdef0,NXM_OF_VLAN_TCI[0..11],NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],output:NXM_OF_IN_PORT[])
207ffff 0048 00002320 0010 000a 0014 0050 123456789abcdef0 0000 02 00 0002 0004 dnl
208000c 00000802 0000 00000802 0000 dnl
2090030 00000406 0000 00000206 0000 dnl
2101010 00000002 0000 dnl
21100000000
212
213# actions=exit
214ffff 0010 00002320 0011 000000000000
215
216# actions=dec_ttl
217ffff 0010 00002320 0012 000000000000
218
219# actions=fin_timeout(idle_timeout=10,hard_timeout=20)
220ffff 0010 00002320 0013 000a 0014 0000
221
222# actions=controller(reason=invalid_ttl,max_len=1234,id=5678)
223ffff 0010 00002320 0014 04d2 162e 02 00
224
225])
226sed '/^[[#&]]/d' < test-data > input.txt
227sed -n 's/^# //p; /^$/p' < test-data > expout
228sed -n 's/^& //p' < test-data > experr
229AT_CAPTURE_FILE([input.txt])
230AT_CAPTURE_FILE([expout])
231AT_CAPTURE_FILE([experr])
232AT_CHECK(
233 [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp11-actions < input.txt],
234 [0], [expout], [experr])
235AT_CLEANUP
236
237AT_SETUP([OpenFlow 1.1 instruction translation])
238AT_KEYWORDS([OF1.1])
239AT_DATA([test-data], [dnl
240# actions=LOCAL
2410004 0018 00000000 dnl
2420000 0010 fffffffe 04d2 000000000000
243
244dnl Check that an empty Apply-Actions instruction gets dropped.
245# actions=drop
246# 0: 00 -> (none)
247# 1: 04 -> (none)
248# 2: 00 -> (none)
249# 3: 08 -> (none)
250# 4: 00 -> (none)
251# 5: 00 -> (none)
252# 6: 00 -> (none)
253# 7: 00 -> (none)
2540004 0008 00000000
255
256# bad OF1.1 instructions: NXBIC_DUP_TYPE
2570004 0008 00000000 0004 0008 00000000
258
259dnl Instructions not multiple of 8 in length.
260& ofp_actions|WARN|OpenFlow message instructions length 9 is not a multiple of 8
261# bad OF1.1 instructions: OFPBIC_BAD_LEN
2620004 0009 01 00000000
263
264dnl Goto-Table instruction too long.
265# bad OF1.1 instructions: OFPBIC_BAD_LEN
2660001 0010 01 000000 0000000000000000
267
268dnl Goto-Table not supported yet.
269# bad OF1.1 instructions: OFPBIC_UNSUP_INST
2700001 0008 01 000000
271
272dnl Write-Metadata not supported yet.
273# bad OF1.1 instructions: OFPBIC_UNSUP_INST
2740002 0018 00000000 fedcba9876543210 ffffffffffffffff
275
276dnl Write-Metadata too short.
277# bad OF1.1 instructions: OFPBIC_BAD_LEN
2780002 0010 00000000 fedcba9876543210
279
280dnl Write-Metadata too long.
281# bad OF1.1 instructions: OFPBIC_BAD_LEN
2820002 0020 00000000 fedcba9876543210 ffffffffffffffff 0000000000000000
283
284dnl Write-Actions not supported yet.
285# bad OF1.1 instructions: OFPBIC_UNSUP_INST
2860003 0008 01 000000
287
288dnl Clear-Actions not supported yet.
289# bad OF1.1 instructions: OFPBIC_UNSUP_INST
2900005 0008 01 000000
291
292dnl Experimenter actions not supported yet.
293# bad OF1.1 instructions: OFPBIC_BAD_EXPERIMENTER
294ffff 0008 01 000000
295
296dnl Bad instruction number (0 not assigned).
297# bad OF1.1 instructions: OFPBIC_UNKNOWN_INST
2980000 0008 01 000000
299
300])
301sed '/^[[#&]]/d' < test-data > input.txt
302sed -n 's/^# //p; /^$/p' < test-data > expout
303sed -n 's/^& //p' < test-data > experr
304AT_CAPTURE_FILE([input.txt])
305AT_CAPTURE_FILE([expout])
306AT_CAPTURE_FILE([experr])
307AT_CHECK(
308 [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp11-instructions < input.txt],
309 [0], [expout], [experr])
310AT_CLEANUP