Remove the device_profile test case

In [1], we modified the cyborg device_profile API, changed it's
response body, it was broken the API without microversion added,
so we should revert this change, and need to remove this test case.

[1] https://review.opendev.org/c/openstack/cyborg/+/751988

Co-Authored-By: Brin Zhang <zhangbailin@inspur.com>

Change-Id: I33a6a205ed878f93398891e84c2086169b72835f
This commit is contained in:
songwenping 2021-04-02 02:43:37 +00:00 committed by Brin Zhang
parent 273a2e998d
commit 68c4862b48

View File

@ -36,37 +36,41 @@ class TestDeviceProfileController(base.BaseAPITest):
self.os_admin.cyborg_client.delete_multiple_device_profile_by_names(
dp_one[0]['name'], dp_two[0]['name'])
def test_get_and_delete_device_profile(self):
# Removing the residual resources if it exists in the env
list_resp = self.os_admin.cyborg_client.list_device_profile()
if len(list_resp['device_profiles']) >= 1:
self.os_admin.cyborg_client.delete_device_profile_by_uuid(
list_resp['device_profiles'][0]['uuid'])
# TODO(brinzhang): After backport
# https://review.opendev.org/c/openstack/cyborg/+/784521, we will modify
# this test case.
dp = cyborg_data.NORMAL_DEVICE_PROFILE_DATA1
create_resp = self.os_admin.cyborg_client.create_device_profile(dp)
device_profile_uuid = create_resp['uuid']
self.assertEqual(dp[0]['name'], create_resp['name'])
self.assertEqual(dp[0]['groups'], create_resp['groups'])
# def test_get_and_delete_device_profile(self):
# # Removing the residual resources if it exists in the env
# list_resp = self.os_admin.cyborg_client.list_device_profile()
# if len(list_resp['device_profiles']) >= 1:
# self.os_admin.cyborg_client.delete_device_profile_by_uuid(
# list_resp['device_profiles'][0]['uuid'])
list_resp = self.os_admin.cyborg_client.list_device_profile()
device_profile_list = list_resp['device_profiles']
device_profile_uuid_list = [it['uuid'] for it in device_profile_list]
self.assertIn(device_profile_uuid, device_profile_uuid_list)
# dp = cyborg_data.NORMAL_DEVICE_PROFILE_DATA1
# create_resp = self.os_admin.cyborg_client.create_device_profile(dp)
# device_profile_uuid = create_resp['uuid']
# self.assertEqual(dp[0]['name'], create_resp['name'])
# self.assertEqual(dp[0]['groups'], create_resp['groups'])
get_resp = self.os_admin.cyborg_client.get_device_profile(
device_profile_uuid)
self.assertEqual(dp[0]['name'], get_resp['name'])
self.assertEqual(
device_profile_uuid,
get_resp['uuid'])
# list_resp = self.os_admin.cyborg_client.list_device_profile()
# device_profile_list = list_resp['device_profiles']
# device_profile_uuid_list = [it['uuid'] for it in device_profile_list]
# self.assertIn(device_profile_uuid, device_profile_uuid_list)
self.os_admin.cyborg_client.delete_device_profile_by_uuid(
device_profile_uuid)
list_resp = self.os_admin.cyborg_client.list_device_profile()
device_profile_list = list_resp['device_profiles']
device_profile_uuid_list = [it['uuid'] for it in device_profile_list]
self.assertNotIn(device_profile_uuid, device_profile_uuid_list)
# get_resp = self.os_admin.cyborg_client.get_device_profile(
# device_profile_uuid)
# self.assertEqual(dp[0]['name'], get_resp['name'])
# self.assertEqual(
# device_profile_uuid,
# get_resp['uuid'])
# self.os_admin.cyborg_client.delete_device_profile_by_uuid(
# device_profile_uuid)
# list_resp = self.os_admin.cyborg_client.list_device_profile()
# device_profile_list = list_resp['device_profiles']
# device_profile_uuid_list = [it['uuid'] for it in device_profile_list]
# self.assertNotIn(device_profile_uuid, device_profile_uuid_list)
@classmethod
def resource_cleanup(cls):