blob: 312ab6051947eef07cef96bbd50275ddbc3287d3 [file] [log] [blame]
macauley_cheng0a0a7f62015-11-06 11:36:50 +08001import logging
2import oftest.base_tests as base_tests
3from oftest import config
4from oftest.testutils import *
5from util import *
6
7
8class table_stats(base_tests.SimpleDataPlane):
9 def runTest(self):
10 json_result = apply_dpctl_get_cmd(self, config, "stats-table")
11 #pprint(json_result)
12 result=json_result["RECEIVED"][1]
13 self.assertNotEqual(result["stats"], {}, "Table stats reply nothing")
14
15class port_stats(base_tests.SimpleDataPlane):
16 def runTest(self):
17 json_result = apply_dpctl_get_cmd(self, config, "stats-port")
18 #pprint(json_result)
19 result=json_result["RECEIVED"][1]
20 self.assertNotEqual(result["stats"], {}, "Ports stats reply nothing")
21
22class queue_stats(base_tests.SimpleDataPlane):
23 def runTest(self):
24 json_result = apply_dpctl_get_cmd(self, config, "stats-queue")
25 #pprint(json_result)
26 result=json_result["RECEIVED"][1]
27 self.assertNotEqual(result["stats"], {}, "Queue stats reply nothing")
28
29class flow_stats(base_tests.SimpleDataPlane):
30 def runTest(self):
31 json_result = apply_dpctl_get_cmd(self, config, "stats-flow")
32 #pprint(json_result)
33 result=json_result["RECEIVED"][1]
34 self.assertNotEqual(result["stats"], {}, "Flow stats reply nothing")
35
36class aggr_stats(base_tests.SimpleDataPlane):
37 def runTest(self):
38 json_result = apply_dpctl_get_cmd(self, config, "stats-aggr")
39 #pprint(json_result)
40 result=json_result["RECEIVED"][1]
41 self.assertNotEqual(result["flow_cnt"], 0, "No flow exist")
42
43class group_stats(base_tests.SimpleDataPlane):
44 def runTest(self):
45 json_result = apply_dpctl_get_cmd(self, config, "stats-group")
46 #pprint(json_result)
47 result=json_result["RECEIVED"][1]
48 self.assertNotEqual(result["stats"], {}, "Group stats reply nothing")
49
50class group_desc_stats(base_tests.SimpleDataPlane):
51 def runTest(self):
52 json_result = apply_dpctl_get_cmd(self, config, "stats-group-desc")
53 #pprint(json_result)
54 result=json_result["RECEIVED"][1]
55 self.assertNotEqual(result["stats"], {}, "Group desc stats reply nothing")
56
57class meter_stats(base_tests.SimpleDataPlane):
58 def runTest(self):
59 json_result = apply_dpctl_get_cmd(self, config, "stats-meter")
60 #pprint(json_result)
61 result=json_result["RECEIVED"][1]
62 self.assertNotEqual(result["stats"], {}, "Meter stats reply nothing")
63
64class meter_config(base_tests.SimpleDataPlane):
65 def runTest(self):
66 json_result = apply_dpctl_get_cmd(self, config, "meter-config")
67 #pprint(json_result)
68 result=json_result["RECEIVED"][1]
69 self.assertNotEqual(result["stats"], {}, "Meter config reply nothing")
70