From 7fbea90e365ddbd78001cc5ee8c46506fbd4b719 Mon Sep 17 00:00:00 2001 From: Maor Blaustein Date: Wed, 28 Apr 2021 22:37:22 +0300 Subject: [PATCH] Add QoS negative test, test_rule_create_rule_non_existent_policy The negative test tries to create a rule using non existing QoS policy name. Change-Id: I0e989173ca45a0454ba65518dd3f7b0051a95439 --- neutron_tempest_plugin/api/test_qos_negative.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/neutron_tempest_plugin/api/test_qos_negative.py b/neutron_tempest_plugin/api/test_qos_negative.py index f6c4afc29..f4d663610 100644 --- a/neutron_tempest_plugin/api/test_qos_negative.py +++ b/neutron_tempest_plugin/api/test_qos_negative.py @@ -109,6 +109,15 @@ class QosBandwidthLimitRuleNegativeTestJSON(base.BaseAdminNetworkTest): self.admin_client.update_bandwidth_limit_rule, non_exist_id, rule['id'], max_kbps=200, max_burst_kbps=1337) + @decorators.attr(type='negative') + @decorators.idempotent_id('1b592566-745f-4e15-a439-073afe341244') + def test_rule_create_rule_non_existent_policy(self): + non_exist_id = data_utils.rand_name('qos_policy') + self.assertRaises( + lib_exc.NotFound, + self.admin_client.create_bandwidth_limit_rule, + non_exist_id, max_kbps=200, max_burst_kbps=300) + @decorators.attr(type='negative') @decorators.idempotent_id('a2c72066-0c32-4f28-be7f-78fa721588b6') def test_rule_update_rule_nonexistent_rule(self):