Matteo Scandolo | a229eca | 2017-08-08 13:05:28 -0700 | [diff] [blame^] | 1 | |
| 2 | # Copyright 2017-present Open Networking Foundation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | |
macauley_cheng | 0a0a7f6 | 2015-11-06 11:36:50 +0800 | [diff] [blame] | 17 | import logging
|
| 18 | import oftest.base_tests as base_tests
|
| 19 | from oftest import config
|
| 20 | from oftest.testutils import *
|
| 21 | from util import *
|
| 22 |
|
| 23 |
|
| 24 | class table_stats(base_tests.SimpleDataPlane):
|
| 25 | def runTest(self):
|
| 26 | json_result = apply_dpctl_get_cmd(self, config, "stats-table")
|
| 27 | #pprint(json_result)
|
| 28 | result=json_result["RECEIVED"][1]
|
| 29 | self.assertNotEqual(result["stats"], {}, "Table stats reply nothing")
|
| 30 |
|
| 31 | class port_stats(base_tests.SimpleDataPlane):
|
| 32 | def runTest(self):
|
| 33 | json_result = apply_dpctl_get_cmd(self, config, "stats-port")
|
| 34 | #pprint(json_result)
|
| 35 | result=json_result["RECEIVED"][1]
|
| 36 | self.assertNotEqual(result["stats"], {}, "Ports stats reply nothing")
|
| 37 |
|
| 38 | class queue_stats(base_tests.SimpleDataPlane):
|
| 39 | def runTest(self):
|
| 40 | json_result = apply_dpctl_get_cmd(self, config, "stats-queue")
|
| 41 | #pprint(json_result)
|
| 42 | result=json_result["RECEIVED"][1]
|
| 43 | self.assertNotEqual(result["stats"], {}, "Queue stats reply nothing")
|
| 44 |
|
| 45 | class flow_stats(base_tests.SimpleDataPlane):
|
| 46 | def runTest(self):
|
| 47 | json_result = apply_dpctl_get_cmd(self, config, "stats-flow")
|
| 48 | #pprint(json_result)
|
| 49 | result=json_result["RECEIVED"][1]
|
| 50 | self.assertNotEqual(result["stats"], {}, "Flow stats reply nothing")
|
| 51 |
|
| 52 | class aggr_stats(base_tests.SimpleDataPlane):
|
| 53 | def runTest(self):
|
| 54 | json_result = apply_dpctl_get_cmd(self, config, "stats-aggr")
|
| 55 | #pprint(json_result)
|
| 56 | result=json_result["RECEIVED"][1]
|
| 57 | self.assertNotEqual(result["flow_cnt"], 0, "No flow exist")
|
| 58 |
|
| 59 | class group_stats(base_tests.SimpleDataPlane):
|
| 60 | def runTest(self):
|
| 61 | json_result = apply_dpctl_get_cmd(self, config, "stats-group")
|
| 62 | #pprint(json_result)
|
| 63 | result=json_result["RECEIVED"][1]
|
| 64 | self.assertNotEqual(result["stats"], {}, "Group stats reply nothing")
|
| 65 |
|
| 66 | class group_desc_stats(base_tests.SimpleDataPlane):
|
| 67 | def runTest(self):
|
| 68 | json_result = apply_dpctl_get_cmd(self, config, "stats-group-desc")
|
| 69 | #pprint(json_result)
|
| 70 | result=json_result["RECEIVED"][1]
|
| 71 | self.assertNotEqual(result["stats"], {}, "Group desc stats reply nothing")
|
| 72 |
|
| 73 | class meter_stats(base_tests.SimpleDataPlane):
|
| 74 | def runTest(self):
|
| 75 | json_result = apply_dpctl_get_cmd(self, config, "stats-meter")
|
| 76 | #pprint(json_result)
|
| 77 | result=json_result["RECEIVED"][1]
|
| 78 | self.assertNotEqual(result["stats"], {}, "Meter stats reply nothing")
|
| 79 |
|
| 80 | class meter_config(base_tests.SimpleDataPlane):
|
| 81 | def runTest(self):
|
| 82 | json_result = apply_dpctl_get_cmd(self, config, "meter-config")
|
| 83 | #pprint(json_result)
|
| 84 | result=json_result["RECEIVED"][1]
|
| 85 | self.assertNotEqual(result["stats"], {}, "Meter config reply nothing")
|
| 86 |
|