コード例 #1
0
    def test_positive_unregister(self):
        """Unregister Content host

        @feature: Content host

        @assert: After unregistering, Content hosts list for the org does not
        show the Content host
        """
        activation_key = make_activation_key({
            'content-view-id': self.PROMOTED_CV['id'],
            'lifecycle-environment-id': self.NEW_LIFECYCLE['id'],
            'organization-id': self.NEW_ORG['id'],
        })
        with VirtualMachine(distro='rhel71') as client:
            client.install_katello_ca()
            client.register_contenthost(
                activation_key['name'],
                self.NEW_ORG['label'],
            )
            result = ContentHost.list({'organization-id': self.NEW_ORG['id']})
            self.assertGreaterEqual(len(result), 1)
            self.assertIn(client.hostname, [chost['name'] for chost in result])
            result = client.run('subscription-manager unregister')
            self.assertEqual(result.return_code, 0)
            result = ContentHost.list({'organization-id': self.NEW_ORG['id']})
            self.assertNotIn(
                client.hostname, [chost['name'] for chost in result])
コード例 #2
0
    def test_positive_list(self):
        """List Content hosts for a given org

        @id: b9c056cd-11ca-4870-bac4-0ebc4a782cb0

        @Assert: Content hosts are listed for the given org

        @CaseLevel: System
        """
        activation_key = make_activation_key({
            'content-view-id': self.PROMOTED_CV['id'],
            'lifecycle-environment-id': self.NEW_LIFECYCLE['id'],
            'organization-id': self.NEW_ORG['id'],
        })
        with VirtualMachine(distro='rhel71') as client:
            client.install_katello_ca()
            client.register_contenthost(
                activation_key['name'],
                self.NEW_ORG['label'],
            )
            result = ContentHost.list({
                'organization-id': self.NEW_ORG['id'],
                'lifecycle-environment-id': self.NEW_LIFECYCLE['id'],
            })
            self.assertGreaterEqual(len(result), 1)
            self.assertIn(client.hostname, [chost['name'] for chost in result])
コード例 #3
0
    def test_positive_list(self):
        """List Content hosts for a given org

        @id: b9c056cd-11ca-4870-bac4-0ebc4a782cb0

        @Assert: Content hosts are listed for the given org

        @CaseLevel: System
        """
        activation_key = make_activation_key({
            'content-view-id':
            self.PROMOTED_CV['id'],
            'lifecycle-environment-id':
            self.NEW_LIFECYCLE['id'],
            'organization-id':
            self.NEW_ORG['id'],
        })
        with VirtualMachine(distro='rhel71') as client:
            client.install_katello_ca()
            client.register_contenthost(
                self.NEW_ORG['label'],
                activation_key['name'],
            )
            result = ContentHost.list({
                'organization-id':
                self.NEW_ORG['id'],
                'lifecycle-environment-id':
                self.NEW_LIFECYCLE['id'],
            })
            self.assertGreaterEqual(len(result), 1)
            self.assertIn(client.hostname, [chost['name'] for chost in result])
コード例 #4
0
    def test_positive_unregister(self):
        """Unregister Content host

        @id: c5ce988d-d0ea-4958-9956-5a4b039b285c

        @Assert: After unregistering, content hosts list for the org does not
        show the content host

        @CaseLevel: System
        """
        activation_key = make_activation_key({
            'content-view-id':
            self.PROMOTED_CV['id'],
            'lifecycle-environment-id':
            self.NEW_LIFECYCLE['id'],
            'organization-id':
            self.NEW_ORG['id'],
        })
        with VirtualMachine(distro=DISTRO_RHEL7) as client:
            client.install_katello_ca()
            client.register_contenthost(
                self.NEW_ORG['label'],
                activation_key['name'],
            )
            result = ContentHost.list({
                'organization-id':
                self.NEW_ORG['id'],
                'lifecycle-environment-id':
                self.NEW_LIFECYCLE['id'],
            })
            self.assertGreaterEqual(len(result), 1)
            self.assertIn(client.hostname, [chost['name'] for chost in result])
            result = client.run('subscription-manager unregister')
            self.assertEqual(result.return_code, 0)
            result = ContentHost.list({
                'organization-id':
                self.NEW_ORG['id'],
                'lifecycle-environment-id':
                self.NEW_LIFECYCLE['id'],
            })
            self.assertNotIn(client.hostname,
                             [chost['name'] for chost in result])
コード例 #5
0
    def test_positive_list(self):
        """List Content hosts for a given org

        @feature: Content host

        @assert: Content hosts are listed for the given org
        """
        activation_key = make_activation_key(
            {
                "content-view-id": self.PROMOTED_CV["id"],
                "lifecycle-environment-id": self.NEW_LIFECYCLE["id"],
                "organization-id": self.NEW_ORG["id"],
            }
        )
        with VirtualMachine(distro="rhel71") as client:
            client.install_katello_ca()
            client.register_contenthost(activation_key["name"], self.NEW_ORG["label"])
            result = ContentHost.list({"organization-id": self.NEW_ORG["id"]})
            self.assertGreaterEqual(len(result), 1)
            self.assertIn(client.hostname, [chost["name"] for chost in result])