def test_list_private_flavor_info(self): novautils.create_flavor(self.nova_cloud_client, self.LAST_FLAVOR_NAME, self.FLAVOR_RAM, self.FLAVOR_VCPUS, self.FLAVOR_DISK, self.LAST_FLAVOR_ID, public=False) #The cloud admin gives access novautils.add_flavor_tenant_access(self.nova_cloud_client, self.LAST_FLAVOR_ID, self.PROJECT_ID) novautils.list_flavor_tenant_access(self.nova_cloud_client, flavor=self.LAST_FLAVOR_ID) # A project admin can list novautils.list_flavor_tenant_access(self.nova_project_admin_client, flavor=self.LAST_FLAVOR_ID) # A member from the project cannot list self.assertAnyRaise(lambda: novautils.list_flavor_tenant_access( self.nova_member_client, flavor=self.LAST_FLAVOR_ID)) novautils.delete_flavor(self.nova_cloud_client, self.LAST_FLAVOR_ID)
def test_list_private_flavor_info(self): novautils.create_flavor(self.nova_cloud_client, self.LAST_FLAVOR_NAME, self.FLAVOR_RAM, self.FLAVOR_VCPUS, self.FLAVOR_DISK, self.LAST_FLAVOR_ID, public=False) #The cloud admin gives access novautils.add_flavor_tenant_access(self.nova_cloud_client, self.LAST_FLAVOR_ID, self.PROJECT_ID) novautils.list_flavor_tenant_access(self.nova_cloud_client, flavor=self.LAST_FLAVOR_ID) # A project admin can list novautils.list_flavor_tenant_access(self.nova_project_admin_client, flavor=self.LAST_FLAVOR_ID) # A member from the project cannot list self.assertAnyRaise(lambda: novautils.list_flavor_tenant_access(self.nova_member_client, flavor=self.LAST_FLAVOR_ID)) novautils.delete_flavor(self.nova_cloud_client, self.LAST_FLAVOR_ID)
def test_add_access_private_flavor(self): novautils.create_flavor(self.nova_cloud_client, self.OTHER_FLAVOR_NAME, self.FLAVOR_RAM, self.FLAVOR_VCPUS, self.FLAVOR_DISK, self.LAST_FLAVOR_ID, public=False) #The project admin can give access novautils.add_flavor_tenant_access(self.nova_project_admin_client, self.LAST_FLAVOR_ID, self.PROJECT_ID) novautils.list_flavor_tenant_access(self.nova_cloud_client, flavor=self.LAST_FLAVOR_ID) #The project member can't give access self.assertAnyRaise(lambda: novautils.add_flavor_tenant_access( self.nova_member_client, self.LAST_FLAVOR_ID, self.PROJECT_ID)) self.assertAnyRaise(lambda: novautils.get_flavor( self.other_nova_member_client, self.LAST_FLAVOR_ID)) novautils.get_flavor(self.nova_member_client, self.LAST_FLAVOR_ID) novautils.delete_flavor(self.nova_cloud_client, self.LAST_FLAVOR_ID)
def test_add_access_private_flavor(self): novautils.create_flavor(self.nova_cloud_client, self.OTHER_FLAVOR_NAME, self.FLAVOR_RAM, self.FLAVOR_VCPUS, self.FLAVOR_DISK, self.LAST_FLAVOR_ID, public=False) #The project admin can give access novautils.add_flavor_tenant_access(self.nova_project_admin_client, self.LAST_FLAVOR_ID, self.PROJECT_ID) novautils.list_flavor_tenant_access(self.nova_cloud_client, flavor=self.LAST_FLAVOR_ID) #The project member can't give access self.assertAnyRaise(lambda: novautils.add_flavor_tenant_access(self.nova_member_client, self.LAST_FLAVOR_ID, self.PROJECT_ID)) self.assertAnyRaise(lambda: novautils.get_flavor(self.other_nova_member_client, self.LAST_FLAVOR_ID)) novautils.get_flavor(self.nova_member_client, self.LAST_FLAVOR_ID) novautils.delete_flavor(self.nova_cloud_client, self.LAST_FLAVOR_ID)