ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 1 | |
| 2 | """These tests fall under Conformance Test-Suite (OF-SWITCH-1.0.0 TestCases). |
| 3 | Refer Documentation -- Detailed testing methodology |
| 4 | <Some of test-cases are directly taken from oftest> """ |
| 5 | |
| 6 | "Test Suite 6 ---> Actions " |
| 7 | |
| 8 | |
| 9 | import logging |
| 10 | |
| 11 | import unittest |
| 12 | import random |
Rich Lane | b90a1c4 | 2012-10-05 09:16:05 -0700 | [diff] [blame] | 13 | import time |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 14 | |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 15 | from oftest import config |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 16 | import oftest.controller as controller |
Rich Lane | d7b0ffa | 2013-03-08 15:53:42 -0800 | [diff] [blame] | 17 | import ofp |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 18 | import oftest.dataplane as dataplane |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 19 | import oftest.parse as parse |
Rich Lane | b90a1c4 | 2012-10-05 09:16:05 -0700 | [diff] [blame] | 20 | import oftest.base_tests as base_tests |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 21 | |
Rich Lane | da3b5ad | 2012-10-03 09:05:32 -0700 | [diff] [blame] | 22 | from oftest.testutils import * |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 23 | from time import sleep |
| 24 | from FuncUtils import * |
| 25 | |
Rich Lane | b90a1c4 | 2012-10-05 09:16:05 -0700 | [diff] [blame] | 26 | class NoAction(base_tests.SimpleDataPlane): |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 27 | |
| 28 | """NoActionDrop : no action added to flow , drops the packet.""" |
| 29 | |
| 30 | def runTest(self): |
| 31 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 32 | logging.info("Running No_Action test") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 33 | |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 34 | of_ports = config["port_map"].keys() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 35 | of_ports.sort() |
| 36 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 37 | |
| 38 | #Clear switch state |
Rich Lane | 32bf948 | 2013-01-03 17:26:30 -0800 | [diff] [blame] | 39 | delete_all_flows(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 40 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 41 | logging.info("Install a flow without action") |
| 42 | logging.info("Send packets matching that flow") |
| 43 | logging.info("Expecting switch to drop all packets") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 44 | |
| 45 | # Insert a flow wildcard all without any action |
| 46 | pkt = simple_tcp_packet() |
| 47 | match = parse.packet_to_flow_match(pkt) |
| 48 | self.assertTrue(match is not None, "Could not generate flow match from pkt") |
| 49 | match.wildcards=ofp.OFPFW_ALL |
| 50 | match.in_port = of_ports[0] |
| 51 | |
Rich Lane | ba3f0e2 | 2013-03-11 16:43:57 -0700 | [diff] [blame] | 52 | msg = ofp.message.flow_add() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 53 | msg.out_port = ofp.OFPP_NONE |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 54 | msg.buffer_id = 0xffffffff |
| 55 | msg.match = match |
Rich Lane | 5c3151c | 2013-01-03 17:15:41 -0800 | [diff] [blame] | 56 | self.controller.message_send(msg) |
Rich Lane | 3a261d5 | 2013-01-03 17:45:08 -0800 | [diff] [blame] | 57 | do_barrier(self.controller) |
ShreyaPandita | b46f852 | 2012-09-28 15:12:15 -0400 | [diff] [blame] | 58 | |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 59 | #Sending N packets matching the flow inserted |
| 60 | for pkt_cnt in range(5): |
| 61 | self.dataplane.send(of_ports[0],str(pkt)) |
| 62 | |
| 63 | #Verify packets not recieved on any of the dataplane ports |
ShreyaPandita | 7b9ec98 | 2012-09-28 14:43:08 -0400 | [diff] [blame] | 64 | (rcv_port, rcv_pkt, pkt_time) = self.dataplane.poll(timeout=1,exp_pkt=pkt) |
| 65 | self.assertTrue(rcv_pkt is None, |
ShreyaPandita | d4a42c6 | 2012-09-28 15:35:27 -0400 | [diff] [blame] | 66 | "Packet received on port " + str(rcv_port)) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 67 | |
| 68 | #Verify packets not sent on control plane either |
Rich Lane | 4c504f3 | 2013-06-07 17:24:14 -0700 | [diff] [blame] | 69 | verify_no_packet_in(self, str(pkt), of_ports[0]) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 70 | |
| 71 | |
Rich Lane | b90a1c4 | 2012-10-05 09:16:05 -0700 | [diff] [blame] | 72 | class Announcement(base_tests.SimpleDataPlane): |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 73 | |
| 74 | """Announcement : Get all supported actions by the switch. |
| 75 | Send OFPT_FEATURES_REQUEST to get features supported by sw.""" |
| 76 | |
| 77 | def runTest(self): |
| 78 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 79 | logging.info("Running Announcement test") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 80 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 81 | logging.info("Sending Features_Request") |
| 82 | logging.info("Expecting Features Reply with supported actions") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 83 | |
| 84 | # Sending Features_Request |
Rich Lane | 28fa927 | 2013-03-08 16:00:25 -0800 | [diff] [blame] | 85 | request = ofp.message.features_request() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 86 | (reply, pkt) = self.controller.transact(request) |
| 87 | self.assertTrue(reply is not None, "Failed to get any reply") |
Rich Lane | b73808c | 2013-03-11 15:22:23 -0700 | [diff] [blame] | 88 | self.assertEqual(reply.type, ofp.OFPT_FEATURES_REPLY,'Response is not Features_reply') |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 89 | |
| 90 | supported_actions =[] |
| 91 | if(reply.actions &1<<ofp.OFPAT_OUTPUT): |
| 92 | supported_actions.append('OFPAT_OUTPUT') |
| 93 | if(reply.actions &1<<ofp.OFPAT_SET_VLAN_VID): |
| 94 | supported_actions.append('OFPAT_SET_VLAN_VID') |
| 95 | if(reply.actions &1<<ofp.OFPAT_SET_VLAN_PCP): |
| 96 | supported_actions.append('OFPAT_SET_VLAN_PCP') |
| 97 | if(reply.actions &1<<ofp.OFPAT_STRIP_VLAN): |
| 98 | supported_actions.append('OFPAT_STRIP_VLAN') |
| 99 | if(reply.actions &1<<ofp.OFPAT_SET_DL_SRC): |
| 100 | supported_actions.append('OFPAT_SET_DL_SRC') |
| 101 | if(reply.actions &1<<ofp.OFPAT_SET_DL_DST): |
| 102 | supported_actions.append('OFPAT_SET_NW_SRC') |
| 103 | if(reply.actions &1<<ofp.OFPAT_SET_NW_DST): |
| 104 | supported_actions.append('OFPAT_SET_NW_DST') |
| 105 | if(reply.actions &1<<ofp.OFPAT_SET_NW_TOS): |
| 106 | supported_actions.append('OFPAT_SET_NW_TOS') |
| 107 | if(reply.actions &1<<ofp.OFPAT_SET_TP_SRC): |
| 108 | supported_actions.append('OFPAT_SET_TP_SRC') |
| 109 | if(reply.actions &1<<ofp.OFPAT_SET_TP_DST): |
| 110 | supported_actions.append('OFPAT_SET_TP_DST') |
| 111 | if(reply.actions &1<<ofp.OFPAT_VENDOR): |
| 112 | supported_actions.append('OFPAT_VENDOR') |
| 113 | if(reply.actions &1<<ofp.OFPAT_ENQUEUE): |
| 114 | supported_actions.append('OFPAT_ENQUEUE') |
| 115 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 116 | logging.info(supported_actions) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 117 | |
| 118 | |
Rich Lane | b90a1c4 | 2012-10-05 09:16:05 -0700 | [diff] [blame] | 119 | class ForwardAll(base_tests.SimpleDataPlane): |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 120 | |
| 121 | """ForwardAll : Packet is sent to all dataplane ports |
| 122 | except ingress port when output action.port = OFPP_ALL""" |
| 123 | |
| 124 | def runTest(self): |
| 125 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 126 | logging.info("Running Forward_All test") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 127 | |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 128 | of_ports = config["port_map"].keys() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 129 | of_ports.sort() |
| 130 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 131 | |
| 132 | #Clear switch state |
Rich Lane | 32bf948 | 2013-01-03 17:26:30 -0800 | [diff] [blame] | 133 | delete_all_flows(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 134 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 135 | logging.info("Insert a flow with output action port OFPP_ALL") |
| 136 | logging.info("Send packet matching the flow") |
| 137 | logging.info("Expecting packet on all dataplane ports except ingress_port") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 138 | |
| 139 | #Create a packet |
| 140 | pkt = simple_tcp_packet() |
| 141 | match = parse.packet_to_flow_match(pkt) |
Rich Lane | 9d3cc6b | 2013-03-08 16:33:08 -0800 | [diff] [blame] | 142 | act = ofp.action.output() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 143 | |
| 144 | #Delete all flows |
Rich Lane | 32bf948 | 2013-01-03 17:26:30 -0800 | [diff] [blame] | 145 | delete_all_flows(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 146 | ingress_port=of_ports[0] |
| 147 | match.in_port = ingress_port |
| 148 | |
| 149 | #Create a flow mod with action.port = OFPP_ALL |
Rich Lane | ba3f0e2 | 2013-03-11 16:43:57 -0700 | [diff] [blame] | 150 | request = ofp.message.flow_add() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 151 | request.match = match |
| 152 | request.match.wildcards = ofp.OFPFW_ALL&~ofp.OFPFW_IN_PORT |
| 153 | act.port = ofp.OFPP_ALL |
Rich Lane | c495d9e | 2013-03-08 17:43:36 -0800 | [diff] [blame] | 154 | request.actions.append(act) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 155 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 156 | logging.info("Inserting flow") |
Rich Lane | 5c3151c | 2013-01-03 17:15:41 -0800 | [diff] [blame] | 157 | self.controller.message_send(request) |
Rich Lane | 3a261d5 | 2013-01-03 17:45:08 -0800 | [diff] [blame] | 158 | do_barrier(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 159 | |
| 160 | #Send Packet matching the flow |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 161 | logging.info("Sending packet to dp port " + str(ingress_port)) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 162 | self.dataplane.send(ingress_port, str(pkt)) |
| 163 | |
| 164 | #Verifying packets recieved on expected dataplane ports |
| 165 | yes_ports = set(of_ports).difference([ingress_port]) |
Rich Lane | e4b384d | 2013-09-13 14:33:40 -0700 | [diff] [blame^] | 166 | verify_packets(self, pkt, yes_ports) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 167 | |
| 168 | |
Rich Lane | b90a1c4 | 2012-10-05 09:16:05 -0700 | [diff] [blame] | 169 | class ForwardController(base_tests.SimpleDataPlane): |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 170 | |
| 171 | """ForwardController : Packet is sent to controller |
| 172 | output.port = OFPP_CONTROLLER""" |
| 173 | |
| 174 | def runTest(self): |
| 175 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 176 | logging.info("Running Forward_Controller test") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 177 | |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 178 | of_ports = config["port_map"].keys() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 179 | of_ports.sort() |
| 180 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 181 | |
| 182 | #Clear switch state |
Rich Lane | 32bf948 | 2013-01-03 17:26:30 -0800 | [diff] [blame] | 183 | delete_all_flows(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 184 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 185 | logging.info("Insert a flow with output action port OFPP_CONTROLLER") |
| 186 | logging.info("Send packet matching the flow") |
| 187 | logging.info("Expecting packet on the control plane") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 188 | |
| 189 | #Create packet |
| 190 | pkt = simple_tcp_packet() |
| 191 | match = parse.packet_to_flow_match(pkt) |
Rich Lane | 9d3cc6b | 2013-03-08 16:33:08 -0800 | [diff] [blame] | 192 | act = ofp.action.output() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 193 | |
| 194 | for ingress_port in of_ports: |
| 195 | #Delete all flows |
Rich Lane | 32bf948 | 2013-01-03 17:26:30 -0800 | [diff] [blame] | 196 | delete_all_flows(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 197 | |
| 198 | match.in_port = ingress_port |
| 199 | |
| 200 | #Create a flow mod message |
Rich Lane | ba3f0e2 | 2013-03-11 16:43:57 -0700 | [diff] [blame] | 201 | request = ofp.message.flow_add() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 202 | request.match = match |
| 203 | act.port = ofp.OFPP_CONTROLLER |
Rich Lane | c495d9e | 2013-03-08 17:43:36 -0800 | [diff] [blame] | 204 | request.actions.append(act) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 205 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 206 | logging.info("Inserting flow") |
Rich Lane | 5c3151c | 2013-01-03 17:15:41 -0800 | [diff] [blame] | 207 | self.controller.message_send(request) |
Rich Lane | 3a261d5 | 2013-01-03 17:45:08 -0800 | [diff] [blame] | 208 | do_barrier(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 209 | |
| 210 | #Send packet matching the flow |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 211 | logging.info("Sending packet to dp port " + str(ingress_port)) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 212 | self.dataplane.send(ingress_port, str(pkt)) |
| 213 | |
| 214 | #Verifying packet recieved on the control plane port |
Rich Lane | 4c504f3 | 2013-06-07 17:24:14 -0700 | [diff] [blame] | 215 | verify_packet_in(self, str(pkt), ingress_port, ofp.OFPR_ACTION) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 216 | |
| 217 | |
| 218 | |
Rich Lane | b90a1c4 | 2012-10-05 09:16:05 -0700 | [diff] [blame] | 219 | class ForwardLocal(base_tests.SimpleDataPlane): |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 220 | |
| 221 | """ForwardLocal : Packet is sent to OFPP_LOCAL port . |
| 222 | TBD : To verify packet recieved in the local networking stack of switch""" |
| 223 | |
| 224 | def runTest(self): |
| 225 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 226 | logging.info("Running Forward_Local test") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 227 | |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 228 | of_ports = config["port_map"].keys() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 229 | of_ports.sort() |
| 230 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 231 | |
| 232 | #Clear switch state |
Rich Lane | 32bf948 | 2013-01-03 17:26:30 -0800 | [diff] [blame] | 233 | delete_all_flows(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 234 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 235 | logging.info("Insert a flow with output action port OFPP_LOCAL") |
| 236 | logging.info("Send packet matching the flow") |
| 237 | logging.info("Expecting packet in the local networking stack of switch") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 238 | |
| 239 | #Clear switch state |
| 240 | pkt = simple_tcp_packet() |
| 241 | match = parse.packet_to_flow_match(pkt) |
Rich Lane | 9d3cc6b | 2013-03-08 16:33:08 -0800 | [diff] [blame] | 242 | act = ofp.action.output() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 243 | |
| 244 | for ingress_port in of_ports: |
| 245 | #Delete the flows |
Rich Lane | 32bf948 | 2013-01-03 17:26:30 -0800 | [diff] [blame] | 246 | delete_all_flows(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 247 | |
| 248 | match.in_port = ingress_port |
| 249 | #Create flow mod message |
Rich Lane | ba3f0e2 | 2013-03-11 16:43:57 -0700 | [diff] [blame] | 250 | request = ofp.message.flow_add() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 251 | request.match = match |
| 252 | act.port = ofp.OFPP_LOCAL |
Rich Lane | c495d9e | 2013-03-08 17:43:36 -0800 | [diff] [blame] | 253 | request.actions.append(act) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 254 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 255 | logging.info("Inserting flow") |
Rich Lane | 5c3151c | 2013-01-03 17:15:41 -0800 | [diff] [blame] | 256 | self.controller.message_send(request) |
Rich Lane | 3a261d5 | 2013-01-03 17:45:08 -0800 | [diff] [blame] | 257 | do_barrier(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 258 | |
| 259 | #Send packet matching the flow |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 260 | logging.info("Sending packet to dp port " + str(ingress_port)) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 261 | self.dataplane.send(ingress_port, str(pkt)) |
| 262 | |
| 263 | #TBD: Verification of packets being recieved. |
| 264 | |
| 265 | |
Rich Lane | b90a1c4 | 2012-10-05 09:16:05 -0700 | [diff] [blame] | 266 | class ForwardFlood(base_tests.SimpleDataPlane): |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 267 | |
| 268 | """Forward:Flood : Packet is sent to all dataplane ports |
| 269 | except ingress port when output action.port = OFPP_FLOOD |
| 270 | TBD : Verification---Incase of STP being implemented, flood the packet along the minimum spanning tree, |
| 271 | not including the incoming interface. """ |
| 272 | |
| 273 | def runTest(self): |
| 274 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 275 | logging.info("Running Forward_Flood test") |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 276 | of_ports = config["port_map"].keys() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 277 | of_ports.sort() |
| 278 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 279 | |
| 280 | #Clear switch state |
Rich Lane | 32bf948 | 2013-01-03 17:26:30 -0800 | [diff] [blame] | 281 | delete_all_flows(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 282 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 283 | logging.info("Insert a flow with output action port OFPP_FORWARD") |
| 284 | logging.info("Send packet matching the flow") |
| 285 | logging.info("Expecting packet on all the ports except the input port") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 286 | |
| 287 | #Create a packet |
| 288 | pkt = simple_tcp_packet() |
| 289 | match = parse.packet_to_flow_match(pkt) |
Rich Lane | 9d3cc6b | 2013-03-08 16:33:08 -0800 | [diff] [blame] | 290 | act = ofp.action.output() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 291 | |
| 292 | #Delete all flows |
Rich Lane | 32bf948 | 2013-01-03 17:26:30 -0800 | [diff] [blame] | 293 | delete_all_flows(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 294 | ingress_port=of_ports[0] |
| 295 | match.in_port = ingress_port |
| 296 | |
| 297 | #Create a flow mod with action.port = OFPP_ALL |
Rich Lane | ba3f0e2 | 2013-03-11 16:43:57 -0700 | [diff] [blame] | 298 | request = ofp.message.flow_add() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 299 | request.match = match |
| 300 | request.match.wildcards = ofp.OFPFW_ALL&~ofp.OFPFW_IN_PORT |
| 301 | act.port = ofp.OFPP_FLOOD |
Rich Lane | c495d9e | 2013-03-08 17:43:36 -0800 | [diff] [blame] | 302 | request.actions.append(act) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 303 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 304 | logging.info("Inserting flow") |
Rich Lane | 5c3151c | 2013-01-03 17:15:41 -0800 | [diff] [blame] | 305 | self.controller.message_send(request) |
Rich Lane | 3a261d5 | 2013-01-03 17:45:08 -0800 | [diff] [blame] | 306 | do_barrier(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 307 | |
| 308 | #Send Packet matching the flow |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 309 | logging.info("Sending packet to dp port " + str(ingress_port)) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 310 | self.dataplane.send(ingress_port, str(pkt)) |
| 311 | |
| 312 | #Verifying packets recieved on expected dataplane ports |
| 313 | yes_ports = set(of_ports).difference([ingress_port]) |
Rich Lane | e4b384d | 2013-09-13 14:33:40 -0700 | [diff] [blame^] | 314 | verify_packets(self, pkt, yes_ports) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 315 | |
Rich Lane | b90a1c4 | 2012-10-05 09:16:05 -0700 | [diff] [blame] | 316 | class ForwardInport(base_tests.SimpleDataPlane): |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 317 | |
| 318 | """ ForwardInPort : Packet sent to virtual port IN_PORT |
| 319 | If the output.port = OFPP.INPORT then the packet is sent to the input port itself""" |
| 320 | |
| 321 | def runTest(self): |
| 322 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 323 | logging.info("Running Forward_Inport test") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 324 | |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 325 | of_ports = config["port_map"].keys() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 326 | of_ports.sort() |
| 327 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 328 | |
| 329 | #Clear switch state |
Rich Lane | 32bf948 | 2013-01-03 17:26:30 -0800 | [diff] [blame] | 330 | delete_all_flows(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 331 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 332 | logging.info("Insert a flow with output action port OFPP_INPORT") |
| 333 | logging.info("Send packet matching the flow") |
| 334 | logging.info("Expecting packet on the input port") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 335 | |
| 336 | #Create a packet |
| 337 | pkt = simple_tcp_packet() |
| 338 | match = parse.packet_to_flow_match(pkt) |
Rich Lane | 9d3cc6b | 2013-03-08 16:33:08 -0800 | [diff] [blame] | 339 | act = ofp.action.output() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 340 | |
| 341 | #Delete the flows |
Rich Lane | 32bf948 | 2013-01-03 17:26:30 -0800 | [diff] [blame] | 342 | delete_all_flows(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 343 | ingress_port=of_ports[0] |
| 344 | match.in_port = ingress_port |
| 345 | |
| 346 | # Create a flow mod message |
Rich Lane | ba3f0e2 | 2013-03-11 16:43:57 -0700 | [diff] [blame] | 347 | request = ofp.message.flow_add() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 348 | request.match = match |
| 349 | act.port = ofp.OFPP_IN_PORT |
| 350 | |
Rich Lane | c495d9e | 2013-03-08 17:43:36 -0800 | [diff] [blame] | 351 | request.actions.append(act) |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 352 | logging.info("Inserting flow") |
Rich Lane | 5c3151c | 2013-01-03 17:15:41 -0800 | [diff] [blame] | 353 | self.controller.message_send(request) |
Rich Lane | 3a261d5 | 2013-01-03 17:45:08 -0800 | [diff] [blame] | 354 | do_barrier(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 355 | |
| 356 | #Send packet matching the flow |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 357 | logging.info("Sending packet to dp port " + str(ingress_port)) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 358 | self.dataplane.send(ingress_port, str(pkt)) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 359 | |
| 360 | #Verfying packet recieved on expected dataplane ports |
Rich Lane | e4b384d | 2013-09-13 14:33:40 -0700 | [diff] [blame^] | 361 | verify_packets(self, pkt, [ingress_port]) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 362 | |
Rich Lane | b90a1c4 | 2012-10-05 09:16:05 -0700 | [diff] [blame] | 363 | class ForwardTable(base_tests.SimpleDataPlane): |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 364 | |
| 365 | """ForwardTable : Perform actions in flow table. Only for packet-out messages. |
| 366 | If the output action.port in the packetout message = OFP.TABLE , then |
| 367 | the packet implements the action specified in the matching flow of the FLOW-TABLE""" |
| 368 | |
| 369 | def runTest(self): |
| 370 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 371 | logging.info("Running Forward_Table test") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 372 | |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 373 | of_ports = config["port_map"].keys() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 374 | of_ports.sort() |
| 375 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 376 | |
| 377 | #Clear switch state |
Rich Lane | 32bf948 | 2013-01-03 17:26:30 -0800 | [diff] [blame] | 378 | delete_all_flows(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 379 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 380 | logging.info("Insert a flow F with output action port set to some egress_port") |
| 381 | logging.info("Send packet out message (matching flow F) with action.port = OFP.TABLE") |
| 382 | logging.info("Expecting packet on the egress_port") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 383 | |
| 384 | #Insert a all wildcarded flow |
ShreyaPandita | 8dab466 | 2012-11-02 13:40:14 -0400 | [diff] [blame] | 385 | (pkt,match) = wildcard_all(self,of_ports) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 386 | |
| 387 | #Create a packet out message |
Rich Lane | 28fa927 | 2013-03-08 16:00:25 -0800 | [diff] [blame] | 388 | pkt_out =ofp.message.packet_out(); |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 389 | pkt_out.data = str(pkt) |
| 390 | pkt_out.in_port = of_ports[0] |
Rich Lane | ea8c472 | 2013-04-04 15:30:20 -0700 | [diff] [blame] | 391 | pkt_out.buffer_id = 0xffffffff |
Rich Lane | 9d3cc6b | 2013-03-08 16:33:08 -0800 | [diff] [blame] | 392 | act = ofp.action.output() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 393 | act.port = ofp.OFPP_TABLE |
Rich Lane | c495d9e | 2013-03-08 17:43:36 -0800 | [diff] [blame] | 394 | pkt_out.actions.append(act) |
Rich Lane | 5c3151c | 2013-01-03 17:15:41 -0800 | [diff] [blame] | 395 | self.controller.message_send(pkt_out) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 396 | |
| 397 | #Verifying packet out message recieved on the expected dataplane port. |
| 398 | (of_port, pkt, pkt_time) = self.dataplane.poll(port_number=of_ports[1], |
| 399 | exp_pkt=pkt,timeout=3) |
| 400 | self.assertTrue(pkt is not None, 'Packet not received') |
| 401 | |
| 402 | |
Rich Lane | b90a1c4 | 2012-10-05 09:16:05 -0700 | [diff] [blame] | 403 | class AddVlanTag(base_tests.SimpleDataPlane): |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 404 | |
| 405 | """AddVlanTag : Adds VLAN Tag to untagged packet.""" |
| 406 | |
| 407 | def runTest(self): |
| 408 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 409 | logging.info("Running Add_vlan_tag test") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 410 | |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 411 | of_ports = config["port_map"].keys() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 412 | of_ports.sort() |
| 413 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 414 | |
| 415 | #Clear switch state |
Rich Lane | 32bf948 | 2013-01-03 17:26:30 -0800 | [diff] [blame] | 416 | delete_all_flows(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 417 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 418 | logging.info("Verify if switch supports the action -- set vlan id, if not skip the test") |
| 419 | logging.info("Insert a flow with set vid action") |
| 420 | logging.info("Send packet matching the flow , verify recieved packet has vid set") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 421 | |
| 422 | #Verify set_vlan_id is a supported action |
| 423 | sup_acts = sw_supported_actions(self) |
| 424 | if not(sup_acts & 1<<ofp.OFPAT_SET_VLAN_VID): |
| 425 | skip_message_emit(self, "Add VLAN tag test skipped") |
| 426 | return |
| 427 | |
| 428 | #Create packet to be sent and an expected packet with vid set |
| 429 | new_vid = 2 |
| 430 | len_wo_vid = 100 |
| 431 | len_w_vid = 104 |
| 432 | pkt = simple_tcp_packet(pktlen=len_wo_vid) |
| 433 | exp_pkt = simple_tcp_packet(pktlen=len_w_vid, dl_vlan_enable=True, |
Rich Lane | d0478ff | 2013-03-11 12:46:58 -0700 | [diff] [blame] | 434 | vlan_vid=new_vid,vlan_pcp=0) |
Rich Lane | 9d3cc6b | 2013-03-08 16:33:08 -0800 | [diff] [blame] | 435 | vid_act = ofp.action.set_vlan_vid() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 436 | vid_act.vlan_vid = new_vid |
| 437 | |
| 438 | #Insert flow with action -- set vid , Send packet matching the flow, Verify recieved packet is expected packet |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 439 | flow_match_test(self, config["port_map"], pkt=pkt, |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 440 | exp_pkt=exp_pkt, action_list=[vid_act]) |
| 441 | |
Rich Lane | b90a1c4 | 2012-10-05 09:16:05 -0700 | [diff] [blame] | 442 | class ModifyVlanTag(base_tests.SimpleDataPlane): |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 443 | |
| 444 | """ModifyVlanTag : Modifies VLAN Tag to tagged packet.""" |
| 445 | |
| 446 | def runTest(self): |
| 447 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 448 | logging.info("Running Modify_Vlan_Tag test") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 449 | |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 450 | of_ports = config["port_map"].keys() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 451 | of_ports.sort() |
| 452 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 453 | |
| 454 | #Clear switch state |
Rich Lane | 32bf948 | 2013-01-03 17:26:30 -0800 | [diff] [blame] | 455 | delete_all_flows(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 456 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 457 | logging.info("Verify if switch supports the action -- modify vlan id, if not skip the test") |
| 458 | logging.info("Insert a flow with action --set vid ") |
| 459 | logging.info("Send tagged packet matching the flow , verify recieved packet has vid rewritten") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 460 | |
| 461 | #Verify set_vlan_id is a supported action |
| 462 | sup_acts = sw_supported_actions(self) |
| 463 | if not (sup_acts & 1 << ofp.OFPAT_SET_VLAN_VID): |
| 464 | skip_message_emit(self, "Modify VLAN tag test skipped") |
| 465 | return |
| 466 | |
| 467 | #Create a tagged packet with old_vid to be sent, and expected packet with new_vid |
| 468 | old_vid = 2 |
| 469 | new_vid = 3 |
Rich Lane | d0478ff | 2013-03-11 12:46:58 -0700 | [diff] [blame] | 470 | pkt = simple_tcp_packet(dl_vlan_enable=True, vlan_vid=old_vid) |
| 471 | exp_pkt = simple_tcp_packet(dl_vlan_enable=True, vlan_vid=new_vid) |
Rich Lane | 9d3cc6b | 2013-03-08 16:33:08 -0800 | [diff] [blame] | 472 | vid_act = ofp.action.set_vlan_vid() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 473 | vid_act.vlan_vid = new_vid |
| 474 | |
| 475 | #Insert flow with action -- set vid , Send packet matching the flow.Verify recieved packet is expected packet. |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 476 | flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 477 | action_list=[vid_act]) |
| 478 | |
Rich Lane | b90a1c4 | 2012-10-05 09:16:05 -0700 | [diff] [blame] | 479 | class VlanPrio1(base_tests.SimpleDataPlane): |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 480 | |
| 481 | """AddVlanPrioUntaggedPkt : Add VLAN priority to untagged packet.""" |
| 482 | |
| 483 | def runTest(self): |
| 484 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 485 | logging.info("Running vlan_Prio_1 test") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 486 | |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 487 | of_ports = config["port_map"].keys() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 488 | of_ports.sort() |
| 489 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 490 | |
| 491 | #Clear switch state |
Rich Lane | 32bf948 | 2013-01-03 17:26:30 -0800 | [diff] [blame] | 492 | delete_all_flows(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 493 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 494 | logging.info("Verify if switch supports the action -- set vlan priority, if not skip the test") |
| 495 | logging.info("Insert a flow with action -- set vlan priority ") |
| 496 | logging.info("Send untagged packet matching the flow , verify recieved packet has specified VLAN priority and has vid set tO 0 ") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 497 | |
| 498 | #Verify set_vlan_priority is a supported action |
| 499 | sup_acts = sw_supported_actions(self) |
| 500 | if not (sup_acts & 1 << ofp.OFPAT_SET_VLAN_PCP): |
| 501 | skip_message_emit(self, "Set VLAN priority test skipped") |
| 502 | return |
| 503 | |
| 504 | #Create a untagged packet to be sent and an expected packet with vid = 0 , vlan_priority set. |
| 505 | vlan_id = 0 |
Rich Lane | 123928c | 2012-10-04 21:28:53 -0700 | [diff] [blame] | 506 | vlan_pcp = 1 |
Dan Talayco | 3bfc822 | 2013-02-13 18:18:57 -0800 | [diff] [blame] | 507 | pktlen = 64 if config["minsize"] < 64 else config["minsize"] |
| 508 | pkt = simple_tcp_packet(pktlen=pktlen) |
Rich Lane | d0478ff | 2013-03-11 12:46:58 -0700 | [diff] [blame] | 509 | exp_pkt = simple_tcp_packet(dl_vlan_enable=True, vlan_vid=vlan_id,vlan_pcp=vlan_pcp, pktlen=pktlen + 4) |
Rich Lane | 9d3cc6b | 2013-03-08 16:33:08 -0800 | [diff] [blame] | 510 | act = ofp.action.set_vlan_pcp() |
Rich Lane | 123928c | 2012-10-04 21:28:53 -0700 | [diff] [blame] | 511 | act.vlan_pcp = vlan_pcp |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 512 | |
| 513 | #Insert flow with action -- set vLAN priority, Send packet matching the flow, Verify recieved packet is expected packet |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 514 | flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 515 | action_list=[act]) |
| 516 | |
| 517 | |
Rich Lane | b90a1c4 | 2012-10-05 09:16:05 -0700 | [diff] [blame] | 518 | class VlanPrio2(base_tests.SimpleDataPlane): |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 519 | |
| 520 | """ModifyVlanPrio : Modify VLAN priority to tagged packet.""" |
| 521 | |
| 522 | def runTest(self): |
| 523 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 524 | logging.info("Running Vlan_Prio_2 test") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 525 | |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 526 | of_ports = config["port_map"].keys() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 527 | of_ports.sort() |
| 528 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 529 | |
| 530 | #Clear switch state |
Rich Lane | 32bf948 | 2013-01-03 17:26:30 -0800 | [diff] [blame] | 531 | delete_all_flows(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 532 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 533 | logging.info("Verify if switch supports the action -- set vlan priority, if not skip the test") |
| 534 | logging.info("Insert a flow with action -- set vlan priority ") |
| 535 | logging.info("Send tagged packet matching the flow, verify recieved packet has vlan priority rewritten") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 536 | |
| 537 | #Verify set_vlan_priority is a supported action |
| 538 | sup_acts = sw_supported_actions(self,"true") |
| 539 | if not (sup_acts & 1 << ofp.OFPAT_SET_VLAN_PCP): |
| 540 | skip_message_emit(self, "modify_vlan_prio test skipped") |
| 541 | return |
| 542 | |
| 543 | #Create a tagged packet , and an expected packet with vlan_priority set to specified value |
| 544 | vid = 123 |
| 545 | old_vlan_pcp = 2 |
| 546 | new_vlan_pcp = 3 |
Rich Lane | d0478ff | 2013-03-11 12:46:58 -0700 | [diff] [blame] | 547 | pkt = simple_tcp_packet(dl_vlan_enable=True, vlan_vid=vid, vlan_pcp=old_vlan_pcp) |
| 548 | exp_pkt = simple_tcp_packet(dl_vlan_enable=True, vlan_vid=vid, vlan_pcp=new_vlan_pcp) |
Rich Lane | 9d3cc6b | 2013-03-08 16:33:08 -0800 | [diff] [blame] | 549 | vid_act = ofp.action.set_vlan_pcp() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 550 | vid_act.vlan_pcp = new_vlan_pcp |
| 551 | |
| 552 | #Insert flow with action -- set vLAN priority, Send tagged packet matching the flow, Verify recieved packet is expected packet |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 553 | flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 554 | action_list=[vid_act]) |
| 555 | |
| 556 | |
Rich Lane | b90a1c4 | 2012-10-05 09:16:05 -0700 | [diff] [blame] | 557 | class ModifyL2Src(base_tests.SimpleDataPlane): |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 558 | |
| 559 | """ModifyL2Src :Modify the source MAC address""" |
| 560 | |
| 561 | def runTest(self): |
| 562 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 563 | logging.info("Running Modify_L2_Src test") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 564 | |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 565 | of_ports = config["port_map"].keys() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 566 | of_ports.sort() |
| 567 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 568 | |
| 569 | #Clear switch state |
Rich Lane | 32bf948 | 2013-01-03 17:26:30 -0800 | [diff] [blame] | 570 | delete_all_flows(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 571 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 572 | logging.info("Verify if switch supports the action -- modify_l2_src, if not skip the test") |
| 573 | logging.info("Insert a flow with action -- set etherent src address") |
| 574 | logging.info("Send packet matching the flow, verify recieved packet src address rewritten ") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 575 | |
| 576 | #Verify set_dl_src is a supported action |
| 577 | sup_acts = sw_supported_actions(self,use_cache="true") |
| 578 | if not (sup_acts & 1 << ofp.OFPAT_SET_DL_SRC): |
| 579 | skip_message_emit(self, "modify_l2_src test skipped") |
| 580 | return |
| 581 | |
Rich Lane | d0478ff | 2013-03-11 12:46:58 -0700 | [diff] [blame] | 582 | #Create packet to be sent and expected packet with eth_src set to specified value |
| 583 | (pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['eth_src'], |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 584 | check_test_params=True) |
| 585 | |
| 586 | #Insert flow with action -- set src address, Send packet matching the flow, Verify recieved packet is expected packet |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 587 | flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 588 | action_list=acts, max_test=2) |
| 589 | |
| 590 | |
Rich Lane | b90a1c4 | 2012-10-05 09:16:05 -0700 | [diff] [blame] | 591 | class ModifyL2Dst(base_tests.SimpleDataPlane): |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 592 | |
| 593 | """ModifyL2SDSt :Modify the dest MAC address""" |
| 594 | |
| 595 | def runTest(self): |
| 596 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 597 | logging.info("Running Modify_L2_Dst test") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 598 | |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 599 | of_ports = config["port_map"].keys() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 600 | of_ports.sort() |
| 601 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 602 | |
| 603 | #Clear switch state |
Rich Lane | 32bf948 | 2013-01-03 17:26:30 -0800 | [diff] [blame] | 604 | delete_all_flows(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 605 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 606 | logging.info("Verify if switch supports the action -- modify_l2_dst, if not skip the test") |
| 607 | logging.info("Insert a flow with action -- set etherent dst address ") |
| 608 | logging.info("Send packet matching the flow, verify recieved packet dst address rewritten ") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 609 | |
| 610 | #Verify set_dl_dst is a supported action |
| 611 | sup_acts = sw_supported_actions(self) |
| 612 | if not (sup_acts & 1 << ofp.OFPAT_SET_DL_DST): |
| 613 | skip_message_emit(self, "modify_l2_dst test skipped") |
| 614 | return |
| 615 | |
Rich Lane | d0478ff | 2013-03-11 12:46:58 -0700 | [diff] [blame] | 616 | #Create packet to be sent and expected packet with eth_src set to specified value |
| 617 | (pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['eth_dst'], |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 618 | check_test_params=True) |
| 619 | |
| 620 | #Insert flow with action -- set dst address, Send packet matching the flow, Verify recieved packet is expected packet |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 621 | flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 622 | action_list=acts, max_test=2) |
| 623 | |
Rich Lane | b90a1c4 | 2012-10-05 09:16:05 -0700 | [diff] [blame] | 624 | class ModifyL3Src(base_tests.SimpleDataPlane): |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 625 | |
| 626 | """ModifyL3Src : Modify the source IP address of an IP packet """ |
| 627 | |
| 628 | def runTest(self): |
| 629 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 630 | logging.info("Running Modify_L3_Src test") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 631 | |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 632 | of_ports = config["port_map"].keys() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 633 | of_ports.sort() |
| 634 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 635 | |
| 636 | #Clear switch state |
Rich Lane | 32bf948 | 2013-01-03 17:26:30 -0800 | [diff] [blame] | 637 | delete_all_flows(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 638 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 639 | logging.info("Verify if switch supports the action -- modify_l3_src, if not skip the test") |
| 640 | logging.info("Insert a flow with action -- set network src address ") |
| 641 | logging.info("Send packet matching the flow, verify recieved packet network src address rewritten ") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 642 | |
| 643 | #Verify set_nw_src is a supported action |
| 644 | sup_acts = sw_supported_actions(self) |
| 645 | if not (sup_acts & 1 << ofp.OFPAT_SET_NW_SRC): |
| 646 | skip_message_emit(self, "modify_l3_src test") |
| 647 | return |
| 648 | |
Rich Lane | d0478ff | 2013-03-11 12:46:58 -0700 | [diff] [blame] | 649 | #Create packet to be sent and expected packet with ipv4_src set to specified value |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 650 | (pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['ip_src'], |
| 651 | check_test_params=True) |
| 652 | |
| 653 | #Insert flow with action -- set nw src address, Send packet matching the flow, Verify recieved packet is expected packet |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 654 | flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 655 | action_list=acts, max_test=2) |
| 656 | |
Rich Lane | b90a1c4 | 2012-10-05 09:16:05 -0700 | [diff] [blame] | 657 | class ModifyL3Dst(base_tests.SimpleDataPlane): |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 658 | |
| 659 | """ModifyL3Dst :Modify the dest IP address of an IP packet""" |
| 660 | |
| 661 | def runTest(self): |
| 662 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 663 | logging.info("Running Modify_L3_Dst test") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 664 | |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 665 | of_ports = config["port_map"].keys() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 666 | of_ports.sort() |
| 667 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 668 | |
| 669 | #Clear switch state |
Rich Lane | 32bf948 | 2013-01-03 17:26:30 -0800 | [diff] [blame] | 670 | delete_all_flows(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 671 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 672 | logging.info("Verify if switch supports the action -- modify_l3_dst, if not skip the test") |
| 673 | logging.info("Insert a flow with action -- set network dst address ") |
| 674 | logging.info("Send packet matching the flow, verify recieved packet network dst address rewritten ") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 675 | |
| 676 | #Verify set_nw_dst is a supported action |
| 677 | sup_acts = sw_supported_actions(self,use_cache="true") |
| 678 | if not (sup_acts & 1 << ofp.OFPAT_SET_NW_DST): |
| 679 | skip_message_emit(self, "modify_l3_dst test skipped") |
| 680 | return |
| 681 | |
Rich Lane | d0478ff | 2013-03-11 12:46:58 -0700 | [diff] [blame] | 682 | #Create packet to be sent and expected packet with ipv4_dst set to specified value |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 683 | (pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['ip_dst'], |
| 684 | check_test_params=True) |
| 685 | |
| 686 | #Insert flow with action -- set nw dst address, Send packet matching the flow, Verify recieved packet is expected packet |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 687 | flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 688 | action_list=acts, max_test=2) |
| 689 | |
| 690 | |
Rich Lane | b90a1c4 | 2012-10-05 09:16:05 -0700 | [diff] [blame] | 691 | class ModifyL4Src(base_tests.SimpleDataPlane): |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 692 | |
| 693 | """ModifyL4Src : Modify the source TCP port of a TCP packet""" |
| 694 | |
| 695 | def runTest(self): |
| 696 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 697 | logging.info("Running Modify_L4_Src test") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 698 | |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 699 | of_ports = config["port_map"].keys() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 700 | of_ports.sort() |
| 701 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 702 | |
| 703 | #Clear switch state |
Rich Lane | 32bf948 | 2013-01-03 17:26:30 -0800 | [diff] [blame] | 704 | delete_all_flows(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 705 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 706 | logging.info("Verify if switch supports the action -- modify_l4_src, if not skip the test") |
| 707 | logging.info("Insert a flow with action -- set src tcp port") |
| 708 | logging.info("Send packet matching the flow, verify recieved packet src tcp port is rewritten ") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 709 | |
| 710 | #Verify set_tp_src is a supported action |
| 711 | sup_acts = sw_supported_actions(self,use_cache="true") |
| 712 | if not (sup_acts & 1 << ofp.OFPAT_SET_TP_SRC): |
| 713 | skip_message_emit(self, "modify_l4_src test skipped") |
| 714 | return |
| 715 | |
| 716 | #Create packet to be sent and expected packet with tcp_src set to specified value |
| 717 | (pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['tcp_sport'], |
| 718 | check_test_params=True) |
| 719 | |
| 720 | #Insert flow with action -- set tcp src port, Send packet matching the flow, Verify recieved packet is expected packet |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 721 | flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 722 | action_list=acts, max_test=2) |
| 723 | |
Rich Lane | b90a1c4 | 2012-10-05 09:16:05 -0700 | [diff] [blame] | 724 | class ModifyL4Dst(base_tests.SimpleDataPlane): |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 725 | |
| 726 | """ ModifyL4Dst: Modify the dest TCP port of a TCP packet """ |
| 727 | |
| 728 | def runTest(self): |
| 729 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 730 | logging.info("Running Modify_L4_Dst test") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 731 | |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 732 | of_ports = config["port_map"].keys() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 733 | of_ports.sort() |
| 734 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 735 | |
| 736 | #Clear switch state |
Rich Lane | 32bf948 | 2013-01-03 17:26:30 -0800 | [diff] [blame] | 737 | delete_all_flows(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 738 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 739 | logging.info("Verify if switch supports the action -- modify_l4_dst, if not skip the test") |
| 740 | logging.info("Insert a flow with action -- set dst tcp port") |
| 741 | logging.info("Send packet matching the flow, verify recieved packet dst tcp port is rewritten ") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 742 | |
| 743 | #Verify set_tp_dst is a supported action |
| 744 | sup_acts = sw_supported_actions(self,use_cache="true") |
| 745 | if not (sup_acts & 1 << ofp.OFPAT_SET_TP_DST): |
| 746 | skip_message_emit(self, "ModifyL4Dst test") |
| 747 | return |
| 748 | |
| 749 | #Create packet to be sent and expected packet with tcp_dst set to specified value |
| 750 | (pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['tcp_dport'], |
| 751 | check_test_params=True) |
| 752 | |
| 753 | #Insert flow with action -- set tcp dst port, Send packet matching the flow, Verify recieved packet is expected packet |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 754 | flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 755 | action_list=acts, max_test=2) |
| 756 | |
Rich Lane | b90a1c4 | 2012-10-05 09:16:05 -0700 | [diff] [blame] | 757 | class ModifyTos(base_tests.SimpleDataPlane): |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 758 | |
| 759 | """ModifyTOS :Modify the IP type of service of an IP packet""" |
| 760 | |
| 761 | def runTest(self): |
| 762 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 763 | logging.info("Running Modify_Tos test") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 764 | |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 765 | of_ports = config["port_map"].keys() |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 766 | of_ports.sort() |
| 767 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 768 | |
| 769 | #Clear switch state |
Rich Lane | 32bf948 | 2013-01-03 17:26:30 -0800 | [diff] [blame] | 770 | delete_all_flows(self.controller) |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 771 | |
Rich Lane | 9a00381 | 2012-10-04 17:17:59 -0700 | [diff] [blame] | 772 | logging.info("Verify if switch supports the action -- modify_tos, if not skip the test") |
| 773 | logging.info("Insert a flow with action -- set type of service ") |
| 774 | logging.info("Send packet matching the flow, verify recieved packet has TOS rewritten ") |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 775 | |
| 776 | #Verify set_tos is a supported action |
| 777 | sup_acts = sw_supported_actions(self,use_cache="true") |
| 778 | if not (sup_acts & 1 << ofp.OFPAT_SET_NW_TOS): |
| 779 | skip_message_emit(self, "ModifyTOS test") |
| 780 | return |
| 781 | |
| 782 | #Create packet to be sent and expected packet with TOS set to specified value |
| 783 | (pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['ip_tos'], |
| 784 | check_test_params=True) |
| 785 | |
| 786 | #Insert flow with action -- set TOS, Send packet matching the flow, Verify recieved packet is expected packet |
Rich Lane | 477f481 | 2012-10-04 22:49:00 -0700 | [diff] [blame] | 787 | flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, |
ShreyaPandita | 9306c77 | 2012-09-28 12:21:40 -0400 | [diff] [blame] | 788 | action_list=acts, max_test=2, egr_count=-1) |