def test_positive_update_1(self, test_data): """ @test: Positive update of system name @feature: Operating System - Positive Update @assert: Operating System is updated and can be found """ # "Unpacks" values from tuple orig_dict, updates_dict = test_data # Create a new object passing @test_data to factory method new_obj = make_os(orig_dict) result = OperatingSys.info({'id': new_obj['id']}) self.assertEqual(result.return_code, 0, "Failed to create object") self.assertEqual( len(result.stderr), 0, "There should not be an exception here") # Update original test_data with new values updates_dict['id'] = new_obj['id'] orig_dict.update(updates_dict) # Now update the Foreman object result = OperatingSys.update(orig_dict) self.assertEqual(result.return_code, 0, "Failed to update object") self.assertEqual( len(result.stderr), 0, "There should not be an exception here") result = OperatingSys.info({'id': new_obj['id']}) # Verify that standard values are correct self.assertEqual( new_obj['id'], result.stdout['id'], "IDs should match") self.assertNotEqual(result.stdout['name'], new_obj['name']) # There should be some attributes changed now self.assertNotEqual(new_obj, result.stdout, "Object should be updated")
def test_positive_delete_1(self, test_data): """@test: Successfully deletes Operating System @feature: Operating System - Positive Delete @assert: Operating System is deleted """ # Create a new object passing @test_data to factory method new_obj = make_os(test_data) result = OperatingSys.info({'id': new_obj['id']}) self.assertEqual(result.return_code, 0, "Failed to create object") self.assertEqual( len(result.stderr), 0, "There should not be an exception here") # Now delete it... result = OperatingSys.delete( {'id': new_obj['id']}) self.assertEqual(result.return_code, 0, "Failed to delete object") self.assertEqual(len(result.stderr), 0, "Should not get an error.") # ... and make sure it does not exist anymore result = OperatingSys.info({'id': new_obj['id']}) self.assertNotEqual( result.return_code, 0, "Return code should not be zero") self.assertGreater( len(result.stderr), 0, "Should have gotten an error") self.assertEqual(result.stdout, {}, "Should not get any output")
def test_negative_delete_1(self, test_data): """@test: Not delete Operating System for invalid data @feature: Operating System - Negative Delete @assert: Operating System is not deleted """ # Create a new object using default values new_obj = make_os() result = OperatingSys.info({'id': new_obj['id']}) self.assertEqual(result.return_code, 0, "Failed to create object") self.assertEqual( len(result.stderr), 0, "There should not be an exception here") # The delete method requires the ID which we will not pass result = OperatingSys.delete(test_data) self.assertNotEqual(result.return_code, 0, "Should not delete object") self.assertGreater( len(result.stderr), 0, "Should have gotten an error") # Now make sure that it still exists result = OperatingSys.info({'id': new_obj['id']}) self.assertTrue(result.return_code == 0, "Failed to find object") self.assertEqual(new_obj['id'], result.stdout['id']) self.assertEqual(new_obj['name'], result.stdout['name'])
def test_positive_delete_by_id(self): """Successfully deletes Operating System by its ID @id: a67a7b01-081b-42f8-a9ab-1f41166d649e @assert: Operating System is deleted """ for name in valid_data_list(): with self.subTest(name): os = make_os({'name': name}) OperatingSys.delete({'id': os['id']}) with self.assertRaises(CLIReturnCodeError): OperatingSys.info({'id': os['id']})
def test_positive_delete_by_id(self): """@test: Successfully deletes Operating System by its ID @feature: Operating System @assert: Operating System is deleted """ for name in valid_data_list(): with self.subTest(name): os = make_os({'name': name}) OperatingSys.delete({'id': os['id']}) with self.assertRaises(CLIReturnCodeError): OperatingSys.info({'id': os['id']})
def test_add_ptable(self): """@test: Add ptable to os @feature: Operating System - Add ptable @assert: Operating System is updated with ptable """ ptable_obj = make_partition_table() result = PartitionTable.info({'id': ptable_obj['id']}) self.assertEqual(result.return_code, 0) self.assertEqual(len(result.stderr), 0) self.assertEqual(ptable_obj['name'], result.stdout['name']) new_obj = make_os() result = OperatingSys.add_ptable({'id': new_obj['id'], 'ptable': ptable_obj['name']}) self.assertEqual(result.return_code, 0, "Failed to add ptable") self.assertEqual( len(result.stderr), 0, "Should not have gotten an error") result = OperatingSys.info({'id': new_obj['id']}) self.assertEqual(result.return_code, 0, "Failed to find object") self.assertEqual(len(result.stdout['partition-tables']), 1) self.assertIn(ptable_obj['name'], result.stdout['partition-tables'][0])
def test_add_ptable(self): """@test: Add ptable to os @feature: Operating System - Add ptable @assert: Operating System is updated with ptable """ # Create a partition table. ptable_name = make_partition_table()['name'] # Create an operating system. os_id = make_os()['id'] # Add the partition table to the operating system. response = OperatingSys.add_ptable({ 'id': os_id, 'partition-table': ptable_name, }) self.assertEqual(response.return_code, 0) self.assertEqual(len(response.stderr), 0) # Verify that the operating system has a partition table. response = OperatingSys.info({'id': os_id}) self.assertEqual(len(response.stdout['partition-tables']), 1) self.assertEqual(response.stdout['partition-tables'][0], ptable_name)
def test_bugzilla_1051557(self): """@test: Update an Operating System's major version. @feature: Operating System - Update @assert: Operating System major version is updated """ try: os = make_os() except CLIFactoryError as err: self.fail(err) # New value for major major = int(os['major-version']) + 1 result = OperatingSys.update( {'id': os['id'], 'major': major}) self.assertEqual(result.return_code, 0) self.assertEqual(len(result.stderr), 0) result = OperatingSys.info({ u'id': os['id'], }) self.assertEqual(result.return_code, 0) self.assertEqual(len(result.stderr), 0) self.assertEqual(int(result.stdout['major-version']), major)
def test_negative_update_1(self, test_data): """@test: Negative update of system name @feature: Operating System - Negative Update @assert: Operating System is not updated """ # "Unpacks" values from tuple orig_dict, updates_dict = test_data # Create a new object passing @test_data to factory method new_obj = make_os(orig_dict) # Update original data with new values updates_dict['id'] = new_obj['id'] orig_dict.update(updates_dict) # Now update the Foreman object result = OperatingSys.update(orig_dict) self.assertNotEqual(result.return_code, 0) self.assertGreater(len(result.stderr), 0) # OS should not have changed result = OperatingSys.info({'id': new_obj['id']}) self.assertEqual(result.return_code, 0) self.assertEqual(len(result.stderr), 0) self.assertEqual(new_obj['name'], result.stdout['name'])
def test_add_architecture(self): """@test: Add Architecture to os @feature: Operating System - Add architecture @assert: Operating System is updated with architecture """ a_ob = make_architecture() result = Architecture.info({'id': a_ob['id']}) self.assertEqual(result.return_code, 0, "Failed to create object") self.assertEqual( len(result.stderr), 0, "There should not be an exception here") new_obj = make_os() result = OperatingSys.add_architecture({'id': new_obj['id'], 'architecture-id': a_ob['id']}) self.assertEqual(result.return_code, 0, "Failed to add architecture") self.assertEqual( len(result.stderr), 0, "Should not have gotten an error") result = OperatingSys.info({'id': new_obj['id']}) self.assertEqual(result.return_code, 0, "Failed to find object") self.assertEqual(len(result.stdout['architectures']), 1) self.assertEqual(a_ob['name'], result.stdout['architectures'][0])
def test_add_configtemplate(self): """@test: Add configtemplate to os @feature: Operating System - Add comfigtemplate @assert: Operating System is updated with config template """ conf_obj = make_template() result = Template.info({'id': conf_obj['id']}) self.assertEqual(result.return_code, 0) self.assertEqual(len(result.stderr), 0) self.assertEqual(conf_obj['name'], result.stdout['name']) new_obj = make_os() result = OperatingSys.add_config_template( {'id': new_obj['id'], 'config-template': conf_obj['name']}) self.assertEqual(result.return_code, 0, "Failed to add configtemplate") self.assertEqual( len(result.stderr), 0, "Should not have gotten an error") result = OperatingSys.info({'id': new_obj['id']}) self.assertEqual(result.return_code, 0, "Failed to find object") self.assertEqual(len(result.stdout['templates']), 1) template_name = result.stdout['templates'][0] self.assertTrue(template_name.startswith(conf_obj['name']))
def test_bugzilla_1203457(self): """@test: Create an OS pointing to an arch, medium and partition table. @feature: Operating System - Create @assert: An operating system is created. """ architecture = make_architecture() medium = make_medium() ptable = make_partition_table() operating_system = make_os({ u'architecture-ids': architecture['id'], u'medium-ids': medium['id'], u'partition-table-ids': ptable['id'], }) result = OperatingSys.info({'id': operating_system['id']}) self.assertEqual(result.return_code, 0) stdout = result.stdout for attr in ( 'architectures', 'installation-media', 'partition-tables'): self.assertEqual(len(stdout[attr]), 1) self.assertEqual(stdout['architectures'][0], architecture['name']) self.assertEqual(stdout['installation-media'][0], medium['name']) self.assertEqual(stdout['partition-tables'][0], ptable['name'])
def test_bugzilla_1051557(self): """@test: Update an Operating System's major version. @feature: Operating System - Update @assert: Operating System major version is updated @bz: 1021557 """ try: os = make_os() except CLIFactoryError as err: self.fail(err) # New value for major major = int(os['major-version']) + 1 result = OperatingSys.update( {'id': os['id'], 'major': major}) self.assertEqual(result.return_code, 0, 'Failed to update activation key') self.assertEqual(len(result.stderr), 0, 'There should not be an error here') result = OperatingSys.info({ u'id': os['id'], }) self.assertEqual(result.return_code, 0, 'Failed to get info for OS') self.assertEqual(len(result.stderr), 0, 'There should not be an error here') self.assertEqual(int(result.stdout['major-version']), major, 'OS major version was not updated')
def test_bugzilla_1051557(self): """ @test: Update an Operating System's major version. @feature: Operating System - Update @assert: Operating System major version is updated @bz: 1021557 """ new_obj = make_os() os_info = OperatingSys.info({'id': new_obj['id']}) self.assertEqual(new_obj['name'], os_info.stdout['name']) # New value for major major = int(new_obj['major']) + 1 result = OperatingSys.update( {'id': os_info.stdout['id'], 'major': major}) self.assertEqual(result.return_code, 0) result = OperatingSys.info({'id': result.stdout['id']}) self.assertEqual(result.return_code, 0) # this will check the updation of major == 3 self.assertEqual(major, result.stdout['major'])
def test_positive_search_by_title(self): """Search for newly created OS by title @id: a555e848-f1f2-4326-aac6-9de8ff45abee @assert: Operating System is created and listed """ os_list_before = OperatingSys.list() os = make_os() os_list = OperatingSys.list({'search': 'title=\\"%s\\"' % os['title']}) os_info = OperatingSys.info({'id': os_list[0]['id']}) self.assertEqual(os['id'], os_info['id']) os_list_after = OperatingSys.list() self.assertGreater(len(os_list_after), len(os_list_before))
def test_positive_search_by_name(self): """Search for newly created OS by name @id: ff9f667c-97ca-49cd-902b-a9b18b5aa021 @assert: Operating System is created and listed """ os_list_before = OperatingSys.list() os = make_os() os_list = OperatingSys.list({'search': 'name=%s' % os['name']}) os_info = OperatingSys.info({'id': os_list[0]['id']}) self.assertEqual(os['id'], os_info['id']) os_list_after = OperatingSys.list() self.assertGreater(len(os_list_after), len(os_list_before))
def test_positive_info_by_id(self): """Displays info for operating system by its ID @id: b8f23b53-439a-4726-9757-164d99d5ed05 @assert: Operating System is created and can be looked up by its ID """ os = make_os() os_info = OperatingSys.info({'id': os['id']}) # Info does not return major or minor but a concat of name, # major and minor self.assertEqual(os['id'], os_info['id']) self.assertEqual(os['name'], os_info['name']) self.assertEqual(str(os['major-version']), os_info['major-version']) self.assertEqual(str(os['minor-version']), os_info['minor-version'])
def test_positive_list(self): """Displays list for operating system @id: fca309c5-edff-4296-a800-55470669935a @assert: Operating System is created and listed """ os_list_before = OperatingSys.list() name = gen_string('alpha') os = make_os({'name': name}) os_list = OperatingSys.list({'search': 'name=%s' % name}) os_info = OperatingSys.info({'id': os_list[0]['id']}) self.assertEqual(os['id'], os_info['id']) os_list_after = OperatingSys.list() self.assertGreater(len(os_list_after), len(os_list_before))
def test_info_1(self): """ @test: Displays info for operating system @feature: Operating System - Info @assert: Operating System is created and have the correct data """ result = make_os() os_info = OperatingSys.info({'id': result['id']}) # Info does not return major or minor but a concat of name, # major and minor self.assertEqual(result['id'], os_info.stdout['id']) self.assertEqual(result['name'], os_info.stdout['name']) self.assertEqual(str(result['major']), os_info.stdout['major-version']) self.assertEqual(str(result['minor']), os_info.stdout['minor-version'])
def test_positive_add_arch(self): """@test: Add Architecture to operating system @feature: Operating System @assert: Architecture is added to Operating System """ architecture = make_architecture() os = make_os() OperatingSys.add_architecture({ 'architecture-id': architecture['id'], 'id': os['id'], }) os = OperatingSys.info({'id': os['id']}) self.assertEqual(len(os['architectures']), 1) self.assertEqual(architecture['name'], os['architectures'][0])
def test_verify_redmine_4547(self): """@test: Search for newly created OS by name @feature: Operating System - Search @assert: Operating System is created and listed @bz: redmine#4547 """ os_list_before = OperatingSys.list() os = make_os() os_list = OperatingSys.list({'search': 'name=%s' % os['name']}) os_info = OperatingSys.info({'id': os_list[0]['id']}) self.assertEqual(os['id'], os_info['id']) os_list_after = OperatingSys.list() self.assertGreater(len(os_list_after), len(os_list_before))
def test_list_1(self): """@test: Displays list for operating system @feature: Operating System - List @assert: Operating System is created and listed """ os_list_before = OperatingSys.list() name = gen_string('alpha') os = make_os({'name': name}) os_list = OperatingSys.list({'search': 'name=%s' % name}) os_info = OperatingSys.info({'id': os_list[0]['id']}) self.assertEqual(os['id'], os_info['id']) os_list_after = OperatingSys.list() self.assertGreater(len(os_list_after), len(os_list_before))
def test_add_architecture(self): """@test: Add Architecture to os @feature: Operating System - Add architecture @assert: Operating System is updated with architecture """ architecture = make_architecture() os = make_os() OperatingSys.add_architecture({ 'architecture-id': architecture['id'], 'id': os['id'], }) os = OperatingSys.info({'id': os['id']}) self.assertEqual(len(os['architectures']), 1) self.assertEqual(architecture['name'], os['architectures'][0])
def test_negative_delete_by_id(self): """Delete Operating System using invalid data @id: d29a9c95-1fe3-4a7a-9f7b-127be065856d @assert: Operating System is not deleted """ for test_data in negative_delete_data(): with self.subTest(test_data): os = make_os() # The delete method requires the ID which we will not pass with self.assertRaises(CLIReturnCodeError): OperatingSys.delete(test_data) # Now make sure that it still exists result = OperatingSys.info({'id': os['id']}) self.assertEqual(os['id'], result['id']) self.assertEqual(os['name'], result['name'])
def test_positive_update_name(self): """Positive update of operating system name @id: 49b655f7-ba9b-4bb9-b09d-0f7140969a40 @assert: Operating System name is updated """ os = make_os({'name': gen_alphanumeric()}) for new_name in valid_data_list(): with self.subTest(new_name): OperatingSys.update({ 'id': os['id'], 'name': new_name, }) result = OperatingSys.info({'id': os['id']}) self.assertEqual(result['id'], os['id'], ) self.assertNotEqual(result['name'], os['name'])
def test_positive_add_template(self): """@test: Add provisioning template to operating system @feature: Operating System @assert: Provisioning template is added to Operating System """ template = make_template() os = make_os() OperatingSys.add_config_template({ 'config-template': template['name'], 'id': os['id'], }) os = OperatingSys.info({'id': os['id']}) self.assertEqual(len(os['templates']), 1) template_name = os['templates'][0] self.assertTrue(template_name.startswith(template['name']))
def test_negative_update_name(self): """Negative update of system name @id: 4b18ff6d-7728-4245-a1ce-38e62c05f454 @assert: Operating System name is not updated """ os = make_os({'name': gen_alphanumeric()}) for new_name in invalid_values_list(): with self.subTest(new_name): with self.assertRaises(CLIReturnCodeError): OperatingSys.update({ 'id': os['id'], 'name': new_name, }) result = OperatingSys.info({'id': os['id']}) self.assertEqual(result['name'], os['name'])
def test_negative_delete_by_id(self): """@test: Delete Operating System using invalid data @feature: Operating System @assert: Operating System is not deleted """ for test_data in NEGATIVE_DELETE_DATA: with self.subTest(test_data): os = make_os() # The delete method requires the ID which we will not pass with self.assertRaises(CLIReturnCodeError): OperatingSys.delete(test_data) # Now make sure that it still exists result = OperatingSys.info({'id': os['id']}) self.assertEqual(os['id'], result['id']) self.assertEqual(os['name'], result['name'])
def test_positive_update_name(self): """@test: Positive update of operating system name @feature: Operating System @assert: Operating System name is updated """ os = make_os({'name': gen_alphanumeric()}) for new_name in valid_data_list(): with self.subTest(new_name): OperatingSys.update({ 'id': os['id'], 'name': new_name, }) result = OperatingSys.info({'id': os['id']}) self.assertEqual(result['id'], os['id'], ) self.assertNotEqual(result['name'], os['name'])
def test_positive_create_1(self, test_data): """ @test: Create Operating System for all variations of name @feature: Operating System - Positive Create @assert: Operating System is created and can be found """ # Create a new object using factory method new_obj = make_os(test_data) # Can we find the new object? result = OperatingSys.info({'id': new_obj['id']}) self.assertEqual(result.return_code, 0, "Failed to create object") self.assertEqual( len(result.stderr), 0, "There should not be an exception here") self.assertEqual(result.stdout['name'], new_obj['name'])
def test_negative_delete_by_id(self, test_data): """Delete Operating System using invalid data :id: d29a9c95-1fe3-4a7a-9f7b-127be065856d :parametrized: yes :expectedresults: Operating System is not deleted :CaseImportance: Critical """ os = make_os() # The delete method requires the ID which we will not pass with pytest.raises(CLIReturnCodeError): OperatingSys.delete(test_data) # Now make sure that it still exists result = OperatingSys.info({'id': os['id']}) assert os['id'] == result['id'] assert os['name'] == result['name']
def test_negative_delete_by_id(self): """Delete Operating System using invalid data :id: d29a9c95-1fe3-4a7a-9f7b-127be065856d :expectedresults: Operating System is not deleted :CaseImportance: Critical """ for test_data in negative_delete_data(): with self.subTest(test_data): os = make_os() # The delete method requires the ID which we will not pass with self.assertRaises(CLIReturnCodeError): OperatingSys.delete(test_data) # Now make sure that it still exists result = OperatingSys.info({'id': os['id']}) self.assertEqual(os['id'], result['id']) self.assertEqual(os['name'], result['name'])
def test_positive_add_template(self): """Add provisioning template to operating system :id: 0ea9eb88-2d27-423d-a9d3-fdd788b4e28a :expectedresults: Provisioning template is added to Operating System :CaseLevel: Integration """ template = make_template() os = make_os() OperatingSys.add_config_template({ 'config-template': template['name'], 'id': os['id'], }) os = OperatingSys.info({'id': os['id']}) self.assertEqual(len(os['templates']), 1) template_name = os['templates'][0] self.assertTrue(template_name.startswith(template['name']))
def test_negative_update_name(self): """Negative update of system name :id: 4b18ff6d-7728-4245-a1ce-38e62c05f454 :expectedresults: Operating System name is not updated :CaseImportance: Critical """ os = make_os({'name': gen_alphanumeric()}) for new_name in invalid_values_list(): with self.subTest(new_name): with self.assertRaises(CLIReturnCodeError): OperatingSys.update({ 'id': os['id'], 'name': new_name, }) result = OperatingSys.info({'id': os['id']}) self.assertEqual(result['name'], os['name'])
def test_positive_add_ptable(self): """Add partition table to operating system :id: beba676f-b4e4-48e1-bb0c-18ad91847566 :expectedresults: Partition table is added to Operating System :CaseLevel: Integration """ # Create a partition table. ptable_name = make_partition_table()['name'] # Create an operating system. os_id = make_os()['id'] # Add the partition table to the operating system. OperatingSys.add_ptable({'id': os_id, 'partition-table': ptable_name}) # Verify that the operating system has a partition table. os = OperatingSys.info({'id': os_id}) assert len(os['partition-tables']) == 1 assert os['partition-tables'][0] == ptable_name
def test_positive_add_template(self): """Add provisioning template to operating system :id: 0ea9eb88-2d27-423d-a9d3-fdd788b4e28a :expectedresults: Provisioning template is added to Operating System :CaseLevel: Integration """ template = make_template() os = make_os() default_template_name = os['default-templates'][0] OperatingSys.add_provisioning_template( {'provisioning-template': template['name'], 'id': os['id']} ) os = OperatingSys.info({'id': os['id']}) assert len(os['templates']) == 2 provision_template_name = f"{template['name']} ({template['type']})" assert default_template_name in os['templates'] assert provision_template_name in os['templates']
def test_positive_update_name(self): """Positive update of operating system name @id: 49b655f7-ba9b-4bb9-b09d-0f7140969a40 @assert: Operating System name is updated """ os = make_os({'name': gen_alphanumeric()}) for new_name in valid_data_list(): with self.subTest(new_name): OperatingSys.update({ 'id': os['id'], 'name': new_name, }) result = OperatingSys.info({'id': os['id']}) self.assertEqual( result['id'], os['id'], ) self.assertNotEqual(result['name'], os['name'])
def test_positive_add_ptable(self): """Add partition table to operating system @feature: Operating System @assert: Partition table is added to Operating System """ # Create a partition table. ptable_name = make_partition_table()['name'] # Create an operating system. os_id = make_os()['id'] # Add the partition table to the operating system. OperatingSys.add_ptable({ 'id': os_id, 'partition-table': ptable_name, }) # Verify that the operating system has a partition table. os = OperatingSys.info({'id': os_id}) self.assertEqual(len(os['partition-tables']), 1) self.assertEqual(os['partition-tables'][0], ptable_name)
def test_info_1(self): """@test: Displays info for operating system @feature: Operating System - Info @assert: Operating System is created and have the correct data """ result = make_os() os_info = OperatingSys.info({'id': result['id']}) # Info does not return major or minor but a concat of name, # major and minor self.assertEqual(result['id'], os_info.stdout['id']) self.assertEqual(result['name'], os_info.stdout['name']) self.assertEqual(str(result['major-version']), os_info.stdout['major-version']) self.assertEqual(str(result['minor-version']), os_info.stdout['minor-version'])
def test_positive_update_major_version(self): """Update an Operating System's major version. :id: 38a89dbe-6d1c-4602-a4c1-664425668de8 :expectedresults: Operating System major version is updated :CaseImportance: Critical """ os = make_os() # New value for major major = int(os['major-version']) + 1 OperatingSys.update({ 'id': os['id'], 'major': major, }) os = OperatingSys.info({ 'id': os['id'], }) self.assertEqual(int(os['major-version']), major)
def test_positive_update_parameters_attributes(self): """Update os-parameters-attributes to operating system :id: 5d566eea-b323-4128-9356-3bf39943e4d4 :BZ: 1713553 :expectedresults: Os-parameters-attributes are updated to Operating System """ param_name = gen_string('alpha') param_value = gen_string('alpha') os_id = make_os()['id'] OperatingSys.update({ 'id': os_id, 'os-parameters-attributes': 'name={}, value={}'.format(param_name + '\\', param_value), }) os = OperatingSys.info({'id': os_id}, output_format='json') assert param_name == os['parameters'][0]['name'] assert param_value == os['parameters'][0]['value']
def test_positive_add_ptable(self): """Add partition table to operating system @id: beba676f-b4e4-48e1-bb0c-18ad91847566 @assert: Partition table is added to Operating System @CaseLevel: Integration """ # Create a partition table. ptable_name = make_partition_table()['name'] # Create an operating system. os_id = make_os()['id'] # Add the partition table to the operating system. OperatingSys.add_ptable({ 'id': os_id, 'partition-table': ptable_name, }) # Verify that the operating system has a partition table. os = OperatingSys.info({'id': os_id}) self.assertEqual(len(os['partition-tables']), 1) self.assertEqual(os['partition-tables'][0], ptable_name)
def test_redmine_4547(self): """@test: Search for newly created OS by name @feature: Operating System - List @assert: Operating System is created and listed @bz: redmine#4547 """ result = OperatingSys.list() self.assertEqual(result.return_code, 0) length = len(result.stdout) result = make_os() name = result['name'] os_list = OperatingSys.list({'search': 'name=%s' % name}) os_info = OperatingSys.info({'id': os_list.stdout[0]['id']}) self.assertEqual(result['id'], os_info.stdout['id']) result = OperatingSys.list() self.assertGreater(len(result.stdout), length) self.assertEqual(result.return_code, 0)
def test_list_1(self): """@test: Displays list for operating system @feature: Operating System - List @assert: Operating System is created and listed """ result = OperatingSys.list() self.assertEqual(result.return_code, 0) length = len(result.stdout) name = gen_string("alpha", 10) result = make_os({'name': name}) os_list = OperatingSys.list({'search': 'name=%s' % name}) os_info = OperatingSys.info({'id': os_list.stdout[0]['id']}) self.assertEqual(result['id'], os_info.stdout['id']) result = OperatingSys.list() self.assertGreater(len(result.stdout), length) self.assertEqual(result.return_code, 0)