macauley_cheng | 0a0a7f6 | 2015-11-06 11:36:50 +0800 | [diff] [blame^] | 1 | import logging
|
| 2 | import oftest.base_tests as base_tests
|
| 3 | from oftest import config
|
| 4 | from oftest.testutils import *
|
| 5 | from util import *
|
| 6 |
|
| 7 |
|
| 8 | class 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 |
|
| 15 | class 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 |
|
| 22 | class 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 |
|
| 29 | class 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 |
|
| 36 | class 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 |
|
| 43 | class 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 |
|
| 50 | class 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 |
|
| 57 | class 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 |
|
| 64 | class 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 |
|