From 9230c98ee7e5294e2058b51e8c91022c14183545 Mon Sep 17 00:00:00 2001 From: songbaisen Date: Tue, 27 Feb 2018 18:57:36 +0800 Subject: [PATCH] Fix the smoke test error 1. What is the problem? the smoke test can not pass, because the new neutron qos code forbid duplicate rule create. 2. What is the solution to the problem? adds additional check of such duplicated rules. 3. What the features to be implemented in the Tricircle to realize the solution? No new features. Change-Id: I7d208aeb6926877b944e114e2c714986ea46c683 --- tricircle/tests/unit/network/test_qos.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tricircle/tests/unit/network/test_qos.py b/tricircle/tests/unit/network/test_qos.py index 97214c20..1ded9bbb 100644 --- a/tricircle/tests/unit/network/test_qos.py +++ b/tricircle/tests/unit/network/test_qos.py @@ -140,20 +140,17 @@ class TricircleQosTestMixin(object): pod_id, project_id, constants.RT_QOS) rule_data = { - "bandwidth_limit_rule": { - "max_kbps": "10000", - "max_burst_kbps": "20000" + "minimum_bandwidth_rule": { + "min_kbps": "1000" } } t_rule = plugin.create_policy_rule( - q_ctx, rule.QosBandwidthLimitRule, res['id'], rule_data) + q_ctx, rule.QosMinimumBandwidthRule, res['id'], rule_data) - self.assertEqual(2, len(bottom_policy[0]['rules'])) + self.assertEqual(1, len(bottom_policy[0]['rules'])) b_rule = bottom_policy[0]['rules'][0] self.assertEqual(b_policy_id, b_rule['qos_policy_id']) - b_rule = bottom_policy[0]['rules'][1] - self.assertEqual(b_policy_id, b_rule['qos_policy_id']) def _test_delete_policy_rule(self, plugin, q_ctx, t_ctx, pod_id, bottom_policy):