ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 1 | """These tests fall under Conformance Test-Suite (OF-SWITCH-1.0.0 TestCases). |
| 2 | Refer Documentation -- Detailed testing methodology |
| 3 | <Some of test-cases are directly taken from oftest> """ |
| 4 | |
| 5 | "Test Suite 5 --> Counters" |
| 6 | |
| 7 | import logging |
| 8 | |
| 9 | import unittest |
| 10 | import random |
| 11 | |
| 12 | from oftest import config |
| 13 | import oftest.controller as controller |
| 14 | import oftest.cstruct as ofp |
| 15 | import oftest.message as message |
| 16 | import oftest.dataplane as dataplane |
| 17 | import oftest.action as action |
| 18 | import oftest.parse as parse |
| 19 | import oftest.base_tests as base_tests |
| 20 | import time |
| 21 | |
| 22 | from oftest.testutils import * |
| 23 | from time import sleep |
| 24 | from FuncUtils import* |
| 25 | |
| 26 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 27 | def port_queues_get(self, queue_stats, port_num): |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 28 | result = [] |
| 29 | for qs in queue_stats.stats: |
| 30 | if qs.port_no != port_num: |
| 31 | continue |
| 32 | result.append(qs.queue_id) |
| 33 | return result |
| 34 | |
| 35 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 36 | class PktPerFlow(base_tests.SimpleDataPlane): |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 37 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 38 | """Verify Packet counters per flow are |
| 39 | incremented by no. of packets received for that flow""" |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 40 | |
| 41 | def runTest(self): |
| 42 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 43 | logging.info("Running PktPerFlow test") |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 44 | |
| 45 | of_ports = config["port_map"].keys() |
| 46 | of_ports.sort() |
| 47 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 48 | |
| 49 | #Clear switch state |
| 50 | rv = delete_all_flows(self.controller) |
| 51 | self.assertEqual(rv, 0, "Failed to delete all flows") |
| 52 | |
| 53 | logging.info("Insert any flow") |
| 54 | logging.info("Sending N Packets matching the flow") |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 55 | logging.info("Verify packet counters increment in accordance") |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 56 | |
| 57 | #Create a Match on Ingress flow |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 58 | (pkt,match) = wildcard_all_except_ingress(self,of_ports) |
| 59 | |
| 60 | #Send Packets matching the flow |
| 61 | num_pkts = 5 |
| 62 | for pkt_cnt in range(num_pkts): |
| 63 | self.dataplane.send(of_ports[0],str(pkt)) |
| 64 | |
| 65 | #Verify Recieved Packets/Bytes Per Flow |
| 66 | verify_flowstats(self,match,packet_count=num_pkts) |
| 67 | |
| 68 | |
| 69 | class BytPerFlow(base_tests.SimpleDataPlane): |
| 70 | |
| 71 | """Verify Byte counters per flow are |
| 72 | incremented by no. of bytes received for that flow""" |
| 73 | |
| 74 | def runTest(self): |
| 75 | |
| 76 | logging.info("Running BytPerFlow test") |
| 77 | |
| 78 | of_ports = config["port_map"].keys() |
| 79 | of_ports.sort() |
| 80 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 81 | |
| 82 | #Clear switch state |
| 83 | rv = delete_all_flows(self.controller) |
| 84 | self.assertEqual(rv, 0, "Failed to delete all flows") |
| 85 | |
| 86 | logging.info("Insert any flow") |
| 87 | logging.info("Sending N Packets matching the flow") |
| 88 | logging.info("Verify byte counters increment in accordance") |
| 89 | |
| 90 | #Create a Match on Ingress flow |
| 91 | (pkt,match) = wildcard_all_except_ingress(self,of_ports) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 92 | |
| 93 | #Send Packets matching the flow |
| 94 | num_pkts = 5 |
| 95 | byte_count = num_pkts*len(str(pkt)) |
| 96 | for pkt_cnt in range(num_pkts): |
| 97 | self.dataplane.send(of_ports[0],str(pkt)) |
| 98 | |
| 99 | #Verify Recieved Packets/Bytes Per Flow |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 100 | verify_flowstats(self,match,byte_count=byte_count) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 101 | |
| 102 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 103 | class DurationPerFlow(base_tests.SimpleDataPlane): |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 104 | |
| 105 | """Verify Duration_sec and Duration_nsec counters per flow varies in accordance with the amount of |
| 106 | time the flow was alive""" |
| 107 | |
| 108 | def runTest(self): |
| 109 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 110 | logging.info("Running DurationPerFlow test") |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 111 | |
| 112 | of_ports = config["port_map"].keys() |
| 113 | of_ports.sort() |
| 114 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 115 | |
| 116 | #Clear switch state |
| 117 | rc = delete_all_flows(self.controller) |
| 118 | self.assertEqual(rc, 0, "Failed to delete all flows") |
| 119 | |
| 120 | logging.info("Insert any flow") |
| 121 | logging.info("Send Flow_stats request after n sec intervals") |
| 122 | logging.info("Verify duration_sec and nsec counters are incrementing in accordance with the life of flow") |
| 123 | |
| 124 | #Create a flow with match on ingress_port |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 125 | (pkt,match) = wildcard_all_except_ingress(self,of_ports) |
| 126 | |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 127 | #Create flow_stats request |
| 128 | test_timeout = 30 |
| 129 | stat_req = message.flow_stats_request() |
| 130 | stat_req.match= match |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 131 | stat_req.table_id = 0xff |
| 132 | stat_req.out_port = ofp.OFPP_NONE |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 133 | |
| 134 | flow_stats_gen_ts = range (10,test_timeout,10) |
| 135 | |
| 136 | for ts in range(0,test_timeout): |
| 137 | if ts in flow_stats_gen_ts: |
| 138 | response, pkt = self.controller.transact(stat_req) |
| 139 | |
| 140 | self.assertTrue(response is not None,"No response to stats request") |
| 141 | self.assertTrue(len(response.stats) == 1,"Did not receive flow stats reply") |
| 142 | |
| 143 | stat = response.stats[0] |
| 144 | self.assertTrue(stat.duration_sec == ts,"Flow stats reply incorrect") |
| 145 | logging.info("Duration of flow is " + str(stat.duration_sec) + str(stat.duration_nsec)) |
| 146 | |
| 147 | sleep(1) |
| 148 | |
| 149 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 150 | class RxPktPerPort(base_tests.SimpleDataPlane): |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 151 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 152 | """Verify that rx_packets counter in the Port_Stats reply |
| 153 | increments when packets are received on a port""" |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 154 | |
| 155 | def runTest(self): |
| 156 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 157 | logging.info("Running RxPktPerPort test") |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 158 | |
| 159 | of_ports = config["port_map"].keys() |
| 160 | of_ports.sort() |
| 161 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 162 | |
| 163 | # Clear Switch State |
| 164 | rv = delete_all_flows(self.controller) |
| 165 | self.assertEqual(rv, 0, "Failed to delete all flows") |
| 166 | |
| 167 | logging.info("Insert a flow with match on ingress_port") |
| 168 | logging.info("Send N Packets on an ingress_port P ") |
| 169 | logging.info("Send Port_Stats Request for Port P , verify recieved packets counters are incrementing in accordance") |
| 170 | |
| 171 | #Insert a flow with match on all ingress port |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 172 | (pkt, match ) = wildcard_all_except_ingress(self,of_ports) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 173 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 174 | # Send Port_Stats request for the ingress port (retrieve old counter state) |
| 175 | (counter) = get_portstats(self,of_ports[0]) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 176 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 177 | # Send packets matching the flow |
| 178 | num_pkts = 5 |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 179 | for pkt_cnt in range(num_pkts): |
| 180 | self.dataplane.send(of_ports[0],str(pkt)) |
Rich Lane | 47d0ec0 | 2012-10-26 14:28:19 -0700 | [diff] [blame] | 181 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 182 | pkts = num_pkts+counter[0] |
| 183 | |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 184 | #Verify recieved packet counters |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 185 | verify_portstats(self,of_ports[0],rx_packets=pkts) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 186 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 187 | class TxPktPerPort(base_tests.SimpleDataPlane): |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 188 | |
| 189 | """Verify that tx_packets counter in the Port_Stats reply , increments when packets are transmitted by a port""" |
| 190 | |
| 191 | def runTest(self): |
| 192 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 193 | logging.info("Running TxPktPerPort test") |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 194 | |
| 195 | of_ports = config["port_map"].keys() |
| 196 | of_ports.sort() |
| 197 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 198 | |
| 199 | #Clear switch state |
| 200 | rv = delete_all_flows(self.controller) |
| 201 | self.assertEqual(rv, 0, "Failed to delete all flows") |
| 202 | |
| 203 | |
| 204 | logging.info("Insert any flow matching on in_port=ingress_port, action output to egress_port T ") |
| 205 | logging.info("Send N Packets matching the flow on ingress_port P ") |
| 206 | logging.info("Send Port_Stats Request for Port P , verify transmitted packets counters are incrementing in accordance") |
| 207 | |
| 208 | #Insert a flow with match on all ingress port |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 209 | (pkt,match) = wildcard_all_except_ingress(self,of_ports) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 210 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 211 | # Send Port_Stats request for the ingress port (retrieve old counter state) |
| 212 | (counter) = get_portstats(self,of_ports[1]) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 213 | |
| 214 | #Send packets matching the flow |
| 215 | num_pkts = 5 |
| 216 | for pkt_cnt in range(num_pkts): |
| 217 | self.dataplane.send(of_ports[0],str(pkt)) |
Rich Lane | 47d0ec0 | 2012-10-26 14:28:19 -0700 | [diff] [blame] | 218 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 219 | pkts = num_pkts+counter[1] |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 220 | |
| 221 | #Verify transmitted_packet counters |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 222 | verify_portstats(self,of_ports[1],tx_packets=pkts) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 223 | |
| 224 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 225 | |
| 226 | class RxBytPerPort(base_tests.SimpleDataPlane): |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 227 | |
| 228 | """Verify that recieved bytes counter in the Port_Stats reply , increments in accordance with the bytes recieved on a port""" |
| 229 | |
| 230 | def runTest(self): |
| 231 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 232 | logging.info("Running RxBytPerPort test") |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 233 | |
| 234 | of_ports = config["port_map"].keys() |
| 235 | of_ports.sort() |
| 236 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 237 | |
| 238 | #Clear switch State |
| 239 | rv = delete_all_flows(self.controller) |
| 240 | self.assertEqual(rv, 0, "Failed to delete all flows") |
| 241 | |
| 242 | logging.info("Insert any flow matching on in_port=ingress_port") |
| 243 | logging.info("Send N Packets matching the flow on ingress_port P ") |
| 244 | logging.info("Send Port_Stats Request for Port P , verify recieved bytes counters are incrementing in accordance") |
| 245 | |
| 246 | #Insert a flow with match on all ingress port |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 247 | (pkt, match ) = wildcard_all_except_ingress(self,of_ports) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 248 | |
| 249 | # Send Port_Stats request for the ingress port (retrieve current counter state) |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 250 | (counter) = get_portstats(self,of_ports[0]) |
| 251 | |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 252 | #Send packets matching the flow. |
| 253 | num_pkts = 5 |
| 254 | byte_count = num_pkts*len(str(pkt)) |
| 255 | for pkt_cnt in range(num_pkts): |
| 256 | self.dataplane.send(of_ports[0],str(pkt)) |
| 257 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 258 | byt_count = byte_count+counter[2] |
Rich Lane | 47d0ec0 | 2012-10-26 14:28:19 -0700 | [diff] [blame] | 259 | |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 260 | #Verify recieved_bytes counters |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 261 | verify_portstats(self,of_ports[0],rx_byte=byt_count) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 262 | |
| 263 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 264 | class TxBytPerPort(base_tests.SimpleDataPlane): |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 265 | |
| 266 | """Verify that trasnsmitted bytes counter in the Port_Stats reply , increments in accordance with the bytes trasmitted by a port""" |
| 267 | |
| 268 | def runTest(self): |
| 269 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 270 | logging.info("Running TxBytPerPort test") |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 271 | |
| 272 | of_ports = config["port_map"].keys() |
| 273 | of_ports.sort() |
| 274 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 275 | |
| 276 | #Clear switch State |
| 277 | rv = delete_all_flows(self.controller) |
| 278 | self.assertEqual(rv, 0, "Failed to delete all flows") |
| 279 | |
| 280 | logging.info("Insert any flow matching on in_port=ingress_port,action = output to egress_port") |
| 281 | logging.info("Send N Packets matching the flow on ingress_port P ") |
| 282 | logging.info("Send Port_Stats Request for Port P , verify trasmitted bytes counters are incrementing in accordance") |
| 283 | |
| 284 | #Insert a flow with match on all ingress port |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 285 | (pkt, match ) = wildcard_all_except_ingress(self,of_ports) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 286 | |
| 287 | # Send Port_Stats request for the ingress port (retrieve current counter state) |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 288 | (counter) = get_portstats(self,of_ports[1]) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 289 | |
| 290 | #Send packets matching the flow. |
| 291 | num_pkts = 5 |
| 292 | byte_count = num_pkts*len(str(pkt)) |
| 293 | for pkt_cnt in range(num_pkts): |
| 294 | self.dataplane.send(of_ports[0],str(pkt)) |
| 295 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 296 | byt_count = byte_count+counter[3] |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 297 | |
| 298 | #Verify trasmitted_bytes counters |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 299 | verify_portstats(self,of_ports[1],tx_byte=byt_count) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 300 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 301 | class ActiveCount(base_tests.SimpleDataPlane): |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 302 | |
| 303 | """Verify that active_count counter in the Table_Stats reply , increments in accordance with the flows inserted in a table""" |
| 304 | |
| 305 | def runTest(self): |
| 306 | |
| 307 | logging.info("Running Table_Counter_1 test") |
| 308 | |
| 309 | of_ports = config["port_map"].keys() |
| 310 | of_ports.sort() |
| 311 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 312 | |
| 313 | #Clear Switch state |
| 314 | rv = delete_all_flows(self.controller) |
| 315 | self.assertEqual(rv, 0, "Failed to delete all flows") |
| 316 | |
| 317 | logging.info("Insert any flow matching on in_port=ingress_port,action = output to egress_port") |
| 318 | logging.info("Send Table_Stats, verify active_count counter is incremented in accordance") |
| 319 | |
| 320 | #Insert a flow with match on all ingress port |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 321 | (pkt, match ) = wildcard_all_except_ingress(self,of_ports) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 322 | |
| 323 | #Generate Table_Stats |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 324 | verify_tablestats(self,expect_active=1) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 325 | |
| 326 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 327 | class LookupMatchedCount(base_tests.SimpleDataPlane): |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 328 | |
| 329 | """Verify that lookup_count and matched_count counter in the Table_Stats reply |
| 330 | increments in accordance with the packets looked up and matched with the flows in the table""" |
| 331 | |
| 332 | def runTest(self): |
| 333 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 334 | logging.info("Running LookupMatchedCount test") |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 335 | |
| 336 | of_ports = config["port_map"].keys() |
| 337 | of_ports.sort() |
| 338 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 339 | |
| 340 | #Clear Switch state |
| 341 | rv = delete_all_flows(self.controller) |
| 342 | self.assertEqual(rv, 0, "Failed to delete all flows") |
| 343 | |
| 344 | logging.info("Insert any flow matching on in_port=ingress_port,action = output to egress_port") |
| 345 | logging.info("Send N packets matching the flow, N' packets not matching the flow") |
| 346 | logging.info("Send Table_Stats, verify lookup_count = N+N' & matched_count=N ") |
| 347 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 348 | #Get Current Table Stats |
| 349 | (current_lookedup,current_matched,current_active) = get_tablestats(self) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 350 | |
| 351 | #Insert a flow with match on all ingress port |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 352 | (pkt, match ) = wildcard_all_except_ingress(self,of_ports) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 353 | |
| 354 | #send packet pkt N times (pkt matches the flow) |
| 355 | num_sends = 5 |
| 356 | for pkt_cnt in range(num_sends): |
| 357 | self.dataplane.send(of_ports[0],str(pkt)) |
| 358 | |
| 359 | #send packet pkt N' (pkt does not match the flow) |
| 360 | num_sends2 = 5 |
| 361 | for pkt_cnt in range(num_sends): |
| 362 | self.dataplane.send(of_ports[1],str(pkt)) |
| 363 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 364 | new_lookup = num_sends+num_sends2+current_lookedup |
| 365 | new_matched = num_sends+current_matched |
Rich Lane | 47d0ec0 | 2012-10-26 14:28:19 -0700 | [diff] [blame] | 366 | |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 367 | #Verify lookup_count and matched_count counters. |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 368 | verify_tablestats(self,expect_lookup=new_lookup,expect_match=new_matched) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 369 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 370 | class TxPktPerQueue(base_tests.SimpleDataPlane): |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 371 | |
| 372 | """Verify that tx_packets in the queue_stats reply increments in accordance with the number of transmitted packets""" |
| 373 | |
| 374 | def runTest(self): |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 375 | logging.info("Running TxPktPerQueue test") |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 376 | |
| 377 | of_ports = config["port_map"].keys() |
| 378 | of_ports.sort() |
| 379 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 380 | |
| 381 | # Get queue stats from switch (retrieve current state) |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 382 | (queue_stats,p) = get_queuestats(self,ofp.OFPP_ALL,ofp.OFPQ_ALL) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 383 | |
| 384 | for idx in range(len(of_ports)): |
| 385 | ingress_port = of_ports[idx] |
| 386 | egress_port = of_ports[(idx + 1) % len(of_ports)] |
| 387 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 388 | queue_id = port_queues_get(self,queue_stats,egress_port) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 389 | |
| 390 | for egress_queue_id in queue_id: |
| 391 | |
| 392 | #Clear switch state |
| 393 | rv = delete_all_flows(self.controller) |
| 394 | self.assertEqual(rv, 0, "Failed to delete all flows") |
| 395 | |
| 396 | # Get Queue stats for selected egress queue only |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 397 | (qs_before,p) = get_queuestats(self,egress_port,egress_queue_id) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 398 | |
| 399 | #Insert a flow with enqueue action to queues configured on egress_port |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 400 | (pkt,match) = enqueue(self,ingress_port,egress_port,egress_queue_id) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 401 | |
| 402 | #Send packet on the ingress_port and verify its received on egress_port |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 403 | send_packet(self,pkt,ingress_port,egress_port) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 404 | |
| 405 | # FIXME: instead of sleeping, keep requesting queue stats until |
| 406 | # the expected queue counter increases or some large timeout is |
| 407 | # reached |
| 408 | time.sleep(2) |
| 409 | |
| 410 | # Get Queue Stats for selected egress queue after packets have been sent |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 411 | (qs_after,p) = get_queuestats(self,egress_port,egress_queue_id) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 412 | |
| 413 | #Verify transmitted packets counter is incremented in accordance |
| 414 | self.assertEqual(qs_after.stats[0].tx_packets,qs_before.stats[0].tx_packets + 1,"tx_packet count incorrect") |
| 415 | |
| 416 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 417 | class TxBytPerQueue(base_tests.SimpleDataPlane): |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 418 | |
| 419 | """Verify that tx_bytes in the queue_stats reply increments in accordance with the number of transmitted bytes""" |
| 420 | |
| 421 | def runTest(self): |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 422 | logging.info("Running TxBytPerQueue test") |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 423 | |
| 424 | of_ports = config["port_map"].keys() |
| 425 | of_ports.sort() |
| 426 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 427 | |
| 428 | # Get queue stats from switch (retrieve current state) |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 429 | (queue_stats,p) = get_queuestats(self,ofp.OFPP_ALL,ofp.OFPQ_ALL) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 430 | |
| 431 | for idx in range(len(of_ports)): |
| 432 | ingress_port = of_ports[idx] |
| 433 | egress_port = of_ports[(idx + 1) % len(of_ports)] |
| 434 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 435 | queue_id = port_queues_get(self,queue_stats,egress_port) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 436 | |
| 437 | for egress_queue_id in queue_id: |
| 438 | |
| 439 | #Clear switch state |
| 440 | rv = delete_all_flows(self.controller) |
| 441 | self.assertEqual(rv, 0, "Failed to delete all flows") |
| 442 | |
| 443 | # Get Queue stats for selected egress queue only |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 444 | (qs_before,p) = get_queuestats(self,egress_port,egress_queue_id) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 445 | |
| 446 | #Insert a flow with enqueue action to queues configured on egress_port |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 447 | (pkt,match) = enqueue(self,ingress_port,egress_port,egress_queue_id) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 448 | |
| 449 | #Send packet on the ingress_port and verify its received on egress_port |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 450 | send_packet(self,pkt,ingress_port,egress_port) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 451 | |
| 452 | # FIXME: instead of sleeping, keep requesting queue stats until |
| 453 | # the expected queue counter increases or some large timeout is |
| 454 | # reached |
| 455 | time.sleep(2) |
| 456 | |
| 457 | # Get Queue Stats for selected egress queue after packets have been sent |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 458 | (qs_after,p) = get_queuestats(self,egress_port,egress_queue_id) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 459 | |
| 460 | #Verify transmitted packets counter is incremented in accordance |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 461 | self.assertEqual(qs_after.stats[0].tx_bytes,qs_before.stats[0].tx_bytes + 1,"tx_bytes count incorrect") |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 462 | |
| 463 | |
| 464 | |
| 465 | class RxDrops(base_tests.SimpleDataPlane): |
| 466 | |
| 467 | """Verify that rx_dropped counters in the Port_Stats reply increments in accordance with the packets dropped by RX""" |
| 468 | |
| 469 | def runTest(self): |
| 470 | |
| 471 | logging.info("Running Rx_Drops test") |
| 472 | |
| 473 | of_ports = config["port_map"].keys() |
| 474 | of_ports.sort() |
| 475 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 476 | |
| 477 | #Clear switch State |
| 478 | rv = delete_all_flows(self.controller) |
| 479 | self.assertEqual(rv, 0, "Failed to delete all flows") |
| 480 | |
| 481 | logging.info("Send Port_Stats Request") |
| 482 | logging.info("Verify reply has rx_dropped count ") |
| 483 | |
| 484 | # Send Port_Stats request for the ingress port (retrieve current counter state) |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 485 | (counter) = get_portstats(self,of_ports[0]) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 486 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 487 | rx_drp = counter[4] |
| 488 | logging.info("recieved dropped count is :" + str(rx_drp)) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 489 | |
| 490 | |
| 491 | |
| 492 | class TxDrops(base_tests.SimpleDataPlane): |
| 493 | |
| 494 | """Verify that tx_dropped counters in the Port_Stats reply increments in accordance with the packets dropped by TX""" |
| 495 | |
| 496 | def runTest(self): |
| 497 | |
| 498 | logging.info("Running Tx_Drops test") |
| 499 | |
| 500 | of_ports = config["port_map"].keys() |
| 501 | of_ports.sort() |
| 502 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 503 | |
| 504 | #Clear switch State |
| 505 | rv = delete_all_flows(self.controller) |
| 506 | self.assertEqual(rv, 0, "Failed to delete all flows") |
| 507 | |
| 508 | logging.info("Send Port_Stats Request") |
| 509 | logging.info("Verify reply has tx_dropped count ") |
| 510 | |
| 511 | # Send Port_Stats request for the ingress port (retrieve current counter state) |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 512 | (counter) = get_portstats(self,of_ports[1]) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 513 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 514 | tx_drp = counter[5] |
| 515 | logging.info("Transmitted dropped count is :" + str(tx_drp)) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 516 | |
| 517 | |
| 518 | class RxErrors(base_tests.SimpleDataPlane): |
| 519 | |
| 520 | """Verify that rx_errors counters in the Port_Stats reply increments in accordance with number of recieved error |
| 521 | This is a super-set of more specific receive errors and should be greater than or equal to the sum of all |
| 522 | rx_*_err values""" |
| 523 | |
| 524 | def runTest(self): |
| 525 | |
| 526 | logging.info("Running Rx_Errors test") |
| 527 | |
| 528 | of_ports = config["port_map"].keys() |
| 529 | of_ports.sort() |
| 530 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 531 | |
| 532 | #Clear switch State |
| 533 | rv = delete_all_flows(self.controller) |
| 534 | self.assertEqual(rv, 0, "Failed to delete all flows") |
| 535 | |
| 536 | logging.info("Send Port_Stats Request") |
| 537 | logging.info("Verify reply has rx_errors count ") |
| 538 | |
| 539 | # Send Port_Stats request for the ingress port (retrieve current counter state) |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 540 | (counter) = get_portstats(self,of_ports[0]) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 541 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 542 | rx_err = counter[6] |
| 543 | logging.info("Recieve Errors count is :" + str(rx_err)) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 544 | |
| 545 | |
| 546 | class TxErrors(base_tests.SimpleDataPlane): |
| 547 | |
| 548 | """Verify that Tx_errors counters in the Port_Stats reply increments in accordance with number of trasmit error""" |
| 549 | |
| 550 | def runTest(self): |
| 551 | |
| 552 | logging.info("Running Tx_Errors test") |
| 553 | |
| 554 | of_ports = config["port_map"].keys() |
| 555 | of_ports.sort() |
| 556 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 557 | |
| 558 | #Clear switch State |
| 559 | rv = delete_all_flows(self.controller) |
| 560 | self.assertEqual(rv, 0, "Failed to delete all flows") |
| 561 | |
| 562 | logging.info("Send Port_Stats Request") |
| 563 | logging.info("Verify reply has Tx_errors count ") |
| 564 | |
| 565 | # Send Port_Stats request for the ingress port (retrieve current counter state) |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 566 | (counter) = get_portstats(self,of_ports[0]) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 567 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 568 | tx_err = counter[7] |
| 569 | logging.info("Trasmit Error count is :" + str(tx_err)) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 570 | |
| 571 | |
| 572 | class RxFrameErr(base_tests.SimpleDataPlane): |
| 573 | |
| 574 | """Verify that rx_frm_err counters in the Port_Stats reply increments in accordance with the number of frame alignment errors""" |
| 575 | |
| 576 | def runTest(self): |
| 577 | |
| 578 | logging.info("Running Rx_Frame_Err test") |
| 579 | |
| 580 | of_ports = config["port_map"].keys() |
| 581 | of_ports.sort() |
| 582 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 583 | |
| 584 | #Clear switch State |
| 585 | rv = delete_all_flows(self.controller) |
| 586 | self.assertEqual(rv, 0, "Failed to delete all flows") |
| 587 | |
| 588 | logging.info("Send Port_Stats Request") |
| 589 | logging.info("Verify reply has rx_frame_err count ") |
| 590 | |
| 591 | # Send Port_Stats request for the ingress port (retrieve current counter state) |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 592 | (counter) = get_portstats(self,of_ports[0]) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 593 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 594 | rx_fr_err = counter[8] |
| 595 | logging.info("Recieve Frame Errors count is :" + str(rx_fr_err)) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 596 | |
| 597 | |
| 598 | |
| 599 | class RxOErr(base_tests.SimpleDataPlane): |
| 600 | |
| 601 | """Verify that rx_over_err counters in the Port_Stats reply increments in accordance with the number of with RX overrun""" |
| 602 | |
| 603 | def runTest(self): |
| 604 | |
| 605 | logging.info("Running Rx_O_Err test") |
| 606 | |
| 607 | of_ports = config["port_map"].keys() |
| 608 | of_ports.sort() |
| 609 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 610 | |
| 611 | #Clear switch State |
| 612 | rv = delete_all_flows(self.controller) |
| 613 | self.assertEqual(rv, 0, "Failed to delete all flows") |
| 614 | |
| 615 | logging.info("Send Port_Stats Request") |
| 616 | logging.info("Verify reply has rx_over_err count ") |
| 617 | |
| 618 | # Send Port_Stats request for the ingress port (retrieve current counter state) |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 619 | (counter) = get_portstats(self,of_ports[0]) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 620 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 621 | rx_over_err = counter[9] |
| 622 | logging.info("Recieve Overrun Errors count is :" + str(rx_over_err)) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 623 | |
| 624 | |
| 625 | |
| 626 | |
| 627 | class RxCrcErr(base_tests.SimpleDataPlane): |
| 628 | |
| 629 | """Verify that rx_crc_err counters in the Port_Stats reply increments in accordance with the number of crc errors""" |
| 630 | |
| 631 | def runTest(self): |
| 632 | |
| 633 | logging.info("Running Port_Counter_9 test") |
| 634 | |
| 635 | of_ports = config["port_map"].keys() |
| 636 | of_ports.sort() |
| 637 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 638 | |
| 639 | #Clear switch State |
| 640 | rv = delete_all_flows(self.controller) |
| 641 | self.assertEqual(rv, 0, "Failed to delete all flows") |
| 642 | |
| 643 | logging.info("Send Port_Stats Request") |
| 644 | logging.info("Verify reply has rx_crc_err count ") |
| 645 | |
| 646 | # Send Port_Stats request for the ingress port (retrieve current counter state) |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 647 | (counter) = get_portstats(self,of_ports[0]) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 648 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 649 | rx_crc_err = counter[10] |
| 650 | logging.info("Recieve CRC Errors count is :" + str(rx_crc_err)) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 651 | |
| 652 | |
| 653 | |
| 654 | class Collisions(base_tests.SimpleDataPlane): |
| 655 | |
| 656 | """Verify that collisons counters in the Port_Stats reply increments in accordance with the collisions encountered by the switch """ |
| 657 | |
| 658 | def runTest(self): |
| 659 | |
| 660 | logging.info("Running Collisions test") |
| 661 | |
| 662 | of_ports = config["port_map"].keys() |
| 663 | of_ports.sort() |
| 664 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 665 | |
| 666 | #Clear switch State |
| 667 | rv = delete_all_flows(self.controller) |
| 668 | self.assertEqual(rv, 0, "Failed to delete all flows") |
| 669 | |
| 670 | logging.info("Send Port_Stats Request") |
| 671 | logging.info("Verify reply has Collisions count ") |
| 672 | |
| 673 | # Send Port_Stats request for the ingress port (retrieve current counter state) |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 674 | (counter) = get_portstats(self,of_ports[0]) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 675 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 676 | collisions = counter[11] |
| 677 | logging.info("collisions count is :" + str(collisions)) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 678 | |
| 679 | |
| 680 | |
| 681 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 682 | class TxErrorPerQueue(base_tests.SimpleDataPlane): |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 683 | |
| 684 | """Verify that tx_errors in the queue_stats reply increments in accordance with the number of packets dropped due to overrun """ |
| 685 | |
| 686 | def runTest(self): |
| 687 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 688 | logging.info("Running TxErrorPerQueue test") |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 689 | |
| 690 | of_ports = config["port_map"].keys() |
| 691 | of_ports.sort() |
| 692 | self.assertTrue(len(of_ports) > 1, "Not enough ports for test") |
| 693 | |
| 694 | #Clear switch State |
| 695 | rv = delete_all_flows(self.controller) |
| 696 | self.assertEqual(rv, 0, "Failed to delete all flows") |
| 697 | |
| 698 | logging.info("Send Queue_Stats Request") |
| 699 | logging.info("Verify reply has Tramitted Overrun errors count ") |
| 700 | |
| 701 | # Send Port_Stats request for the ingress port (retrieve current counter state) |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 702 | (counter) = get_portstats(self,of_ports[0]) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 703 | |
ShreyaPandita | e807dfb | 2012-11-02 19:01:19 -0400 | [diff] [blame] | 704 | tx_err = counter[12] |
| 705 | logging.info("Transmit Overrun Error count is :" + str(tx_err)) |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 706 | |
ShreyaPandita | 66de26f | 2012-10-26 14:44:24 -0400 | [diff] [blame] | 707 | |
| 708 | |