Set SG quota for specific project.

project_id was initialized too early.
It was None. The same for tenant_id.
That's why unlimited SG quota was set for
"some default project".
But the project in test had default quota(10).
If test class created more 10 SG then arised exception
"OverQuota".
Also SG quota for default project was reset to default value in cleanup.
It could harm another tests which were launched in parallel.

Closes-Bug: 1895876
Closes-Bug: 1810963
Change-Id: If7f3789b2791be08088588619f3a1629aeecbda4
This commit is contained in:
Mitya_Eremeev 2021-11-23 17:47:21 +03:00 committed by mitya-eremeev-2
parent 0c69ec5bd7
commit e01cd53d6c

View File

@ -71,9 +71,13 @@ class NetworkSecGroupTest(base.BaseTempestTestCase):
@classmethod
def setup_credentials(cls):
super(NetworkSecGroupTest, cls).setup_credentials()
cls.project_id = cls.os_primary.credentials.tenant_id
cls.network_client = cls.os_admin.network_client
@classmethod
def setup_clients(cls):
super(NetworkSecGroupTest, cls).setup_clients()
cls.project_id = cls.os_primary.credentials.tenant_id
@classmethod
def resource_setup(cls):
super(NetworkSecGroupTest, cls).resource_setup()