blob: ba850a6cfe6ffdf886df33582d4ea58d65b93406 [file] [log] [blame]
Flavio Castro96646c62015-11-16 15:05:43 -05001"""
2Flow Test
3Test each flow table can set entry, and packet rx correctly.
41) L3UcastRoute
52) QinQ
6"""
7
8import logging
9
10from oftest import config
11import oftest.base_tests as base_tests
12import ofp
13from oftest.testutils import *
14from accton_util import *
15
Flavio Castroa8233862015-12-02 14:41:11 -050016class Purge(base_tests.SimpleDataPlane):
Flavio Castro6efe1862015-11-18 16:28:06 -050017 def runTest(self):
Flavio Castro96646c62015-11-16 15:05:43 -050018 delete_all_flows(self.controller)
19 delete_all_groups(self.controller)
Flavio Castro6efe1862015-11-18 16:28:06 -050020 do_barrier(self.controller)
Flavio Castroa8233862015-12-02 14:41:11 -050021 add_vlan_table_flow(self.controller, config["port_map"].keys(), 1)
22 verify_no_other_packets(self)
23
Flavio Castro96646c62015-11-16 15:05:43 -050024
25class FlowStats(base_tests.SimpleProtocol):
26 """
27 Flow stats multipart transaction
28 Only verifies we get a reply.
29 """
30 def runTest(self):
Flavio Castroa8233862015-12-02 14:41:11 -050031
Flavio Castro96646c62015-11-16 15:05:43 -050032 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 Castroa8233862015-12-02 14:41:11 -050036 print(entry.show())
Flavio Castro96646c62015-11-16 15:05:43 -050037