blob: 13f000f2c33e5cac9de4ee4c14a982c406333ff2 [file] [log] [blame]
castroflaviobd48e302015-12-15 17:57:38 -05001"""
castroflaviobd48e302015-12-15 17:57:38 -05002"""
Flavio Castro1c9b1252016-02-04 18:42:58 -05003import Queue
castroflaviobd48e302015-12-15 17:57:38 -05004
5from oftest import config
6import logging
7import oftest.base_tests as base_tests
8import ofp
9from oftest.testutils import *
10from accton_util import *
Flavio Castro54947942016-02-03 16:05:20 -050011import inspect
12
13@disabled
14class Mtu4000(base_tests.SimpleDataPlane):
15 """
16 Test output function for an exact-match flow
17 For each port A, adds a flow directing matching packets to that port.
18 Then, for all other ports B != A, verifies that sending a matching packet
19 to B results in an output to A.
20 """
21 def runTest(self):
22 ports = sorted(config["port_map"].keys())
23
24 delete_all_flows(self.controller)
25 delete_all_groups(self.controller)
26
27 add_vlan_table_flow(self.controller, config["port_map"].keys())
28
29 # set up tag groups for each port
30 add_l2_interface_group(self.controller, config["port_map"].keys(), 1, True, 1)
31
32 for port in ports:
33 add_one_l2_interface_group(self.controller, port, 1, True, False)
34 add_one_vlan_table_flow(self.controller, port, 1, flag=VLAN_TABLE_FLAG_ONLY_TAG)
35 group_id = encode_l2_interface_group_id(1, port)
36 add_bridge_flow(self.controller, [0x00, 0x12, 0x34, 0x56, 0x78, port], 1, group_id, True)
37 do_barrier(self.controller)
38
39 for out_port in ports:
40 # change dest based on port number
41 mac_dst= '00:12:34:56:78:%02X' % out_port
42 for in_port in ports:
43 if in_port == out_port:
44 continue
45 # change source based on port number to avoid packet-ins from learning
46 mac_src= '00:12:34:56:78:%02X' % in_port
47 parsed_pkt = simple_tcp_packet(pktlen=4000,dl_vlan_enable=True, vlan_vid=1, eth_dst=mac_dst, eth_src=mac_src)
48 pkt = str(parsed_pkt)
49 self.dataplane.send(in_port, pkt)
50
51 for ofport in ports:
52 if ofport in [out_port]:
53 verify_packet(self, pkt, ofport)
54 else:
55 verify_no_packet(self, pkt, ofport)
56
57 verify_no_other_packets(self)
Flavio Castro1c9b1252016-02-04 18:42:58 -050058@disabled
castroflaviobd48e302015-12-15 17:57:38 -050059class Mtu4500(base_tests.SimpleDataPlane):
60
61 def runTest(self):
62 ports = sorted(config["port_map"].keys())
63
64 delete_all_flows(self.controller)
65 delete_all_groups(self.controller)
66
67 for port in ports:
68 add_one_l2_interface_group(self.controller, port, 1, True, False)
69 add_one_vlan_table_flow(self.controller, port, 1, flag=VLAN_TABLE_FLAG_ONLY_TAG)
70 group_id = encode_l2_interface_group_id(1, port)
71 add_bridge_flow(self.controller, [0x00, 0x12, 0x34, 0x56, 0x78, port], 1, group_id, True)
72 do_barrier(self.controller)
73
74 for out_port in ports:
75 # change dest based on port number
76 mac_dst= '00:12:34:56:78:%02X' % out_port
77 for in_port in ports:
78 if in_port == out_port:
79 continue
80 # change source based on port number to avoid packet-ins from learning
81 mac_src= '00:12:34:56:78:%02X' % in_port
82 parsed_pkt = simple_tcp_packet(pktlen=4500,dl_vlan_enable=True, vlan_vid=1, eth_dst=mac_dst, eth_src=mac_src)
83 pkt = str(parsed_pkt)
84 self.dataplane.send(in_port, pkt)
85
86 for ofport in ports:
87 if ofport in [out_port]:
88 verify_packet(self, pkt, ofport)
89 else:
90 verify_no_packet(self, pkt, ofport)
91
92 verify_no_other_packets(self)
93
Flavio Castro54947942016-02-03 16:05:20 -050094
95@disabled
castroflaviobd48e302015-12-15 17:57:38 -050096class L3McastToVPN(base_tests.SimpleDataPlane):
97 """
98 Mcast routing
99 """
100 def runTest(self):
101 """
102 port1 (vlan 1)-> port 2 (vlan 2)
103 """
104 #delete_all_flows(self.controller)
105 #delete_all_groups(self.controller)
106
107 if len(config["port_map"]) <3:
Flavio Castro54947942016-02-03 16:05:20 -0500108 logging.info("Port count less than 3, can't run this case")
109 assert(False)
castroflaviobd48e302015-12-15 17:57:38 -0500110 return
111
112 vlan_id =1
113 port2_out_vlan=2
114 port3_out_vlan=3
115 in_vlan=1 #macast group vid shall use input vlan diffe from l3 interface use output vlan
116 intf_src_mac=[0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc]
117 intf_src_mac_str=':'.join(['%02X' % x for x in intf_src_mac])
118 dst_mac=[0x01, 0x00, 0x5e, 0x01, 0x01, 0x01]
119 dst_mac_str=':'.join(['%02X' % x for x in dst_mac])
120 port1_mac=[0x00, 0x11, 0x11, 0x11, 0x11, 0x11]
121 port1_mac_str=':'.join(['%02X' % x for x in port1_mac])
122 src_ip=0xc0a80101
123 src_ip_str="192.168.1.1"
124 dst_ip=0xe0010101
125 dst_ip_str="224.1.1.1"
126
127 port1=config["port_map"].keys()[0]
128 port2=config["port_map"].keys()[1]
129 port3=config["port_map"].keys()[2]
130
131 #add l2 interface group
132 for port in config["port_map"].keys():
133 add_one_l2_interface_group(self.controller, port, vlan_id=vlan_id, is_tagged=False, send_barrier=False)
134 #add vlan flow table
135 add_one_vlan_table_flow(self.controller, port, vlan_id, flag=VLAN_TABLE_FLAG_ONLY_TAG)
136 vlan_id +=1
137
138 #add termination flow
139 add_termination_flow(self.controller, port1, 0x0800, [0x01, 0x00, 0x5e, 0x00, 0x00, 0x00], vlan_id)
140
141 #add MPLS interface group
142 l2_gid = encode_l2_interface_group_id(port2_out_vlan, port2)
143 mpls_gid2, mpls_msg = add_mpls_intf_group(self.controller, l2_gid, dst_mac, intf_src_mac, port2_out_vlan, port2)
144 l2_gid3 = encode_l2_interface_group_id(port3_out_vlan, port3)
145 mpls_gid3, mpls_msg = add_mpls_intf_group(self.controller, l2_gid3, dst_mac, intf_src_mac, port3_out_vlan, port3)
146 #add L3VPN groups
147 mpls_label_gid2, mpls_label_msg = add_mpls_label_group(self.controller, subtype=OFDPA_MPLS_GROUP_SUBTYPE_L3_VPN_LABEL,
Flavio Castro54947942016-02-03 16:05:20 -0500148 index=(0x20000+port2), ref_gid= mpls_gid2, push_mpls_header=True, set_mpls_label=port2, set_bos=1, cpy_ttl_outward=True)
castroflaviobd48e302015-12-15 17:57:38 -0500149 mpls_label_gid3, mpls_label_msg = add_mpls_label_group(self.controller, subtype=OFDPA_MPLS_GROUP_SUBTYPE_L3_VPN_LABEL,
Flavio Castro54947942016-02-03 16:05:20 -0500150 index=(0x10000+port3), ref_gid= mpls_gid3, push_mpls_header=True, set_mpls_label=port3, set_bos=1, cpy_ttl_outward=True)
castroflaviobd48e302015-12-15 17:57:38 -0500151
152 mcat_group_msg=add_l3_mcast_group(self.controller, in_vlan, 2, [0x92020022 , 0x92010023])
153 add_mcast4_routing_flow(self.controller, in_vlan, src_ip, 0, dst_ip, mcat_group_msg.group_id)
154
155 parsed_pkt = simple_tcp_packet(pktlen=100, dl_vlan_enable=True, vlan_vid=1,
156 eth_dst=dst_mac_str,
157 eth_src=port1_mac_str,
158 ip_ttl=64,
159 ip_src=src_ip_str,
160 ip_dst=dst_ip_str)
161 pkt=str(parsed_pkt)
162 self.dataplane.send(port1, pkt)
163 label = (in_vlan, 0, 1, 63)
164 parsed_pkt = mpls_packet(pktlen=100,
Flavio Castro54947942016-02-03 16:05:20 -0500165 eth_dst=dst_mac_str,
166 eth_src=intf_src_mac_str,
167 ip_ttl=63,
168 ip_src=src_ip_str, label= [label],
169 ip_dst=dst_ip_str)
castroflaviobd48e302015-12-15 17:57:38 -0500170 pkt=str(parsed_pkt)
171 verify_packet(self, pkt, port2)
172 verify_packet(self, pkt, port3)
173 verify_no_other_packets(self)
Flavio Castro1c9b1252016-02-04 18:42:58 -0500174
175class LPMDirect(base_tests.SimpleDataPlane):
176 """
177 Insert IP packet
178 Receive MPLS packet
179 """
180 def runTest(self):
181 Groups=Queue.LifoQueue()
182 if len(config["port_map"]) <2:
183 logging.info("Port count less than 2, can't run this case")
184 return
185 intf_src_mac=[0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc]
186 dst_mac=[0x00, 0x00, 0x00, 0x22, 0x22, 0x00]
187 dip=0xc0a80001
188 index=1
189 ports = config["port_map"].keys()
190 for port in ports:
191 #add l2 interface group
192 vlan_id=port
193 l2_gid, l2_msg = add_one_l2_interface_group(self.controller, port, vlan_id, True, True)
194 dst_mac[5]=vlan_id
195 #add MPLS interface group
196 mpls_gid, mpls_msg = add_mpls_intf_group(self.controller, l2_gid, dst_mac, intf_src_mac, vlan_id, port)
197 #add MPLS L3 VPN group
198 mpls_label_gid, mpls_label_msg = add_mpls_label_group(self.controller, subtype=OFDPA_MPLS_GROUP_SUBTYPE_L3_VPN_LABEL,
199 index=port, ref_gid= mpls_gid, push_mpls_header=True, set_mpls_label=port, set_bos=1, set_ttl=32)
200 #ecmp_msg=add_l3_ecmp_group(self.controller, vlan_id, [mpls_label_gid])
201 Groups._put(l2_gid)
202 Groups._put(mpls_gid)
203 Groups._put(mpls_label_gid)
204 do_barrier(self.controller)
205 #add vlan flow table
206 add_one_vlan_table_flow(self.controller, port, vlan_id, vrf=0, flag=VLAN_TABLE_FLAG_ONLY_TAG)
207 #add termination flow
208 add_termination_flow(self.controller, port, 0x0800, intf_src_mac, vlan_id)
209 #add routing flow
210 dst_ip = dip + (vlan_id<<8)
211 add_unicast_routing_flow(self.controller, 0x0800, dst_ip, 0xffffff00, mpls_label_gid, vrf=2)
212 #add_unicast_routing_flow(self.controller, 0x0800, dst_ip, 0xffffff00, ecmp_msg.group_id)
213 port = ports[0]
214 #add l2 interface group
215 vlan_id=port
216 l2_gid = encode_l2_interface_group_id(vlan_id, port)
217 dst_mac[5]=vlan_id
218 #add MPLS interface group
219 mpls_gid = encode_mpls_interface_group_id(0, port)
220 #add MPLS L3 VPN group
221 mpls_label_gid = encode_mpls_label_group_id(OFDPA_MPLS_GROUP_SUBTYPE_L3_VPN_LABEL, index=port)
222 #ecmp_msg=add_l3_ecmp_group(self.controller, vlan_id, [mpls_label_gid])
223 do_barrier(self.controller)
224 #add routing flow
225 dst_ip = 0x0
226 add_unicast_routing_flow(self.controller, 0x0800, dst_ip, 0x0, mpls_label_gid, vrf=2)
227 #add_unicast_routing_flow(self.controller, 0x0800, dst_ip, 0x0, ecmp_msg.group_id)
228
229 do_barrier(self.controller)
230
231 switch_mac = ':'.join(['%02X' % x for x in intf_src_mac])
232 for in_port in ports:
233 mac_src='00:00:00:22:22:%02X' % in_port
234 ip_src='192.168.%02d.1' % in_port
235 for out_port in ports:
236 if in_port == out_port:
237 continue
238 ip_dst='192.168.%02d.1' % out_port
239 parsed_pkt = simple_tcp_packet(pktlen=100, dl_vlan_enable=True, vlan_vid=in_port,
240 eth_dst=switch_mac, eth_src=mac_src, ip_ttl=64, ip_src=ip_src,
241 ip_dst=ip_dst)
242 pkt=str(parsed_pkt)
243 self.dataplane.send(in_port, pkt)
244 #build expect packet
245 mac_dst='00:00:00:22:22:%02X' % out_port
246 label = (out_port, 0, 1, 32)
247 exp_pkt = mpls_packet(pktlen=104, dl_vlan_enable=True, vlan_vid=out_port, ip_ttl=63, ip_src=ip_src,
248 ip_dst=ip_dst, eth_dst=mac_dst, eth_src=switch_mac, label=[label])
249 pkt=str(exp_pkt)
250 verify_packet(self, pkt, out_port)
251 verify_no_other_packets(self)
252 ip_dst='1.168.%02d.1' % ports[0]
253 parsed_pkt = simple_tcp_packet(pktlen=100, dl_vlan_enable=True, vlan_vid=in_port,
254 eth_dst=switch_mac, eth_src=mac_src, ip_ttl=64, ip_src=ip_src, ip_dst=ip_dst)
255 pkt=str(parsed_pkt)
256 self.dataplane.send(in_port, pkt)
257 #build expect packet
258 mac_dst='00:00:00:22:22:%02X' % ports[0]
259 label = (ports[0], 0, 1, 32)
260 exp_pkt = mpls_packet(pktlen=104, dl_vlan_enable=True, vlan_vid=ports[0], ip_ttl=63, ip_src=ip_src,
261 ip_dst=ip_dst, eth_dst=mac_dst, eth_src=switch_mac, label=[label])
262 pkt=str(exp_pkt)
263 verify_packet(self, pkt, ports[0])
264 verify_no_other_packets(self)
265 delete_all_flows(self.controller)
266 delete_groups(self.controller,Groups)
267
Flavio Castro54947942016-02-03 16:05:20 -0500268class LPM(base_tests.SimpleDataPlane):
269 """
270 Insert IP packet
271 Receive MPLS packet
272 """
273 def runTest(self):
Flavio Castro1c9b1252016-02-04 18:42:58 -0500274 Groups=Queue.LifoQueue()
Flavio Castro54947942016-02-03 16:05:20 -0500275 if len(config["port_map"]) <2:
276 logging.info("Port count less than 2, can't run this case")
277 return
Flavio Castro54947942016-02-03 16:05:20 -0500278 intf_src_mac=[0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc]
279 dst_mac=[0x00, 0x00, 0x00, 0x22, 0x22, 0x00]
280 dip=0xc0a80001
281 index=1
282 ports = config["port_map"].keys()
283 for port in ports:
284 #add l2 interface group
285 vlan_id=port
286 l2_gid, l2_msg = add_one_l2_interface_group(self.controller, port, vlan_id, True, True)
287 dst_mac[5]=vlan_id
288 #add MPLS interface group
289 mpls_gid, mpls_msg = add_mpls_intf_group(self.controller, l2_gid, dst_mac, intf_src_mac, vlan_id, port)
290 #add MPLS L3 VPN group
291 mpls_label_gid, mpls_label_msg = add_mpls_label_group(self.controller, subtype=OFDPA_MPLS_GROUP_SUBTYPE_L3_VPN_LABEL,
292 index=port, ref_gid= mpls_gid, push_mpls_header=True, set_mpls_label=port, set_bos=1, set_ttl=32)
293 ecmp_msg=add_l3_ecmp_group(self.controller, vlan_id, [mpls_label_gid])
Flavio Castro1c9b1252016-02-04 18:42:58 -0500294 Groups._put(l2_gid)
295 Groups._put(mpls_gid)
296 Groups._put(mpls_label_gid)
297 Groups._put(ecmp_msg.group_id)
Flavio Castro54947942016-02-03 16:05:20 -0500298 do_barrier(self.controller)
299 #add vlan flow table
300 add_one_vlan_table_flow(self.controller, port, vlan_id, vrf=0, flag=VLAN_TABLE_FLAG_ONLY_TAG)
301 #add termination flow
302 add_termination_flow(self.controller, port, 0x0800, intf_src_mac, vlan_id)
303 #add routing flow
304 dst_ip = dip + (vlan_id<<8)
305 #add_unicast_routing_flow(self.controller, 0x0800, dst_ip, 0xffffff00, mpls_label_gid, vrf=2)
306 add_unicast_routing_flow(self.controller, 0x0800, dst_ip, 0xffffff00, ecmp_msg.group_id)
307 #add entries in the Bridging table to avoid packet-in from mac learning
308 group_id = encode_l2_interface_group_id(vlan_id, port)
309 add_bridge_flow(self.controller, dst_mac, vlan_id, group_id, True)
310 port = ports[0]
311 #add l2 interface group
312 vlan_id=port
313 l2_gid = encode_l2_interface_group_id(vlan_id, port)
314 dst_mac[5]=vlan_id
315 #add MPLS interface group
316 mpls_gid = encode_mpls_interface_group_id(0, port)
317 #add MPLS L3 VPN group
318 mpls_label_gid = encode_mpls_label_group_id(OFDPA_MPLS_GROUP_SUBTYPE_L3_VPN_LABEL, index=port)
319 ecmp_msg=add_l3_ecmp_group(self.controller, vlan_id, [mpls_label_gid])
320 do_barrier(self.controller)
321 #add routing flow
322 dst_ip = 0x0
323 #add_unicast_routing_flow(self.controller, 0x0800, dst_ip, 0x0, mpls_label_gid, vrf=2)
324 add_unicast_routing_flow(self.controller, 0x0800, dst_ip, 0x0, ecmp_msg.group_id)
325
326 do_barrier(self.controller)
327
328 switch_mac = ':'.join(['%02X' % x for x in intf_src_mac])
329 for in_port in ports:
330 mac_src='00:00:00:22:22:%02X' % in_port
331 ip_src='192.168.%02d.1' % in_port
332 for out_port in ports:
333 if in_port == out_port:
334 continue
335 ip_dst='192.168.%02d.1' % out_port
336 parsed_pkt = simple_tcp_packet(pktlen=100, dl_vlan_enable=True, vlan_vid=in_port,
337 eth_dst=switch_mac, eth_src=mac_src, ip_ttl=64, ip_src=ip_src,
338 ip_dst=ip_dst)
339 pkt=str(parsed_pkt)
340 self.dataplane.send(in_port, pkt)
341 #build expect packet
342 mac_dst='00:00:00:22:22:%02X' % out_port
343 label = (out_port, 0, 1, 32)
344 exp_pkt = mpls_packet(pktlen=104, dl_vlan_enable=True, vlan_vid=out_port, ip_ttl=63, ip_src=ip_src,
345 ip_dst=ip_dst, eth_dst=mac_dst, eth_src=switch_mac, label=[label])
346 pkt=str(exp_pkt)
347 verify_packet(self, pkt, out_port)
348 verify_no_other_packets(self)
349 ip_dst='1.168.%02d.1' % ports[0]
350 parsed_pkt = simple_tcp_packet(pktlen=100, dl_vlan_enable=True, vlan_vid=in_port,
351 eth_dst=switch_mac, eth_src=mac_src, ip_ttl=64, ip_src=ip_src, ip_dst=ip_dst)
352 pkt=str(parsed_pkt)
353 self.dataplane.send(in_port, pkt)
354 #build expect packet
355 mac_dst='00:00:00:22:22:%02X' % ports[0]
356 label = (ports[0], 0, 1, 32)
357 exp_pkt = mpls_packet(pktlen=104, dl_vlan_enable=True, vlan_vid=ports[0], ip_ttl=63, ip_src=ip_src,
358 ip_dst=ip_dst, eth_dst=mac_dst, eth_src=switch_mac, label=[label])
359 pkt=str(exp_pkt)
360 verify_packet(self, pkt, ports[0])
361 verify_no_other_packets(self)
Flavio Castro1c9b1252016-02-04 18:42:58 -0500362 delete_all_flows(self.controller)
363 delete_groups(self.controller,Groups)
Flavio Castro54947942016-02-03 16:05:20 -0500364
365@disabled
366class L2FloodTaggedUnknownSrc(base_tests.SimpleDataPlane):
367 """
368 Test L2 flood to a vlan
369 Send a packet with unknown dst_mac and check if the packet is flooded to all ports except inport
370 #todo take in account unknown src
371 """
372 def runTest(self):
373 delete_all_flows(self.controller)
374 delete_all_groups(self.controller)
375
376 ports = sorted(config["port_map"].keys())
377 for port in ports:
378 add_one_l2_interface_group(self.controller, port, 1, True, False)
379 add_one_vlan_table_flow(self.controller, port, 1, flag=VLAN_TABLE_FLAG_ONLY_TAG)
380
381 msg=add_l2_flood_group(self.controller, ports, 1, 1)
382 add_bridge_flow(self.controller, None, 1, msg.group_id, True)
383
384 parsed_pkt = simple_tcp_packet(dl_vlan_enable=True, vlan_vid=1, eth_dst='00:12:34:56:78:9a')
385 pkt = str(parsed_pkt)
386 #verify flood
387 for ofport in ports:
388 self.dataplane.send(ofport, pkt)
389 #self won't rx packet
390 verify_no_packet(self, pkt, ofport)
391 #others will rx packet
392 tmp_ports=list(ports)
393 tmp_ports.remove(ofport)
394 verify_packets(self, pkt, tmp_ports)
395
396 verify_no_other_packets(self)
397
398@disabled
399class PacketInIPTable(base_tests.SimpleDataPlane):
400 """
401 Test packet in function on IPTABLE
402 Send a packet to each dataplane port and verify that a packet
403 in message is received from the controller for each
404 #todo verify you stop receiving after adding rule
405 """
406
407 def runTest(self):
408 delete_all_flows(self.controller)
409 delete_all_groups(self.controller)
410
411 intf_src_mac=[0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc]
412 dst_mac=[0x00, 0x00, 0x00, 0x22, 0x22, 0x00]
413 dip=0xc0a80001
414 ports = sorted(config["port_map"].keys())
415 for port in ports:
416 #add l2 interface group
417 vlan_id=port
418 add_one_l2_interface_group(self.controller, port, vlan_id=vlan_id, is_tagged=True, send_barrier=False)
419 dst_mac[5]=vlan_id
420 l3_msg=add_l3_unicast_group(self.controller, port, vlanid=vlan_id, id=vlan_id, src_mac=intf_src_mac, dst_mac=dst_mac)
421 #add vlan flow table
422 add_one_vlan_table_flow(self.controller, port, vlan_id, flag=VLAN_TABLE_FLAG_ONLY_TAG)
423 #add termination flow
424 add_termination_flow(self.controller, port, 0x0800, intf_src_mac, vlan_id)
425 #add unicast routing flow
426 dst_ip = dip + (vlan_id<<8)
427 add_unicast_routing_flow(self.controller, 0x0800, dst_ip, 0xfffffff0, l3_msg.group_id, send_ctrl=True)
428
429 do_barrier(self.controller)
430
431 switch_mac = ':'.join(['%02X' % x for x in intf_src_mac])
432 for in_port in ports:
433 mac_src='00:00:00:22:22:%02X' % in_port
434 ip_src='192.168.%02d.1' % in_port
435 for out_port in ports:
436 if in_port == out_port:
437 continue
438 ip_dst='192.168.%02d.1' % out_port
439 parsed_pkt = simple_tcp_packet(pktlen=100, dl_vlan_enable=True, vlan_vid=in_port,
440 eth_dst=switch_mac, eth_src=mac_src, ip_ttl=64, ip_src=ip_src,
441 ip_dst=ip_dst)
442 pkt=str(parsed_pkt)
443 self.dataplane.send(in_port, pkt)
444 verify_packet_in(self, pkt, in_port, ofp.OFPR_ACTION)
445 #verify_no_other_packets(self)
446
447@disabled
448class PacketInSrcMacMiss(base_tests.SimpleDataPlane):
449 """
450 Test packet in function on a src-mac miss
451 Send a packet to each dataplane port and verify that a packet
452 in message is received from the controller for each
453 #todo verify you stop receiving after adding rule
454 """
455
456 def runTest(self):
457 delete_all_flows(self.controller)
458 delete_all_groups(self.controller)
459
460 ports = sorted(config["port_map"].keys())
461 for port in ports:
462 add_one_l2_interface_group(self.controller, port, 1, True, False)
463 add_one_vlan_table_flow(self.controller, port, 1, flag=VLAN_TABLE_FLAG_ONLY_TAG)
464
465 parsed_vlan_pkt = simple_tcp_packet(pktlen=104,
466 vlan_vid=0x1001, dl_vlan_enable=True)
467 vlan_pkt = str(parsed_vlan_pkt)
468
469 for of_port in config["port_map"].keys():
470 logging.info("PacketInMiss test, port %d", of_port)
471 self.dataplane.send(of_port, vlan_pkt)
472
473 verify_packet_in(self, vlan_pkt, of_port, ofp.OFPR_NO_MATCH)
474
Flavio Castro1c9b1252016-02-04 18:42:58 -0500475 verify_no_other_packets(self)