From 68c4862b48f4a7f4d9f41ee2815bd3bfc5f2470f Mon Sep 17 00:00:00 2001 From: songwenping Date: Fri, 2 Apr 2021 02:43:37 +0000 Subject: [PATCH] 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 Change-Id: I33a6a205ed878f93398891e84c2086169b72835f --- .../tests/api/test_device_profile.py | 58 ++++++++++--------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/cyborg_tempest_plugin/tests/api/test_device_profile.py b/cyborg_tempest_plugin/tests/api/test_device_profile.py index 8c98d5d..c03869e 100644 --- a/cyborg_tempest_plugin/tests/api/test_device_profile.py +++ b/cyborg_tempest_plugin/tests/api/test_device_profile.py @@ -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):