commit | 52e6cb7d6a9d328772c2effbf34f2d1523bb0d4d | [log] [tgz] |
---|---|---|
author | Maor Blaustein <blue@redhat.com> | Sun May 12 15:29:46 2024 +0300 |
committer | Maor Blaustein <blue@redhat.com> | Thu May 16 14:44:39 2024 +0300 |
tree | e954a3fe26d56cba000e36ff5860ebad4e6a8a68 | |
parent | 17e95518ead3e0787e1bfc77764252c4307109bd [diff] |
Negative test: set quota lower than resource count Verifies feature [1] original reproducer steps. [1] https://bugs.launchpad.net/neutron/+bug/1936408 Depends-On: https://review.opendev.org/c/openstack/neutron/+/801470 Depends-On: https://review.opendev.org/c/openstack/neutron-tempest-plugin/+/919443 Related-Bug: #1936408 Change-Id: Ifbdaf545eff6b13da199716ba0c91ebd35ec2a19
diff --git a/neutron_tempest_plugin/api/admin/test_quotas_negative.py b/neutron_tempest_plugin/api/admin/test_quotas_negative.py index 9c37d92..2a8e24d 100644 --- a/neutron_tempest_plugin/api/admin/test_quotas_negative.py +++ b/neutron_tempest_plugin/api/admin/test_quotas_negative.py
@@ -39,6 +39,23 @@ self.admin_client.create_network, **net_args) @decorators.attr(type='negative') + @decorators.idempotent_id('9f676a6e-d729-428b-adcd-4de2867c50e6') + def test_set_network_quota_lower_than_networks_amount(self): + tenant_id = self.create_project()['id'] + high_quota = 3 + low_quota = 1 + new_quotas = {'network': high_quota} + self._setup_quotas(tenant_id, **new_quotas) + for _ in range(high_quota - 1): + self._create_network(tenant_id) + # TODO(mblue): remove check_limit=True when it is default + new_quotas.update({'network': low_quota, 'check_limit': True}) + + self.assertRaises(lib_exc.BadRequest, + self.admin_client.update_quotas, + tenant_id, **new_quotas) + + @decorators.attr(type='negative') @decorators.idempotent_id('0b7f99e3-9f77-45ce-9a89-b39a184de618') def test_create_subnet_when_quotas_is_full(self): tenant_id = self.create_project()['id']