コード例 #1
0
    def test_positive_delete_1(self, test_data):
        """
        @Feature: Medium - Positive Delete
        @Test: Check if Medium can be deleted
        @Assert: Medium is deleted
        """

        new_obj = make_medium(test_data)

        # Can we find the new object?
        result = Medium.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'])

        return_value = Medium.delete({'id': new_obj['id']})
        self.assertEqual(return_value.return_code, 0, "Deletion failed")
        self.assertEqual(len(return_value.stderr), 0,
                         "There should not be an error here")

        # Can we find the object?
        result = Medium.info({'id': new_obj['id']})
        self.assertNotEqual(result.return_code, 0, "Medium should be deleted")
        self.assertGreater(len(result.stderr), 0,
                           "There should be an exception here")
        self.assertEqual(len(result.stdout), 0, "Output should be blank.")
コード例 #2
0
    def test_medium_update(self):
        """@Test: Check if medium can be updated

        @Feature: Medium - Update medium

        @Assert: Medium updated

        """
        new_name = gen_alphanumeric(6)
        try:
            medium = make_medium({'name': gen_alphanumeric(6)})
        except CLIFactoryError as e:
            self.fail(e)

        args = {
            'name': medium['name'],
            'new-name': new_name,
        }

        result = Medium().update(args)
        self.assertEqual(result.return_code, 0,
                         "Could not update media")
        self.assertEqual(len(result.stderr), 0,
                         "There should not be an exception here")

        result = Medium().info({'id': medium['id']})
        self.assertEqual(result.stdout['name'], new_name,
                         "Medium name was not updated")
コード例 #3
0
    def test_positive_update_medium_by_id(self):
        """A host can be updated with a new medium. Use entities ids for
        association

        @id: 899f1eef-07a9-4227-848a-92e377a8d55c

        @assert: A host is updated and the medium matches

        @CaseLevel: Integration
        """
        new_medium = make_medium({
            'location-id':
            self.host_args.location.id,
            'organization-id':
            self.host_args.organization.id,
        })
        Medium.add_operating_system({
            'id':
            new_medium['id'],
            'operatingsystem-id':
            self.host_args.operatingsystem.id,
        })
        new_medium = Medium.info({'id': new_medium['id']})
        Host.update({
            'id': self.host['id'],
            'medium-id': new_medium['id'],
        })
        self.host = Host.info({'id': self.host['id']})
        self.assertEqual(self.host['operating-system']['medium'],
                         new_medium['name'])
コード例 #4
0
    def test_positive_update_os_by_name(self):
        """A host can be updated with a new operating system. Use
        entities names for association

        @id: bd48887f-3db3-47b0-8231-de58884efe57

        @assert: A host is updated and the operating system matches

        @CaseLevel: Integration
        """
        new_os = make_os({
            'architectures':
            self.host_args.architecture.name,
            'partition-tables':
            self.host['operating-system']['partition-table'],
        })
        Medium.add_operating_system({
            'name': self.host_args.medium.name,
            'operatingsystem': new_os['title'],
        })
        Host.update({
            'name': self.host['name'],
            'operatingsystem': new_os['title'],
        })
        self.host = Host.info({'name': self.host['name']})
        self.assertEqual(self.host['operating-system']['operating-system'],
                         new_os['title'])
コード例 #5
0
ファイル: test_host.py プロジェクト: waffle-iron/robottelo
    def test_positive_update_os_by_name(self):
        """A host can be updated with a new operating system. Use
        entities names for association

        @id: bd48887f-3db3-47b0-8231-de58884efe57

        @assert: A host is updated and the operating system matches

        @CaseLevel: Integration
        """
        new_os = make_os({
            'architectures': self.host_args.architecture.name,
            'partition-tables': self.host[
                'operating-system']['partition-table'],
        })
        Medium.add_operating_system({
            'name': self.host_args.medium.name,
            'operatingsystem': new_os['title'],
        })
        Host.update({
            'name': self.host['name'],
            'operatingsystem': new_os['title'],
        })
        self.host = Host.info({'name': self.host['name']})
        self.assertEqual(
            self.host['operating-system']['operating-system'], new_os['title'])
コード例 #6
0
ファイル: test_host.py プロジェクト: waffle-iron/robottelo
    def test_positive_update_medium_by_name(self):
        """A host can be updated with a new medium. Use entities names
        for association

        @id: f47edb02-d649-4ca8-94b2-0637ebdac2e8

        @assert: A host is updated and the medium matches

        @CaseLevel: Integration
        """
        new_medium = make_medium({
            'location': self.host_args.location.name,
            'organization': self.host_args.organization.name,
        })
        Medium.add_operating_system({
            'name': new_medium['name'],
            'operatingsystem': self.host_args.operatingsystem.title,
        })
        new_medium = Medium.info({'name': new_medium['name']})
        Host.update({
            'medium': new_medium['name'],
            'name': self.host['name'],
        })
        self.host = Host.info({'name': self.host['name']})
        self.assertEqual(
            self.host['operating-system']['medium'], new_medium['name'])
コード例 #7
0
ファイル: test_host.py プロジェクト: waffle-iron/robottelo
    def test_positive_update_medium_by_id(self):
        """A host can be updated with a new medium. Use entities ids for
        association

        @id: 899f1eef-07a9-4227-848a-92e377a8d55c

        @assert: A host is updated and the medium matches

        @CaseLevel: Integration
        """
        new_medium = make_medium({
            'location-id': self.host_args.location.id,
            'organization-id': self.host_args.organization.id,
        })
        Medium.add_operating_system({
            'id': new_medium['id'],
            'operatingsystem-id': self.host_args.operatingsystem.id,
        })
        new_medium = Medium.info({'id': new_medium['id']})
        Host.update({
            'id': self.host['id'],
            'medium-id': new_medium['id'],
        })
        self.host = Host.info({'id': self.host['id']})
        self.assertEqual(
            self.host['operating-system']['medium'], new_medium['name'])
コード例 #8
0
    def test_positive_update_os_by_id(self):
        """A host can be updated with a new operating system. Use
        entities ids for association

        @id: 9ea88634-9c14-4519-be6e-fb163897efb7

        @assert: A host is updated and the operating system matches

        @CaseLevel: Integration
        """
        new_os = make_os({
            'architecture-ids': self.host_args.architecture.id,
            'partition-table-ids': self.host_args.ptable.id,
        })
        Medium.add_operating_system({
            'id': self.host_args.medium.id,
            'operatingsystem-id': new_os['id'],
        })
        Host.update({
            'id': self.host['id'],
            'operatingsystem-id': new_os['id'],
        })
        self.host = Host.info({'id': self.host['id']})
        self.assertEqual(self.host['operating-system']['operating-system'],
                         new_os['title'])
コード例 #9
0
    def test_positive_update_medium_by_name(self):
        """A host can be updated with a new medium. Use entities names
        for association

        @feature: Hosts

        @assert: A host is updated and the medium matches
        """
        new_medium = make_medium({
            'location':
            self.host_args.location.name,
            'organization':
            self.host_args.organization.name,
        })
        Medium.add_operating_system({
            'name':
            new_medium['name'],
            'operatingsystem':
            self.host_args.operatingsystem.title,
        })
        new_medium = Medium.info({'name': new_medium['name']})
        Host.update({
            'medium': new_medium['name'],
            'name': self.host['name'],
        })
        self.host = Host.info({'name': self.host['name']})
        self.assertEqual(self.host['medium'], new_medium['name'])
コード例 #10
0
    def test_positive_delete_1(self, test_data):
        """
        @Feature: Medium - Positive Delete
        @Test: Check if Medium can be deleted
        @Assert: Medium is deleted
        """

        new_obj = make_medium(test_data)

        # Can we find the new object?
        result = Medium.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'])

        return_value = Medium.delete({'id': new_obj['id']})
        self.assertEqual(return_value.return_code, 0, "Deletion failed")
        self.assertEqual(
            len(return_value.stderr), 0, "There should not be an error here")

        # Can we find the object?
        result = Medium.info({'id': new_obj['id']})
        self.assertNotEqual(
            result.return_code, 0, "Medium should be deleted")
        self.assertGreater(len(result.stderr), 0,
                           "There should be an exception here")
        self.assertEqual(
            len(result.stdout), 0, "Output should be blank.")
コード例 #11
0
    def test_positive_update_medium_by_name(self):
        """A host can be updated with a new medium. Use entities names
        for association

        @id: f47edb02-d649-4ca8-94b2-0637ebdac2e8

        @assert: A host is updated and the medium matches

        @CaseLevel: Integration
        """
        new_medium = make_medium({
            'location':
            self.host_args.location.name,
            'organization':
            self.host_args.organization.name,
        })
        Medium.add_operating_system({
            'name':
            new_medium['name'],
            'operatingsystem':
            self.host_args.operatingsystem.title,
        })
        new_medium = Medium.info({'name': new_medium['name']})
        Host.update({
            'medium': new_medium['name'],
            'name': self.host['name'],
        })
        self.host = Host.info({'name': self.host['name']})
        self.assertEqual(self.host['operating-system']['medium'],
                         new_medium['name'])
コード例 #12
0
ファイル: test_host.py プロジェクト: waffle-iron/robottelo
    def test_positive_update_os_by_id(self):
        """A host can be updated with a new operating system. Use
        entities ids for association

        @id: 9ea88634-9c14-4519-be6e-fb163897efb7

        @assert: A host is updated and the operating system matches

        @CaseLevel: Integration
        """
        new_os = make_os({
            'architecture-ids': self.host_args.architecture.id,
            'partition-table-ids': self.host_args.ptable.id,
        })
        Medium.add_operating_system({
            'id': self.host_args.medium.id,
            'operatingsystem-id': new_os['id'],
        })
        Host.update({
            'id': self.host['id'],
            'operatingsystem-id': new_os['id'],
        })
        self.host = Host.info({'id': self.host['id']})
        self.assertEqual(
            self.host['operating-system']['operating-system'], new_os['title'])
コード例 #13
0
    def test_positive_add_os(self):
        """Check if Medium can be associated with operating system

        @Feature: Medium - Add operating system

        @Assert: Operating system added

        """
        medium = make_medium()
        os = make_os()
        Medium.add_operating_system({
            'id': medium['id'],
            'operatingsystem-id': os['id'],
        })
コード例 #14
0
    def test_positive_delete_by_id(self):
        """Check if Medium can be deleted

        @Feature: Medium - Positive Delete

        @Assert: Medium is deleted

        """
        for name in valid_data_list():
            with self.subTest(name):
                medium = make_medium({'name': name})
                Medium.delete({'id': medium['id']})
                with self.assertRaises(CLIReturnCodeError):
                    Medium.info({'id': medium['id']})
コード例 #15
0
ファイル: test_medium.py プロジェクト: rohitkadam19/robottelo
    def test_positive_delete_by_id(self):
        """Check if Medium can be deleted

        @id: dc62c9ad-d2dc-42df-80eb-02cf8d26cdee

        @Assert: Medium is deleted

        """
        for name in valid_data_list():
            with self.subTest(name):
                medium = make_medium({'name': name})
                Medium.delete({'id': medium['id']})
                with self.assertRaises(CLIReturnCodeError):
                    Medium.info({'id': medium['id']})
コード例 #16
0
    def test_positive_update_name(self):
        """Check if medium can be updated

        :id: 2111090a-21d3-47f7-bb81-5f19ab71a91d

        :expectedresults: Medium updated


        :CaseImportance: Medium
        """
        new_name = gen_alphanumeric(6)
        medium = make_medium()
        Medium.update({'name': medium['name'], 'new-name': new_name})
        medium = Medium.info({'id': medium['id']})
        self.assertEqual(medium['name'], new_name)
コード例 #17
0
    def test_positive_update_name(self):
        """Check if medium can be updated

        @Feature: Medium - Update medium

        @Assert: Medium updated

        """
        new_name = gen_alphanumeric(6)
        medium = make_medium()
        Medium.update({
            'name': medium['name'],
            'new-name': new_name,
        })
        medium = Medium.info({'id': medium['id']})
        self.assertEqual(medium['name'], new_name)
コード例 #18
0
ファイル: test_medium.py プロジェクト: BlackSmith/robottelo
    def test_positive_add_os(self):
        """Check if Medium can be associated with operating system

        :id: 47d1e6f0-d8a6-4190-b2ac-41b09a559429

        :expectedresults: Operating system added


        :CaseLevel: Integration
        """
        medium = make_medium()
        os = make_os()
        Medium.add_operating_system({
            'id': medium['id'],
            'operatingsystem-id': os['id'],
        })
コード例 #19
0
ファイル: test_medium.py プロジェクト: vikas86/robottelo
    def test_positive_delete_by_id(self):
        """Check if Medium can be deleted

        :id: dc62c9ad-d2dc-42df-80eb-02cf8d26cdee

        :expectedresults: Medium is deleted


        :CaseImportance: Critical
        """
        for name in valid_data_list().values():
            with self.subTest(name):
                medium = make_medium({'name': name})
                Medium.delete({'id': medium['id']})
                with self.assertRaises(CLIReturnCodeError):
                    Medium.info({'id': medium['id']})
コード例 #20
0
ファイル: test_medium.py プロジェクト: vikask18/robottelo
    def test_positive_add_os(self):
        """Check if Medium can be associated with operating system

        :id: 47d1e6f0-d8a6-4190-b2ac-41b09a559429

        :expectedresults: Operating system added


        :CaseLevel: Integration
        """
        medium = make_medium()
        os = make_os()
        Medium.add_operating_system({
            'id': medium['id'],
            'operatingsystem-id': os['id'],
        })
コード例 #21
0
ファイル: test_medium.py プロジェクト: rohitkadam19/robottelo
    def test_positive_update_name(self):
        """Check if medium can be updated

        @id: 2111090a-21d3-47f7-bb81-5f19ab71a91d

        @Assert: Medium updated

        """
        new_name = gen_alphanumeric(6)
        medium = make_medium()
        Medium.update({
            'name': medium['name'],
            'new-name': new_name,
        })
        medium = Medium.info({'id': medium['id']})
        self.assertEqual(medium['name'], new_name)
コード例 #22
0
ファイル: test_medium.py プロジェクト: BlackSmith/robottelo
    def test_positive_update_name(self):
        """Check if medium can be updated

        :id: 2111090a-21d3-47f7-bb81-5f19ab71a91d

        :expectedresults: Medium updated


        :CaseImportance: Critical
        """
        new_name = gen_alphanumeric(6)
        medium = make_medium()
        Medium.update({
            'name': medium['name'],
            'new-name': new_name,
        })
        medium = Medium.info({'id': medium['id']})
        self.assertEqual(medium['name'], new_name)
コード例 #23
0
ファイル: test_host.py プロジェクト: adammhaile/robottelo
    def test_positive_update_os_by_name(self):
        """A host can be updated with a new operating system. Use
        entities names for association

        @feature: Hosts

        @assert: A host is updated and the operating system matches
        """
        new_os = make_os({
            'architectures': self.host_args.architecture.name,
            'partition-tables': self.host['partition-table'],
        })
        Medium.add_operating_system({
            'name': self.host_args.medium.name,
            'operatingsystem': new_os['title'],
        })
        Host.update({
            'name': self.host['name'],
            'operatingsystem': new_os['title'],
        })
        self.host = Host.info({'name': self.host['name']})
        self.assertEqual(self.host['operating-system'], new_os['title'])
コード例 #24
0
    def test_positive_update_os_by_name(self):
        """A host can be updated with a new operating system. Use
        entities names for association

        @feature: Hosts

        @assert: A host is updated and the operating system matches
        """
        new_os = make_os({
            'architectures': self.host_args.architecture.name,
            'partition-tables': self.host['partition-table'],
        })
        Medium.add_operating_system({
            'name': self.host_args.medium.name,
            'operatingsystem': new_os['title'],
        })
        Host.update({
            'name': self.host['name'],
            'operatingsystem': new_os['title'],
        })
        self.host = Host.info({'name': self.host['name']})
        self.assertEqual(self.host['operating-system'], new_os['title'])
コード例 #25
0
    def test_removeoperatingsystem_medium(self):
        """@Test: Check if operating system can be removed from media

        @Feature: Medium - Remove operating system

        @Assert: Operating system removed

        """
        try:
            medium = make_medium({'name': gen_alphanumeric(6)})
            os = make_os()
        except CLIFactoryError as err:
            self.fail(err)

        args = {
            'id': medium['id'],
            'operatingsystem-id': os['id'],
        }

        result = Medium().add_operating_system(args)
        self.assertEqual(result.return_code, 0,
                         "Could not associate the operating system to media")
        self.assertEqual(len(result.stderr), 0,
                         "There should not be an exception here")
        result = Medium().info({'id': medium['id']})
        self.assertIn(os['title'],
                      result.stdout['operating-systems'],
                      "Operating system is not added to the media")

        result = Medium().remove_operating_system(args)
        self.assertEqual(result.return_code, 0,
                         "Removed the operating system from media")
        self.assertEqual(len(result.stderr), 0,
                         "There should not be an exception here")
        result = Medium().info({'id': medium['id']})
        self.assertNotIn(os['name'],
                         result.stdout['operating-systems'],
                         "Operating system is not removed from the media")
コード例 #26
0
ファイル: test_host.py プロジェクト: adammhaile/robottelo
    def test_positive_update_medium_by_name(self):
        """A host can be updated with a new medium. Use entities names
        for association

        @feature: Hosts

        @assert: A host is updated and the medium matches
        """
        new_medium = make_medium({
            'location': self.host_args.location.name,
            'organization': self.host_args.organization.name,
        })
        Medium.add_operating_system({
            'name': new_medium['name'],
            'operatingsystem': self.host_args.operatingsystem.title,
        })
        new_medium = Medium.info({'name': new_medium['name']})
        Host.update({
            'medium': new_medium['name'],
            'name': self.host['name'],
        })
        self.host = Host.info({'name': self.host['name']})
        self.assertEqual(self.host['medium'], new_medium['name'])
コード例 #27
0
    def test_positive_create_1(self, test_data):
        """
        @Feature: Medium - Positive Create
        @Test: Check if Medium can be created
        @Assert: Medium is created
        """

        new_obj = make_medium(test_data)

        # Can we find the new object?
        result = Medium.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.assertGreater(len(result.stdout), 0, "Failed to fetch medium")
        self.assertEqual(new_obj['name'], result.stdout['name'])
コード例 #28
0
    def test_positive_create_1(self, test_data):
        """
        @Feature: Medium - Positive Create
        @Test: Check if Medium can be created
        @Assert: Medium is created
        """

        new_obj = make_medium(test_data)

        # Can we find the new object?
        result = Medium.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.assertGreater(
            len(result.stdout), 0, "Failed to fetch medium")
        self.assertEqual(new_obj['name'],
                         result.stdout['name'])
コード例 #29
0
ファイル: test_medium.py プロジェクト: tstrych/robottelo
    def test_positive_crud_with_name(self, name):
        """Check if Medium can be created, updated, deleted

        :id: 66b749b2-0248-47a8-b78f-3366f3804b29

        :parametrized: yes

        :expectedresults: Medium is created


        :CaseImportance: Critical
        """
        medium = make_medium({'name': name})
        assert medium['name'] == name
        new_name = gen_alphanumeric(6)
        Medium.update({'name': medium['name'], 'new-name': new_name})
        medium = Medium.info({'id': medium['id']})
        assert medium['name'] == new_name
        Medium.delete({'id': medium['id']})
        with pytest.raises(CLIReturnCodeError):
            Medium.info({'id': medium['id']})
コード例 #30
0
    def test_addoperatingsystem_medium(self):
        """@Test: Check if Medium can be associated with operating system

        @Feature: Medium - Add operating system

        @Assert: Operating system added

        """
        try:
            medium = make_medium({'name': gen_alphanumeric(6)})
            os = make_os()
        except CLIFactoryError as err:
            self.fail(err)

        args = {
            'id': medium['id'],
            'operatingsystem-id': os['id'],
        }

        result = Medium().add_operating_system(args)
        self.assertEqual(result.return_code, 0,
                         "Could not associate the operating system to media")
        self.assertEqual(len(result.stderr), 0,
                         "There should not be an exception here")
コード例 #31
0
    def test_positive_remove_os(self):
        """Check if operating system can be removed from media

        @Feature: Medium - Remove operating system

        @Assert: Operating system removed

        """
        medium = make_medium()
        os = make_os()
        Medium.add_operating_system({
            'id': medium['id'],
            'operatingsystem-id': os['id'],
        })
        medium = Medium.info({'id': medium['id']})
        self.assertIn(os['title'], medium['operating-systems'])
        Medium.remove_operating_system({
            'id': medium['id'],
            'operatingsystem-id': os['id'],
        })
        medium = Medium.info({'id': medium['id']})
        self.assertNotIn(os['name'], medium['operating-systems'])
コード例 #32
0
ファイル: test_medium.py プロジェクト: BlackSmith/robottelo
    def test_positive_remove_os(self):
        """Check if operating system can be removed from media

        :id: 23b5b55b-3624-440c-8001-75c7c5a5a004

        :expectedresults: Operating system removed


        :CaseLevel: Integration
        """
        medium = make_medium()
        os = make_os()
        Medium.add_operating_system({
            'id': medium['id'],
            'operatingsystem-id': os['id'],
        })
        medium = Medium.info({'id': medium['id']})
        self.assertIn(os['title'], medium['operating-systems'])
        Medium.remove_operating_system({
            'id': medium['id'],
            'operatingsystem-id': os['id'],
        })
        medium = Medium.info({'id': medium['id']})
        self.assertNotIn(os['name'], medium['operating-systems'])
コード例 #33
0
ファイル: test_medium.py プロジェクト: tstrych/robottelo
    def test_positive_remove_os(self):
        """Check if Medium can be associated with operating system and then removed from media

        :id: 23b5b55b-3624-440c-8001-75c7c5a5a004

        :expectedresults: Operating system removed


        :CaseLevel: Integration
        """
        medium = make_medium()
        os = make_os()
        Medium.add_operating_system({
            'id': medium['id'],
            'operatingsystem-id': os['id']
        })
        medium = Medium.info({'id': medium['id']})
        assert os['title'] in medium['operating-systems']
        Medium.remove_operating_system({
            'id': medium['id'],
            'operatingsystem-id': os['id']
        })
        medium = Medium.info({'id': medium['id']})
        assert os['name'] not in medium['operating-systems']
コード例 #34
0
ファイル: test_medium.py プロジェクト: vikask18/robottelo
    def test_positive_remove_os(self):
        """Check if operating system can be removed from media

        :id: 23b5b55b-3624-440c-8001-75c7c5a5a004

        :expectedresults: Operating system removed


        :CaseLevel: Integration
        """
        medium = make_medium()
        os = make_os()
        Medium.add_operating_system({
            'id': medium['id'],
            'operatingsystem-id': os['id'],
        })
        medium = Medium.info({'id': medium['id']})
        self.assertIn(os['title'], medium['operating-systems'])
        Medium.remove_operating_system({
            'id': medium['id'],
            'operatingsystem-id': os['id'],
        })
        medium = Medium.info({'id': medium['id']})
        self.assertNotIn(os['name'], medium['operating-systems'])
コード例 #35
0
 def _cleanup():
     if Medium.exists(search=('name', medium['name'])):
         Medium.delete(options={'id': medium['id']})