blob: 287d80b4bbed241c2f03e27c7d1673a4661cf052 [file] [log] [blame]
Matteo Scandoloa229eca2017-08-08 13:05:28 -07001
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_cheng0a0a7f62015-11-06 11:36:50 +080017import logging
18import oftest.base_tests as base_tests
19from oftest import config
20from oftest.testutils import *
21from util import *
22
23
24class 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
31class 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
38class 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
45class 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
52class 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
59class 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
66class 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
73class 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
80class 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