Merge "delete device profile by name"

This commit is contained in:
Zuul 2022-07-02 09:33:40 +00:00 committed by Gerrit Code Review
commit 29c6869b1d

View File

@ -73,6 +73,16 @@ class TestDeviceProfileController(base.BaseAPITest):
device_profile_uuid_list = [it['uuid'] for it in device_profile_list]
self.assertNotIn(device_profile_uuid, device_profile_uuid_list)
def test_delete_device_profile_by_name(self):
dp = cyborg_data.NORMAL_DEVICE_PROFILE_DATA1
response = self.os_admin.cyborg_client.create_device_profile(dp)
self.assertEqual(dp[0]['name'], response['name'])
self.os_admin.cyborg_client.delete_device_profile(dp[0]['name'])
list_resp = self.os_admin.cyborg_client.list_device_profile()
device_profile_list = list_resp['device_profiles']
device_profile_name_list = [it['name'] for it in device_profile_list]
self.assertNotIn(dp[0]['name'], device_profile_name_list)
@classmethod
def resource_cleanup(cls):
super(TestDeviceProfileController, cls).resource_cleanup()