Flavio Castro | 96646c6 | 2015-11-16 15:05:43 -0500 | [diff] [blame] | 1 | """ |
| 2 | Flow Test |
| 3 | Test each flow table can set entry, and packet rx correctly. |
| 4 | 1) L3UcastRoute |
| 5 | 2) QinQ |
| 6 | """ |
| 7 | |
| 8 | import logging |
| 9 | |
| 10 | from oftest import config |
| 11 | import oftest.base_tests as base_tests |
| 12 | import ofp |
| 13 | from oftest.testutils import * |
| 14 | from accton_util import * |
| 15 | |
Flavio Castro | a823386 | 2015-12-02 14:41:11 -0500 | [diff] [blame] | 16 | class Purge(base_tests.SimpleDataPlane): |
Flavio Castro | 6efe186 | 2015-11-18 16:28:06 -0500 | [diff] [blame] | 17 | def runTest(self): |
Flavio Castro | 96646c6 | 2015-11-16 15:05:43 -0500 | [diff] [blame] | 18 | delete_all_flows(self.controller) |
| 19 | delete_all_groups(self.controller) |
Flavio Castro | 6efe186 | 2015-11-18 16:28:06 -0500 | [diff] [blame] | 20 | do_barrier(self.controller) |
Flavio Castro | a823386 | 2015-12-02 14:41:11 -0500 | [diff] [blame] | 21 | add_vlan_table_flow(self.controller, config["port_map"].keys(), 1) |
| 22 | verify_no_other_packets(self) |
| 23 | |
Flavio Castro | 96646c6 | 2015-11-16 15:05:43 -0500 | [diff] [blame] | 24 | |
| 25 | class FlowStats(base_tests.SimpleProtocol): |
| 26 | """ |
| 27 | Flow stats multipart transaction |
| 28 | Only verifies we get a reply. |
| 29 | """ |
| 30 | def runTest(self): |
Flavio Castro | a823386 | 2015-12-02 14:41:11 -0500 | [diff] [blame] | 31 | |
Flavio Castro | 96646c6 | 2015-11-16 15:05:43 -0500 | [diff] [blame] | 32 | logging.info("Sending flow stats request") |
| 33 | stats = get_flow_stats(self, ofp.match()) |
| 34 | logging.info("Received %d flow stats entries", len(stats)) |
| 35 | for entry in stats: |
Flavio Castro | a823386 | 2015-12-02 14:41:11 -0500 | [diff] [blame] | 36 | print(entry.show()) |
Flavio Castro | 96646c6 | 2015-11-16 15:05:43 -0500 | [diff] [blame] | 37 | |