Test current tenant not added to private flavor
Avoid adding the current tenant to the flavor access list when
a private flavor is created. In order to add tenants to the
flavor access list we should use the add_tenant api
Change-Id: Id02f0dea8e19ee7e948d6f08163a2ede96c38dd8
Partial-Bug: #1286297
diff --git a/tempest/api/compute/admin/test_flavors.py b/tempest/api/compute/admin/test_flavors.py
index 05b763a..759585e 100644
--- a/tempest/api/compute/admin/test_flavors.py
+++ b/tempest/api/compute/admin/test_flavors.py
@@ -170,10 +170,12 @@
flag = True
self.assertTrue(flag)
+ @test.skip_because(bug='1286297')
@test.attr(type='gate')
def test_list_non_public_flavor(self):
- # Create a flavor with os-flavor-access:is_public false should
- # be present in list_details.
+ # Create a flavor with os-flavor-access:is_public false.
+ # The flavor should not be present in list_details as the
+ # tenant is not automatically added access list.
# This operation requires the user to have 'admin' role
flavor_name = data_utils.rand_name(self.flavor_name_prefix)
new_flavor_id = data_utils.rand_int_id(start=1000)
@@ -192,7 +194,7 @@
for flavor in flavors:
if flavor['name'] == flavor_name:
flag = True
- self.assertTrue(flag)
+ self.assertFalse(flag)
# Verify flavor is not retrieved with other user
flag = False
diff --git a/tempest/api/compute/admin/test_flavors_access.py b/tempest/api/compute/admin/test_flavors_access.py
index 4804ce4..aa0138f 100644
--- a/tempest/api/compute/admin/test_flavors_access.py
+++ b/tempest/api/compute/admin/test_flavors_access.py
@@ -46,9 +46,11 @@
cls.vcpus = 1
cls.disk = 10
+ @test.skip_because(bug='1286297')
@test.attr(type='gate')
def test_flavor_access_list_with_private_flavor(self):
- # Test to list flavor access successfully by querying private flavor
+ # Test to make sure that list flavor access on a newly created
+ # private flavor will return an empty access list
flavor_name = data_utils.rand_name(self.flavor_name_prefix)
new_flavor_id = data_utils.rand_int_id(start=1000)
resp, new_flavor = self.client.create_flavor(flavor_name,
@@ -60,10 +62,7 @@
self.assertEqual(resp.status, 200)
resp, flavor_access = self.client.list_flavor_access(new_flavor_id)
self.assertEqual(resp.status, 200)
- self.assertEqual(len(flavor_access), 1, str(flavor_access))
- first_flavor = flavor_access[0]
- self.assertEqual(str(new_flavor_id), str(first_flavor['flavor_id']))
- self.assertEqual(self.adm_tenant_id, first_flavor['tenant_id'])
+ self.assertEqual(len(flavor_access), 0, str(flavor_access))
@test.attr(type='gate')
def test_flavor_access_add_remove(self):