Merge "Update rbac tests"
diff --git a/barbican_tempest_plugin/tests/rbac/v1/test_quotas.py b/barbican_tempest_plugin/tests/rbac/v1/test_quotas.py
index 16edc18..ffabc1e 100644
--- a/barbican_tempest_plugin/tests/rbac/v1/test_quotas.py
+++ b/barbican_tempest_plugin/tests/rbac/v1/test_quotas.py
@@ -193,3 +193,89 @@
def setup_clients(cls):
super().setup_clients()
cls.client = cls.os_project_admin.secret_v1.QuotaClient()
+
+ def test_list_project_quotas(self):
+ quotas = self.client.list_quotas()
+ self.assertIn("project_quotas", quotas)
+
+ def test_get_custom_quota_for_project(self):
+ project_id = self.client.tenant_id
+ self.client.create_project_quota(
+ project_id,
+ project_quotas={
+ "secrets": 1000,
+ "orders": 1000,
+ "containers": 1000
+ })
+ quota = self.client.get_project_quota(project_id)
+ self.assertIn("project_quotas", quota)
+
+ def test_set_new_quota_for_project(self):
+ project_id = self.client.tenant_id
+ self.client.create_project_quota(
+ project_id,
+ project_quotas={
+ "secrets": 1000,
+ "orders": 1000,
+ "containers": 1000
+ })
+ quota = self.client.get_project_quota(project_id)
+ self.assertIn("project_quotas", quota)
+
+ def test_remove_custom_quota_for_project(self):
+ project_id = self.client.tenant_id
+ self.client.create_project_quota(
+ project_id,
+ project_quotas={
+ "secrets": 1000,
+ "orders": 1000,
+ "containers": 1000
+ })
+ quota = self.client.get_project_quota(project_id)
+ self.assertIn("project_quotas", quota)
+ self.client.delete_project_quota(project_id)
+ self.assertRaises(
+ exceptions.NotFound,
+ self.client.get_project_quota,
+ project_id)
+
+ def test_get_custom_quota_for_other_project(self):
+ project_id = self.other_secret_client.tenant_id
+ self.client.create_project_quota(
+ project_id,
+ project_quotas={
+ "secrets": 1000,
+ "orders": 1000,
+ "containers": 1000
+ })
+ quota = self.client.get_project_quota(project_id)
+ self.assertIn("project_quotas", quota)
+
+ def test_set_new_quota_for_other_project(self):
+ project_id = self.other_secret_client.tenant_id
+ self.client.create_project_quota(
+ project_id,
+ project_quotas={
+ "secrets": 1000,
+ "orders": 1000,
+ "containers": 1000
+ })
+ quota = self.client.get_project_quota(project_id)
+ self.assertIn("project_quotas", quota)
+
+ def test_remove_custom_quota_for_other_project(self):
+ project_id = self.other_secret_client.tenant_id
+ self.client.create_project_quota(
+ project_id,
+ project_quotas={
+ "secrets": 1000,
+ "orders": 1000,
+ "containers": 1000
+ })
+ quota = self.client.get_project_quota(project_id)
+ self.assertIn("project_quotas", quota)
+ self.client.delete_project_quota(project_id)
+ self.assertRaises(
+ exceptions.NotFound,
+ self.client.get_project_quota,
+ project_id)
diff --git a/barbican_tempest_plugin/tests/rbac/v1/test_transport_keys.py b/barbican_tempest_plugin/tests/rbac/v1/test_transport_keys.py
index 1984943..fa142f1 100644
--- a/barbican_tempest_plugin/tests/rbac/v1/test_transport_keys.py
+++ b/barbican_tempest_plugin/tests/rbac/v1/test_transport_keys.py
@@ -112,6 +112,13 @@
super().setup_clients()
cls.client = cls.os_project_admin.secret_v1.TransportKeyClient()
+ def test_create_transport_key(self):
+ transport_key = self.client.create_transport_key(
+ plugin_name="simple-crypto",
+ transport_key="UUUU-UUUU-IIII-DDDD"
+ )
+ self.assertIn("transport_key_ref", transport_key)
+
class ProjectReaderTests(ProjectMemberTests):