blob: 535eea10477e7519c393dbe17cfac9ab83eac784 [file] [log] [blame]
Dan Talayco5eba8442010-03-10 13:58:43 -08001"""
2Test cases for testing actions taken on packets
3
4See basic.py for other info.
5
6It is recommended that these definitions be kept in their own
7namespace as different groups of tests will likely define
8similar identifiers.
9
10 The function test_set_init is called with a complete configuration
11dictionary prior to the invocation of any tests from this file.
12
13 The switch is actively attempting to contact the controller at the address
14indicated oin oft_config
15
16"""
17
Dan Talayco9f47f4d2010-06-03 13:54:37 -070018import copy
19
Dan Talayco5eba8442010-03-10 13:58:43 -080020import logging
21
22import unittest
23
24import oftest.controller as controller
25import oftest.cstruct as ofp
26import oftest.message as message
27import oftest.dataplane as dataplane
28import oftest.action as action
29import oftest.parse as parse
30import basic
31
32from testutils import *
33
34#@var port_map Local copy of the configuration map from OF port
35# numbers to OS interfaces
36pa_port_map = None
37#@var pa_logger Local logger object
38pa_logger = None
39#@var pa_config Local copy of global configuration data
40pa_config = None
41
42def test_set_init(config):
43 """
44 Set up function for packet action test classes
45
46 @param config The configuration dictionary; see oft
47 """
48
49 global pa_port_map
50 global pa_logger
51 global pa_config
52
53 pa_logger = logging.getLogger("pkt_act")
54 pa_logger.info("Initializing test set")
55 pa_port_map = config["port_map"]
56 pa_config = config
57
58class DirectPacket(basic.SimpleDataPlane):
59 """
Dan Talayco2d0d49a2010-05-11 15:29:08 -070060 Send packet to single egress port
Dan Talayco5eba8442010-03-10 13:58:43 -080061
62 Generate a packet
63 Generate and install a matching flow
64 Add action to direct the packet to an egress port
65 Send the packet to ingress dataplane port
66 Verify the packet is received at the egress port only
67 """
68 def runTest(self):
69 global pa_port_map
70 of_ports = pa_port_map.keys()
71 of_ports.sort()
72 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
73
Dan Talayco5eba8442010-03-10 13:58:43 -080074 pkt = simple_tcp_packet()
75 match = parse.packet_to_flow_match(pkt)
Dan Talayco7dd6cd62010-03-16 15:02:35 -070076 match.wildcards &= ~ofp.OFPFW_IN_PORT
Dan Talayco5eba8442010-03-10 13:58:43 -080077 self.assertTrue(match is not None,
78 "Could not generate flow match from pkt")
79 act = action.action_output()
80
81 for idx in range(len(of_ports)):
Dan Talayco9f47f4d2010-06-03 13:54:37 -070082 rv = delete_all_flows(self.controller, pa_logger)
83 self.assertEqual(rv, 0, "Failed to delete all flows")
Dan Talayco2e77a842010-05-12 15:39:46 -070084
Dan Talayco5eba8442010-03-10 13:58:43 -080085 ingress_port = of_ports[idx]
86 egress_port = of_ports[(idx + 1) % len(of_ports)]
87 pa_logger.info("Ingress " + str(ingress_port) +
88 " to egress " + str(egress_port))
89
90 match.in_port = ingress_port
91
92 request = message.flow_mod()
93 request.match = match
94 request.buffer_id = 0xffffffff
95 act.port = egress_port
96 self.assertTrue(request.actions.add(act), "Could not add action")
97
98 pa_logger.info("Inserting flow")
99 rv = self.controller.message_send(request)
100 self.assertTrue(rv != -1, "Error installing flow mod")
101 do_barrier(self.controller)
102
103 pa_logger.info("Sending packet to dp port " +
104 str(ingress_port))
105 self.dataplane.send(ingress_port, str(pkt))
106 (rcv_port, rcv_pkt, pkt_time) = self.dataplane.poll(timeout=1)
107 self.assertTrue(rcv_pkt is not None, "Did not receive packet")
Dan Talayco2d0d49a2010-05-11 15:29:08 -0700108 pa_logger.debug("Packet len " + str(len(rcv_pkt)) + " in on " +
Dan Talayco5eba8442010-03-10 13:58:43 -0800109 str(rcv_port))
110 self.assertEqual(rcv_port, egress_port, "Unexpected receive port")
111 self.assertEqual(str(pkt), str(rcv_pkt),
112 'Response packet does not match send packet')
113
114
Dan Talayco2d0d49a2010-05-11 15:29:08 -0700115
116class DirectTwoPorts(basic.SimpleDataPlane):
117 """
118 Send packet to two egress ports
119
120 Generate a packet
121 Generate and install a matching flow
122 Add action to direct the packet to two egress ports
123 Send the packet to ingress dataplane port
124 Verify the packet is received at the two egress ports
125 """
126 def runTest(self):
127 global pa_port_map
128 of_ports = pa_port_map.keys()
129 of_ports.sort()
130 self.assertTrue(len(of_ports) > 2, "Not enough ports for test")
131
Dan Talayco2d0d49a2010-05-11 15:29:08 -0700132 pkt = simple_tcp_packet()
133 match = parse.packet_to_flow_match(pkt)
134 match.wildcards &= ~ofp.OFPFW_IN_PORT
135 self.assertTrue(match is not None,
136 "Could not generate flow match from pkt")
137 act = action.action_output()
138
139 for idx in range(len(of_ports)):
Dan Talayco9f47f4d2010-06-03 13:54:37 -0700140 rv = delete_all_flows(self.controller, pa_logger)
141 self.assertEqual(rv, 0, "Failed to delete all flows")
Dan Talayco2e77a842010-05-12 15:39:46 -0700142
Dan Talayco2d0d49a2010-05-11 15:29:08 -0700143 ingress_port = of_ports[idx]
144 egress_port1 = of_ports[(idx + 1) % len(of_ports)]
145 egress_port2 = of_ports[(idx + 2) % len(of_ports)]
146 pa_logger.info("Ingress " + str(ingress_port) +
147 " to egress " + str(egress_port1) + " and " +
148 str(egress_port2))
149
150 match.in_port = ingress_port
151
152 request = message.flow_mod()
153 request.match = match
154 request.buffer_id = 0xffffffff
155 act.port = egress_port1
156 self.assertTrue(request.actions.add(act), "Could not add action1")
157 act.port = egress_port2
158 self.assertTrue(request.actions.add(act), "Could not add action2")
Dan Talaycob0b0fdb2010-05-11 15:44:56 -0700159 # pa_logger.info(request.show())
Dan Talayco2d0d49a2010-05-11 15:29:08 -0700160
161 pa_logger.info("Inserting flow")
162 rv = self.controller.message_send(request)
163 self.assertTrue(rv != -1, "Error installing flow mod")
164 do_barrier(self.controller)
165
166 pa_logger.info("Sending packet to dp port " +
167 str(ingress_port))
168 self.dataplane.send(ingress_port, str(pkt))
Dan Talayco9f47f4d2010-06-03 13:54:37 -0700169 yes_ports = set([egress_port1, egress_port2])
170 no_ports = set(of_ports).difference(yes_ports)
Dan Talayco2d0d49a2010-05-11 15:29:08 -0700171
Dan Talayco9f47f4d2010-06-03 13:54:37 -0700172 receive_pkt_check(self.dataplane, pkt, yes_ports, no_ports,
173 self, pa_logger)
Dan Talaycob0b0fdb2010-05-11 15:44:56 -0700174
175class DirectMCNonIngress(basic.SimpleDataPlane):
176 """
177 Multicast to all non-ingress ports
178
179 Generate a packet
180 Generate and install a matching flow
181 Add action to direct the packet to all non-ingress ports
182 Send the packet to ingress dataplane port
183 Verify the packet is received at all non-ingress ports
184
185 Does not use the flood action
186 """
187 def runTest(self):
188 global pa_port_map
189 of_ports = pa_port_map.keys()
190 of_ports.sort()
191 self.assertTrue(len(of_ports) > 2, "Not enough ports for test")
192
Dan Talaycob0b0fdb2010-05-11 15:44:56 -0700193 pkt = simple_tcp_packet()
194 match = parse.packet_to_flow_match(pkt)
195 match.wildcards &= ~ofp.OFPFW_IN_PORT
196 self.assertTrue(match is not None,
197 "Could not generate flow match from pkt")
198 act = action.action_output()
199
Dan Talayco9f47f4d2010-06-03 13:54:37 -0700200 for ingress_port in of_ports:
201 rv = delete_all_flows(self.controller, pa_logger)
202 self.assertEqual(rv, 0, "Failed to delete all flows")
Dan Talayco2e77a842010-05-12 15:39:46 -0700203
Dan Talaycob0b0fdb2010-05-11 15:44:56 -0700204 pa_logger.info("Ingress " + str(ingress_port) +
205 " all non-ingress ports")
Dan Talaycob0b0fdb2010-05-11 15:44:56 -0700206 match.in_port = ingress_port
207
208 request = message.flow_mod()
209 request.match = match
210 request.buffer_id = 0xffffffff
Dan Talayco9f47f4d2010-06-03 13:54:37 -0700211 for egress_port in of_ports:
212 if egress_port == ingress_port:
Dan Talaycob0b0fdb2010-05-11 15:44:56 -0700213 continue
Dan Talaycob0b0fdb2010-05-11 15:44:56 -0700214 act.port = egress_port
215 self.assertTrue(request.actions.add(act),
216 "Could not add output to " + str(egress_port))
Dan Talayco9f47f4d2010-06-03 13:54:37 -0700217 pa_logger.debug(request.show())
Dan Talaycob0b0fdb2010-05-11 15:44:56 -0700218
219 pa_logger.info("Inserting flow")
220 rv = self.controller.message_send(request)
221 self.assertTrue(rv != -1, "Error installing flow mod")
222 do_barrier(self.controller)
223
Dan Talayco9f47f4d2010-06-03 13:54:37 -0700224 pa_logger.info("Sending packet to dp port " + str(ingress_port))
Dan Talaycob0b0fdb2010-05-11 15:44:56 -0700225 self.dataplane.send(ingress_port, str(pkt))
Dan Talayco9f47f4d2010-06-03 13:54:37 -0700226 yes_ports = set(of_ports).difference([ingress_port])
227 receive_pkt_check(self.dataplane, pkt, yes_ports, [ingress_port],
228 self, pa_logger)
Dan Talaycob0b0fdb2010-05-11 15:44:56 -0700229
Dan Talayco32fa6542010-05-11 15:54:08 -0700230
231class DirectMC(basic.SimpleDataPlane):
232 """
233 Multicast to all ports including ingress
234
235 Generate a packet
236 Generate and install a matching flow
237 Add action to direct the packet to all non-ingress ports
238 Send the packet to ingress dataplane port
239 Verify the packet is received at all ports
240
241 Does not use the flood action
242 """
243 def runTest(self):
244 global pa_port_map
245 of_ports = pa_port_map.keys()
246 of_ports.sort()
247 self.assertTrue(len(of_ports) > 2, "Not enough ports for test")
248
Dan Talayco32fa6542010-05-11 15:54:08 -0700249 pkt = simple_tcp_packet()
250 match = parse.packet_to_flow_match(pkt)
251 match.wildcards &= ~ofp.OFPFW_IN_PORT
252 self.assertTrue(match is not None,
253 "Could not generate flow match from pkt")
254 act = action.action_output()
255
Dan Talayco9f47f4d2010-06-03 13:54:37 -0700256 for ingress_port in of_ports:
257 rv = delete_all_flows(self.controller, pa_logger)
258 self.assertEqual(rv, 0, "Failed to delete all flows")
Dan Talayco2e77a842010-05-12 15:39:46 -0700259
Dan Talayco32fa6542010-05-11 15:54:08 -0700260 pa_logger.info("Ingress " + str(ingress_port) + " to all ports")
Dan Talayco32fa6542010-05-11 15:54:08 -0700261 match.in_port = ingress_port
262
263 request = message.flow_mod()
264 request.match = match
265 request.buffer_id = 0xffffffff
Dan Talayco9f47f4d2010-06-03 13:54:37 -0700266 for egress_port in of_ports:
267 if egress_port == ingress_port:
Dan Talayco32fa6542010-05-11 15:54:08 -0700268 act.port = ofp.OFPP_IN_PORT
269 else:
270 act.port = egress_port
271 self.assertTrue(request.actions.add(act),
272 "Could not add output to " + str(egress_port))
Dan Talayco2e77a842010-05-12 15:39:46 -0700273 # pa_logger.info(request.show())
274
275 pa_logger.info("Inserting flow")
276 rv = self.controller.message_send(request)
277 self.assertTrue(rv != -1, "Error installing flow mod")
278 do_barrier(self.controller)
279
280 pa_logger.info("Sending packet to dp port " + str(ingress_port))
281 self.dataplane.send(ingress_port, str(pkt))
Dan Talayco9f47f4d2010-06-03 13:54:37 -0700282 receive_pkt_check(self.dataplane, pkt, of_ports, [], self,
283 pa_logger)
Dan Talayco2e77a842010-05-12 15:39:46 -0700284
285class Flood(basic.SimpleDataPlane):
286 """
287 Flood to all ports except ingress
288
289 Generate a packet
290 Generate and install a matching flow
291 Add action to flood the packet
292 Send the packet to ingress dataplane port
293 Verify the packet is received at all other ports
294 """
295 def runTest(self):
296 global pa_port_map
297 of_ports = pa_port_map.keys()
298 of_ports.sort()
299 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
300
301 pkt = simple_tcp_packet()
302 match = parse.packet_to_flow_match(pkt)
303 match.wildcards &= ~ofp.OFPFW_IN_PORT
304 self.assertTrue(match is not None,
305 "Could not generate flow match from pkt")
306 act = action.action_output()
307
Dan Talayco9f47f4d2010-06-03 13:54:37 -0700308 for ingress_port in of_ports:
309 rv = delete_all_flows(self.controller, pa_logger)
310 self.assertEqual(rv, 0, "Failed to delete all flows")
Dan Talayco2e77a842010-05-12 15:39:46 -0700311
Dan Talayco2e77a842010-05-12 15:39:46 -0700312 pa_logger.info("Ingress " + str(ingress_port) + " to all ports")
Dan Talayco2e77a842010-05-12 15:39:46 -0700313 match.in_port = ingress_port
314
315 request = message.flow_mod()
316 request.match = match
317 request.buffer_id = 0xffffffff
318 act.port = ofp.OFPP_FLOOD
319 self.assertTrue(request.actions.add(act),
Dan Talayco4aa13122010-05-12 15:54:44 -0700320 "Could not add flood port action")
Dan Talayco32fa6542010-05-11 15:54:08 -0700321 pa_logger.info(request.show())
322
323 pa_logger.info("Inserting flow")
324 rv = self.controller.message_send(request)
325 self.assertTrue(rv != -1, "Error installing flow mod")
326 do_barrier(self.controller)
327
328 pa_logger.info("Sending packet to dp port " + str(ingress_port))
329 self.dataplane.send(ingress_port, str(pkt))
Dan Talayco9f47f4d2010-06-03 13:54:37 -0700330 yes_ports = set(of_ports).difference([ingress_port])
331 receive_pkt_check(self.dataplane, pkt, yes_ports, [ingress_port],
332 self, pa_logger)
Dan Talayco3be5b062010-05-12 15:46:21 -0700333
334
335class FloodPlusIngress(basic.SimpleDataPlane):
336 """
337 Flood to all ports plus send to ingress port
338
339 Generate a packet
340 Generate and install a matching flow
341 Add action to flood the packet
342 Add action to send to ingress port
343 Send the packet to ingress dataplane port
344 Verify the packet is received at all other ports
345 """
346 def runTest(self):
347 global pa_port_map
348 of_ports = pa_port_map.keys()
349 of_ports.sort()
350 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
351
352 pkt = simple_tcp_packet()
353 match = parse.packet_to_flow_match(pkt)
354 match.wildcards &= ~ofp.OFPFW_IN_PORT
355 self.assertTrue(match is not None,
356 "Could not generate flow match from pkt")
357 act = action.action_output()
358
Dan Talayco9f47f4d2010-06-03 13:54:37 -0700359 for ingress_port in of_ports:
360 rv = delete_all_flows(self.controller, pa_logger)
361 self.assertEqual(rv, 0, "Failed to delete all flows")
Dan Talayco3be5b062010-05-12 15:46:21 -0700362
Dan Talayco3be5b062010-05-12 15:46:21 -0700363 pa_logger.info("Ingress " + str(ingress_port) + " to all ports")
Dan Talayco3be5b062010-05-12 15:46:21 -0700364 match.in_port = ingress_port
365
366 request = message.flow_mod()
367 request.match = match
368 request.buffer_id = 0xffffffff
369 act.port = ofp.OFPP_FLOOD
370 self.assertTrue(request.actions.add(act),
Dan Talayco4aa13122010-05-12 15:54:44 -0700371 "Could not add flood port action")
372 act.port = ofp.OFPP_IN_PORT
373 self.assertTrue(request.actions.add(act),
374 "Could not add ingress port for output")
375 pa_logger.info(request.show())
376
377 pa_logger.info("Inserting flow")
378 rv = self.controller.message_send(request)
379 self.assertTrue(rv != -1, "Error installing flow mod")
380 do_barrier(self.controller)
381
382 pa_logger.info("Sending packet to dp port " + str(ingress_port))
383 self.dataplane.send(ingress_port, str(pkt))
Dan Talayco9f47f4d2010-06-03 13:54:37 -0700384 receive_pkt_check(self.dataplane, pkt, of_ports, [], self,
385 pa_logger)
Dan Talayco4aa13122010-05-12 15:54:44 -0700386
387class All(basic.SimpleDataPlane):
388 """
389 Send to OFPP_ALL port
390
391 Generate a packet
392 Generate and install a matching flow
393 Add action to forward to OFPP_ALL
394 Send the packet to ingress dataplane port
395 Verify the packet is received at all other ports
396 """
397 def runTest(self):
398 global pa_port_map
399 of_ports = pa_port_map.keys()
400 of_ports.sort()
401 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
402
403 pkt = simple_tcp_packet()
404 match = parse.packet_to_flow_match(pkt)
405 match.wildcards &= ~ofp.OFPFW_IN_PORT
406 self.assertTrue(match is not None,
407 "Could not generate flow match from pkt")
408 act = action.action_output()
409
Dan Talayco9f47f4d2010-06-03 13:54:37 -0700410 for ingress_port in of_ports:
411 rv = delete_all_flows(self.controller, pa_logger)
412 self.assertEqual(rv, 0, "Failed to delete all flows")
Dan Talayco4aa13122010-05-12 15:54:44 -0700413
Dan Talayco4aa13122010-05-12 15:54:44 -0700414 pa_logger.info("Ingress " + str(ingress_port) + " to all ports")
Dan Talayco4aa13122010-05-12 15:54:44 -0700415 match.in_port = ingress_port
416
417 request = message.flow_mod()
418 request.match = match
419 request.buffer_id = 0xffffffff
420 act.port = ofp.OFPP_ALL
421 self.assertTrue(request.actions.add(act),
422 "Could not add ALL port action")
423 pa_logger.info(request.show())
424
425 pa_logger.info("Inserting flow")
426 rv = self.controller.message_send(request)
427 self.assertTrue(rv != -1, "Error installing flow mod")
428 do_barrier(self.controller)
429
430 pa_logger.info("Sending packet to dp port " + str(ingress_port))
431 self.dataplane.send(ingress_port, str(pkt))
Dan Talayco9f47f4d2010-06-03 13:54:37 -0700432 yes_ports = set(of_ports).difference([ingress_port])
433 receive_pkt_check(self.dataplane, pkt, yes_ports, [ingress_port],
434 self, pa_logger)
Dan Talayco4aa13122010-05-12 15:54:44 -0700435
436class AllPlusIngress(basic.SimpleDataPlane):
437 """
438 Send to OFPP_ALL port and ingress port
439
440 Generate a packet
441 Generate and install a matching flow
442 Add action to forward to OFPP_ALL
443 Add action to forward to ingress port
444 Send the packet to ingress dataplane port
445 Verify the packet is received at all other ports
446 """
447 def runTest(self):
448 global pa_port_map
449 of_ports = pa_port_map.keys()
450 of_ports.sort()
451 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
452
453 pkt = simple_tcp_packet()
454 match = parse.packet_to_flow_match(pkt)
455 match.wildcards &= ~ofp.OFPFW_IN_PORT
456 self.assertTrue(match is not None,
457 "Could not generate flow match from pkt")
458 act = action.action_output()
459
Dan Talayco9f47f4d2010-06-03 13:54:37 -0700460 for ingress_port in of_ports:
461 rv = delete_all_flows(self.controller, pa_logger)
462 self.assertEqual(rv, 0, "Failed to delete all flows")
Dan Talayco4aa13122010-05-12 15:54:44 -0700463
Dan Talayco4aa13122010-05-12 15:54:44 -0700464 pa_logger.info("Ingress " + str(ingress_port) + " to all ports")
Dan Talayco4aa13122010-05-12 15:54:44 -0700465 match.in_port = ingress_port
466
467 request = message.flow_mod()
468 request.match = match
469 request.buffer_id = 0xffffffff
470 act.port = ofp.OFPP_ALL
471 self.assertTrue(request.actions.add(act),
472 "Could not add ALL port action")
Dan Talayco3be5b062010-05-12 15:46:21 -0700473 act.port = ofp.OFPP_IN_PORT
474 self.assertTrue(request.actions.add(act),
475 "Could not add ingress port for output")
476 pa_logger.info(request.show())
477
478 pa_logger.info("Inserting flow")
479 rv = self.controller.message_send(request)
480 self.assertTrue(rv != -1, "Error installing flow mod")
481 do_barrier(self.controller)
482
483 pa_logger.info("Sending packet to dp port " + str(ingress_port))
484 self.dataplane.send(ingress_port, str(pkt))
Dan Talayco9f47f4d2010-06-03 13:54:37 -0700485 receive_pkt_check(self.dataplane, pkt, of_ports, [], self,
486 pa_logger)
487
Dan Talayco3be5b062010-05-12 15:46:21 -0700488
Dan Talayco9f47f4d2010-06-03 13:54:37 -0700489class FloodMinusPort(basic.SimpleDataPlane):
490 """
491 Config port with No_Flood and test Flood action
492
493 Generate a packet
494 Generate a matching flow
495 Add action to forward to OFPP_ALL
496 Set port to no-flood
497 Send the packet to ingress dataplane port
498 Verify the packet is received at all other ports except
499 the ingress port and the no_flood port
500 """
501 def runTest(self):
502 global pa_port_map
503 of_ports = pa_port_map.keys()
504 of_ports.sort()
505 self.assertTrue(len(of_ports) > 2, "Not enough ports for test")
506
507 pkt = simple_tcp_packet()
508 match = parse.packet_to_flow_match(pkt)
509 match.wildcards &= ~ofp.OFPFW_IN_PORT
510 self.assertTrue(match is not None,
511 "Could not generate flow match from pkt")
512 act = action.action_output()
513
514 for idx in range(len(of_ports)):
515 rv = delete_all_flows(self.controller, pa_logger)
516 self.assertEqual(rv, 0, "Failed to delete all flows")
517
518 ingress_port = of_ports[idx]
519 no_flood_idx = (idx + 1) % len(of_ports)
520 no_flood_port = of_ports[no_flood_idx]
521 rv = port_config_set(self.controller, no_flood_port,
522 ofp.OFPPC_NO_FLOOD, ofp.OFPPC_NO_FLOOD,
523 pa_logger)
524 self.assertEqual(rv, 0, "Failed to set port config")
525
526 match.in_port = ingress_port
527
528 request = message.flow_mod()
529 request.match = match
530 request.buffer_id = 0xffffffff
531 act.port = ofp.OFPP_FLOOD
532 self.assertTrue(request.actions.add(act),
533 "Could not add flood port action")
534 pa_logger.info(request.show())
535
536 pa_logger.info("Inserting flow")
537 rv = self.controller.message_send(request)
538 self.assertTrue(rv != -1, "Error installing flow mod")
539 do_barrier(self.controller)
540
541 pa_logger.info("Sending packet to dp port " + str(ingress_port))
542 pa_logger.info("No flood port is " + str(no_flood_port))
543 self.dataplane.send(ingress_port, str(pkt))
544 no_ports = set([ingress_port, no_flood_port])
545 yes_ports = set(of_ports).difference(no_ports)
546 receive_pkt_check(self.dataplane, pkt, yes_ports, no_ports, self,
547 pa_logger)
548
549 # Turn no flood off again
550 rv = port_config_set(self.controller, no_flood_port,
551 0, ofp.OFPPC_NO_FLOOD, pa_logger)
552 self.assertEqual(rv, 0, "Failed to reset port config")
553
554 #@todo Should check no other packets received
555
556if __name__ == "__main__":
557 print "Please run through oft script: ./oft --test_spec=basic"