macauley_cheng | 420ddce | 2015-10-26 13:42:23 +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 features(base_tests.SimpleDataPlane):
|
| 9 | def runTest(self):
|
| 10 | delete_all_flows(self.controller)
|
macauley_cheng | 0a0a7f6 | 2015-11-06 11:36:50 +0800 | [diff] [blame^] | 11 | delete_all_groups(self.controller)
|
| 12 |
|
| 13 | test_ports = sorted(config["port_map"].keys())
|
| 14 |
|
macauley_cheng | dc5eb58 | 2015-10-26 14:29:17 +0800 | [diff] [blame] | 15 | json_result = apply_dpctl_get_cmd(self, config, "features")
|
macauley_cheng | 420ddce | 2015-10-26 13:42:23 +0800 | [diff] [blame] | 16 | #pprint(json_result)
|
| 17 | result=json_result["RECEIVED"][1]
|
macauley_cheng | 0a0a7f6 | 2015-11-06 11:36:50 +0800 | [diff] [blame^] | 18 | #self.assertTrue(result["tabs"]==64, "Table size is not correct")
|
| 19 | self.assertNotEqual(result["caps"], 0, "Invalid capabilities")
|
| 20 |
|
macauley_cheng | 420ddce | 2015-10-26 13:42:23 +0800 | [diff] [blame] | 21 | class get_config(base_tests.SimpleDataPlane):
|
| 22 | def runTest(self):
|
| 23 | delete_all_flows(self.controller)
|
macauley_cheng | 0a0a7f6 | 2015-11-06 11:36:50 +0800 | [diff] [blame^] | 24 | delete_all_groups(self.controller)
|
| 25 |
|
| 26 | test_ports = sorted(config["port_map"].keys())
|
| 27 |
|
macauley_cheng | dc5eb58 | 2015-10-26 14:29:17 +0800 | [diff] [blame] | 28 | json_result = apply_dpctl_get_cmd(self, config, "get-config")
|
macauley_cheng | 420ddce | 2015-10-26 13:42:23 +0800 | [diff] [blame] | 29 | #pprint(json_result)
|
| 30 | result=json_result["RECEIVED"][1]
|
macauley_cheng | 0a0a7f6 | 2015-11-06 11:36:50 +0800 | [diff] [blame^] | 31 | self.assertNotEqual(result["conf"], {}, "Config reply nothing")
|
| 32 |
|
| 33 | class desc(base_tests.SimpleDataPlane):
|
| 34 | def runTest(self):
|
| 35 | delete_all_flows(self.controller)
|
| 36 | delete_all_groups(self.controller)
|
| 37 |
|
| 38 | json_result = apply_dpctl_get_cmd(self, config, "stats-desc")
|
| 39 | #pprint(json_result)
|
| 40 | result=json_result["RECEIVED"][1]
|
| 41 | self.assertNotEqual(result["mfr"], {}, "DESC MFR reply nothing")
|
| 42 |
|
| 43 | class port_desc(base_tests.SimpleDataPlane):
|
| 44 | def runTest(self):
|
| 45 | json_result = apply_dpctl_get_cmd(self, config, "port-desc")
|
| 46 | #pprint(json_result)
|
| 47 | result=json_result["RECEIVED"][1]
|
| 48 | self.assertNotEqual(result["port"], {}, "Port DESC reply nothing")
|
| 49 |
|
| 50 | class table_features(base_tests.SimpleDataPlane):
|
| 51 | def runTest(self):
|
| 52 | json_result = apply_dpctl_get_cmd(self, config, "table-features")
|
| 53 | #pprint(json_result)
|
| 54 | result=json_result["RECEIVED"][1]
|
| 55 | self.assertNotEqual(result["table_features"], {}, "Table features reply nothing")
|
| 56 |
|
| 57 | class group_features(base_tests.SimpleDataPlane):
|
| 58 | def runTest(self):
|
| 59 | json_result = apply_dpctl_get_cmd(self, config, "group-features")
|
| 60 | #pprint(json_result)
|
| 61 | result=json_result["RECEIVED"][1]
|
| 62 | self.assertNotEqual(result["types"], 0, "Not support group types")
|
| 63 |
|
| 64 | class meter_features(base_tests.SimpleDataPlane):
|
| 65 | def runTest(self):
|
| 66 | json_result = apply_dpctl_get_cmd(self, config, "meter-features")
|
| 67 | #pprint(json_result)
|
| 68 | result=json_result["RECEIVED"][1]["features"][0]
|
| 69 | self.assertNotEqual(result["max_meter"], 0, "Not support meter")
|
| 70 |
|
| 71 |
|