def test_positive_add_image_rhev_with_name(self): """Add images to the RHEV compute resource :id: 2da84165-a56f-4282-9343-94828fa69c13 :setup: Images/templates should be present in RHEV-M itself, so that satellite can use them. :steps: 1. Create a compute resource of type rhev. 2. Create a image for the compute resource with valid parameter, compute-resource image create :expectedresults: The image is added to the CR successfully """ if self.image_uuid is None: self.skipTest('Missing configuration for rhev.image_uuid') comp_res = make_compute_resource({ 'provider': 'Ovirt', 'user': self.username, 'password': self.password, 'datacenter': self.datacenter, 'url': self.current_rhev_url, }) self.assertTrue(comp_res['name']) ComputeResource.image_create({ 'compute-resource': comp_res['name'], 'name': 'img {}'.format(gen_string(str_type='alpha')), 'uuid': self.image_uuid, 'operatingsystem': self.os['title'], 'architecture': self.image_arch, 'username': "******", }) result = ComputeResource.image_list( {'compute-resource': comp_res['name']}) self.assertEqual(result[0]['uuid'], self.image_uuid)
def test_positive_add_image_rhev_with_name(rhev, module_os): """Add images to the RHEV compute resource :id: 2da84165-a56f-4282-9343-94828fa69c13 :setup: Images/templates should be present in RHEV-M itself, so that satellite can use them. :steps: 1. Create a compute resource of type rhev. 2. Create a image for the compute resource with valid parameter, compute-resource image create :expectedresults: The image is added to the CR successfully """ if rhev.image_uuid is None: pytest.skip('Missing configuration for rhev.image_uuid') comp_res = make_compute_resource( { 'provider': 'Ovirt', 'user': rhev.username, 'password': rhev.password, 'datacenter': rhev.datacenter, 'url': rhev.hostname, } ) assert comp_res['name'] ComputeResource.image_create( { 'compute-resource': comp_res['name'], 'name': f'img {gen_string(str_type="alpha")}', 'uuid': rhev.image_uuid, 'operatingsystem': module_os.title, 'architecture': rhev.image_arch, 'username': "******", } ) result = ComputeResource.image_list({'compute-resource': comp_res['name']}) assert result[0]['uuid'] == rhev.image_uuid
def test_positive_image_crud(self, default_architecture, module_azurerm_cr, default_os, image): """ Finish template/Cloud_init image along with username is being Create, Read, Update and Delete in AzureRm compute resources :id: e4f40640-46dd-4ef8-8be5-99c625056aff :parametrized: yes :steps: 1. Create an AzureRm Compute Resource. 2. Create a finish template/Cloud_init based image in it. 3. List/info the created image 4. Update image name and username 5. Delete created image :expectedresults: Finish template/Cloud_init image should be created, list, updated and deleted in AzureRm CR along with username :CaseImportance: Critical :CaseLevel: Integration """ # Create img_name = gen_string('alpha') username = gen_string('alpha') img_ft = ComputeResource.image_create( { 'name': img_name, 'operatingsystem-id': default_os.id, 'architecture-id': default_architecture.id, 'uuid': image, 'compute-resource': module_azurerm_cr.name, 'username': username, 'user-data': 'no', } )[0] assert img_ft['message'] == 'Image created.' assert img_ft['name'] == img_name # Info Image img_info = ComputeResource.image_info( {'name': img_name, 'compute-resource': module_azurerm_cr.name} )[0] assert img_info['operating-system'] == default_os.title assert img_info['username'] == username assert img_info['uuid'] == image assert img_info['user-data'] == 'false' assert img_info['architecture'] == default_architecture.name # List image list_img = ComputeResource.image_list({'compute-resource': module_azurerm_cr.name}) assert len(list_img) == 1 assert list_img[0]['name'] == img_name # Update image new_img_name = gen_string('alpha') new_username = gen_string('alpha') result = ComputeResource.image_update( { 'name': img_name, 'compute-resource': module_azurerm_cr.name, 'new-name': new_img_name, 'username': new_username, } )[0] assert result['message'] == 'Image updated.' assert result['name'] == new_img_name img_info = ComputeResource.image_info( {'name': new_img_name, 'compute-resource': module_azurerm_cr.name} )[0] assert img_info['username'] == new_username # Delete Image result = ComputeResource.image_delete( {'name': new_img_name, 'compute-resource': module_azurerm_cr.name} )[0] assert result['message'] == 'Image deleted.' assert result['name'] == new_img_name