def test_positive_update_name(self): """Check if content host name can be updated @id: 056fff14-e9ea-407e-8340-1d5b5da1e4e4 @Assert: Content host is created and name is updated @BZ: 1318686, 1338780 """ new_system = make_content_host({ u'content-view-id': self.DEFAULT_CV['id'], u'lifecycle-environment-id': self.LIBRARY['id'], u'organization-id': self.NEW_ORG['id'], }) for new_name in valid_hosts_list(): with self.subTest(new_name): ContentHost.update({ u'id': new_system['id'], u'new-name': new_name, }) result = ContentHost.info({'id': new_system['id']}) self.assertEqual(result['name'], new_name)
def test_positive_update_1(self, test_data): """@Test: Check if content host name can be updated @Feature: Content Hosts @Assert: Content host is created and name is updated """ new_system = None try: new_system = make_content_host({ u'organization-id': self.NEW_ORG['id'], u'content-view-id': self.DEFAULT_CV['id'], u'lifecycle-environment-id': self.LIBRARY['id']}) except CLIFactoryError as err: self.fail(err) # Assert that name does not matches data passed self.assertNotEqual( new_system['name'], test_data['name'], "Names should not match" ) # Update system group result = ContentHost.update({ u'id': new_system['id'], u'name': test_data['name']}) self.assertEqual( result.return_code, 0, "Content host was not updated") self.assertEqual( len(result.stderr), 0, "No error was expected") # Fetch it result = ContentHost.info({ u'id': new_system['id']}) self.assertEqual( result.return_code, 0, "Content host was not updated") self.assertEqual( len(result.stderr), 0, "No error was expected") # Assert that name matches new value self.assertIsNotNone( result.stdout.get('name', None), "The name field was not returned" ) self.assertEqual( result.stdout['name'], test_data['name'], "Names should match" ) # Assert that name does not match original value self.assertNotEqual( new_system['name'], result.stdout['name'], "Names should not match" )
def test_positive_update_2(self, test_data): """@Test: Check if content host description can be updated @Feature: Content Hosts @Assert: Content host is created and description is updated @BZ: 1082157 """ new_system = make_content_host({ u'organization-id': self.NEW_ORG['id'], u'content-view-id': self.DEFAULT_CV['id'], u'lifecycle-environment-id': self.LIBRARY['id']}) # Assert that description does not match data passed self.assertNotEqual( new_system['description'], test_data['description'], "Descriptions should not match" ) # Update sync plan result = ContentHost.update({ u'id': new_system['id'], u'description': test_data['description']}) self.assertEqual( result.return_code, 0, "Content host was not updated") self.assertEqual( len(result.stderr), 0, "No error was expected") # Fetch it result = ContentHost.info({ u'id': new_system['id']}) self.assertEqual( result.return_code, 0, "Content host was not updated") self.assertEqual( len(result.stderr), 0, "No error was expected") # Assert that description matches new value self.assertIsNotNone( result.stdout.get('description', None), "The description field was not returned" ) self.assertEqual( result.stdout['description'], test_data['description'], "Descriptions should match" ) # Assert that description does not matches original value self.assertNotEqual( new_system['description'], result.stdout['description'], "Descriptions should not match" )
def test_positive_update_2(self, test_data): """ @Test: Check if content host description can be updated @Feature: Content Hosts @Assert: Content host is created and description is updated @BZ: 1082157 """ new_system = make_content_host({ u'organization-id': self.NEW_ORG['id'], u'content-view-id': self.DEFAULT_CV['id'], u'environment-id': self.LIBRARY['id']}) # Assert that description does not match data passed self.assertNotEqual( new_system['description'], test_data['description'], "Descriptions should not match" ) # Update sync plan result = ContentHost.update({ u'id': new_system['id'], u'description': test_data['description']}) self.assertEqual( result.return_code, 0, "Content host was not updated") self.assertEqual( len(result.stderr), 0, "No error was expected") # Fetch it result = ContentHost.info({ u'id': new_system['id']}) self.assertEqual( result.return_code, 0, "Content host was not updated") self.assertEqual( len(result.stderr), 0, "No error was expected") # Assert that description matches new value self.assertIsNotNone( result.stdout.get('description', None), "The description field was not returned" ) self.assertEqual( result.stdout['description'], test_data['description'], "Descriptions should match" ) # Assert that description does not matches original value self.assertNotEqual( new_system['description'], result.stdout['description'], "Descriptions should not match" )
def test_positive_update_1(self, test_data): """ @Test: Check if content host name can be updated @Feature: Content Hosts @Assert: Content host is created and name is updated """ new_system = make_content_host({ u'organization-id': self.NEW_ORG['id'], u'content-view-id': self.DEFAULT_CV['id'], u'environment-id': self.LIBRARY['id']}) # Assert that name does not matches data passed self.assertNotEqual( new_system['name'], test_data['name'], "Names should not match" ) # Update system group result = ContentHost.update({ u'id': new_system['id'], u'name': test_data['name']}) self.assertEqual( result.return_code, 0, "Content host was not updated") self.assertEqual( len(result.stderr), 0, "No error was expected") # Fetch it result = ContentHost.info({ u'id': new_system['id']}) self.assertEqual( result.return_code, 0, "Content host was not updated") self.assertEqual( len(result.stderr), 0, "No error was expected") # Assert that name matches new value self.assertIsNotNone( result.stdout.get('name', None), "The name field was not returned" ) self.assertEqual( result.stdout['name'], test_data['name'], "Names should match" ) # Assert that name does not match original value self.assertNotEqual( new_system['name'], result.stdout['name'], "Names should not match" )
def test_positive_update_description(self): """Check if content host description can be updated @Feature: Content Hosts @Assert: Content host is created and description is updated """ new_system = make_content_host( { u"content-view-id": self.DEFAULT_CV["id"], u"lifecycle-environment-id": self.LIBRARY["id"], u"organization-id": self.NEW_ORG["id"], } ) for new_desc in generate_strings_list(): with self.subTest(new_desc): ContentHost.update({u"id": new_system["id"], u"description": new_desc}) result = ContentHost.info({"id": new_system["id"]}) self.assertEqual(result["description"], new_desc)
def test_positive_update_description(self): """Check if content host description can be updated @Feature: Content Hosts @Assert: Content host is created and description is updated """ new_system = make_content_host({ u'content-view-id': self.DEFAULT_CV['id'], u'lifecycle-environment-id': self.LIBRARY['id'], u'organization-id': self.NEW_ORG['id'], }) for new_desc in generate_strings_list(): with self.subTest(new_desc): ContentHost.update({ u'id': new_system['id'], u'description': new_desc, }) result = ContentHost.info({'id': new_system['id']}) self.assertEqual(result['description'], new_desc)
def test_positive_update_name(self): """Check if content host name can be updated @Feature: Content Hosts @Assert: Content host is created and name is updated """ new_system = make_content_host({ u'content-view-id': self.DEFAULT_CV['id'], u'lifecycle-environment-id': self.LIBRARY['id'], u'organization-id': self.NEW_ORG['id'], }) for new_name in generate_strings_list(): with self.subTest(new_name): ContentHost.update({ u'id': new_system['id'], u'name': new_name, }) result = ContentHost.info({'id': new_system['id']}) self.assertEqual(result['name'], new_name)
def test_positive_update_name(self): """Check if content host name can be updated @id: 056fff14-e9ea-407e-8340-1d5b5da1e4e4 @Assert: Content host is created and name is updated @BZ: 1318686, 1338780 """ new_system = make_content_host({ u'content-view-id': self.DEFAULT_CV['id'], u'lifecycle-environment-id': self.LIBRARY['id'], u'organization-id': self.NEW_ORG['id'], }) for new_name in valid_hosts_list(): with self.subTest(new_name): ContentHost.update({ u'id': new_system['id'], u'new-name': new_name, }) result = ContentHost.info({'id': new_system['id']}) self.assertEqual(result['name'], new_name)