def test_delete_ak_with_env(self):
        """@Test: Create activation key with lifecycle environment assigned to
        it and delete it using activation key id

        @Feature: Activation key - Positive Delete

        @Steps:

        1. Create Activation key with lifecycle environment assigned to it
        2. Delete Activation key using activation key id

        @Assert: Activation key is deleted

        """
        self.update_env()
        env = make_lifecycle_environment({
            u'organization-id': self.org['id'],
        })
        activation_key = self._make_activation_key({
            u'lifecycle-environment': env['name'],
            u'name': gen_string('alpha'),
        })
        ActivationKey.delete({'id': activation_key['id']})
        with self.assertRaises(CLIReturnCodeError):
            ActivationKey.info({'id': activation_key['id']})
    def test_delete_ak_by_name(self):
        """@Test: Create Activation key and delete it for all variations of
        Activation key name

        @Feature: Activation key - Positive Delete

        @Steps:

        1. Create Activation key for all valid Activation Key names
        2. Delete the Activation key

        @Assert: Activation key is deleted

        """
        for name in valid_data_list():
            with self.subTest(name):
                activation_key = self._make_activation_key({
                    u'name': name,
                    u'organization-id': self.org['id'],
                })
                ActivationKey.delete({
                    'name': activation_key['name'],
                    'organization-id': self.org['id'],
                })
                with self.assertRaises(CLIReturnCodeError):
                    ActivationKey.info({'id': activation_key['id']})
    def test_positive_delete_by_org_label(self):
        """Create Activation key and delete it using organization label
        for which that key was created

        @Feature: Activation key - Positive Delete

        @Assert: Activation key is deleted
        """
        new_ak = self._make_activation_key()
        ActivationKey.delete({"name": new_ak["name"], "organization-label": self.org["label"]})
        with self.assertRaises(CLIReturnCodeError):
            ActivationKey.info({"id": new_ak["id"]})
    def test_positive_delete_with_lce(self):
        """Create activation key with lifecycle environment assigned to
        it and delete it using activation key id

        @Feature: Activation key - Positive Delete

        @Assert: Activation key is deleted
        """
        new_ak = self._make_activation_key({u"lifecycle-environment": self.get_default_env()["name"]})
        ActivationKey.delete({"id": new_ak["id"]})
        with self.assertRaises(CLIReturnCodeError):
            ActivationKey.info({"id": new_ak["id"]})
    def test_positive_delete_with_cv(self):
        """Create activation key with content view assigned to it and
        delete it using activation key id

        @Feature: Activation key - Positive Delete

        @Assert: Activation key is deleted
        """
        new_cv = make_content_view({u"organization-id": self.org["id"]})
        new_ak = self._make_activation_key({u"content-view": new_cv["name"]})
        ActivationKey.delete({"id": new_ak["id"]})
        with self.assertRaises(CLIReturnCodeError):
            ActivationKey.info({"id": new_ak["id"]})
    def test_positive_delete_with_cv(self):
        """Create activation key with content view assigned to it and
        delete it using activation key id

        @Feature: Activation key - Positive Delete

        @Assert: Activation key is deleted
        """
        new_cv = make_content_view({u'organization-id': self.org['id']})
        new_ak = self._make_activation_key({u'content-view': new_cv['name']})
        ActivationKey.delete({'id': new_ak['id']})
        with self.assertRaises(CLIReturnCodeError):
            ActivationKey.info({'id': new_ak['id']})
    def test_positive_delete_by_name(self):
        """Create Activation key and delete it for all variations of
        Activation key name

        @Feature: Activation key - Positive Delete

        @Assert: Activation key is deleted
        """
        for name in valid_data_list():
            with self.subTest(name):
                new_ak = self._make_activation_key({u"name": name, u"organization-id": self.org["id"]})
                ActivationKey.delete({"name": new_ak["name"], "organization-id": self.org["id"]})
                with self.assertRaises(CLIReturnCodeError):
                    ActivationKey.info({"id": new_ak["id"]})
    def test_positive_delete_with_lce(self):
        """Create activation key with lifecycle environment assigned to
        it and delete it using activation key id

        @Feature: Activation key - Positive Delete

        @Assert: Activation key is deleted
        """
        new_ak = self._make_activation_key({
            u'lifecycle-environment': self.get_default_env()['name'],
        })
        ActivationKey.delete({'id': new_ak['id']})
        with self.assertRaises(CLIReturnCodeError):
            ActivationKey.info({'id': new_ak['id']})
    def test_positive_delete_by_org_label(self):
        """Create Activation key and delete it using organization label
        for which that key was created

        @id: f66e5a42-b531-4290-a907-9f5c01305885

        @Assert: Activation key is deleted
        """
        new_ak = self._make_activation_key()
        ActivationKey.delete({
            'name': new_ak['name'],
            'organization-label': self.org['label'],
        })
        with self.assertRaises(CLIReturnCodeError):
            ActivationKey.info({'id': new_ak['id']})
    def test_positive_delete_by_org_name(self):
        """Create Activation key and delete it using organization name
        for which that key was created

        @id: 006cbe5c-fb72-43a1-9760-30c97043c36b

        @Assert: Activation key is deleted
        """
        new_ak = self._make_activation_key()
        ActivationKey.delete({
            'name': new_ak['name'],
            'organization': self.org['name'],
        })
        with self.assertRaises(CLIReturnCodeError):
            ActivationKey.info({'id': new_ak['id']})
Beispiel #11
0
    def test_positive_delete_by_org_label(self):
        """@Test: Create Activation key and delete it using organization label
        for which that key was created

        @Feature: Activation key - Positive Delete

        @Assert: Activation key is deleted
        """
        new_ak = self._make_activation_key()
        ActivationKey.delete({
            'name': new_ak['name'],
            'organization-label': self.org['label'],
        })
        with self.assertRaises(CLIReturnCodeError):
            ActivationKey.info({'id': new_ak['id']})
Beispiel #12
0
    def test_positive_delete_with_cv(self):
        """Create activation key with content view assigned to it and
        delete it using activation key id

        :id: bba323fa-0362-4a9b-97af-560d446cbb6c

        :expectedresults: Activation key is deleted

        :CaseLevel: Integration
        """
        new_cv = make_content_view({u'organization-id': self.org['id']})
        new_ak = self._make_activation_key({u'content-view': new_cv['name']})
        ActivationKey.delete({'id': new_ak['id']})
        with self.assertRaises(CLIReturnCodeError):
            ActivationKey.info({'id': new_ak['id']})
    def test_positive_delete_with_cv(self):
        """Create activation key with content view assigned to it and
        delete it using activation key id

        :id: bba323fa-0362-4a9b-97af-560d446cbb6c

        :expectedresults: Activation key is deleted

        :CaseLevel: Integration
        """
        new_cv = make_content_view({u'organization-id': self.org['id']})
        new_ak = self._make_activation_key({u'content-view': new_cv['name']})
        ActivationKey.delete({'id': new_ak['id']})
        with self.assertRaises(CLIReturnCodeError):
            ActivationKey.info({'id': new_ak['id']})
    def test_positive_delete_by_org_label(self):
        """Create Activation key and delete it using organization label
        for which that key was created

        @id: f66e5a42-b531-4290-a907-9f5c01305885

        @Assert: Activation key is deleted
        """
        new_ak = self._make_activation_key()
        ActivationKey.delete({
            'name': new_ak['name'],
            'organization-label': self.org['label'],
        })
        with self.assertRaises(CLIReturnCodeError):
            ActivationKey.info({'id': new_ak['id']})
    def test_positive_delete_by_org_name(self):
        """Create Activation key and delete it using organization name
        for which that key was created

        @id: 006cbe5c-fb72-43a1-9760-30c97043c36b

        @Assert: Activation key is deleted
        """
        new_ak = self._make_activation_key()
        ActivationKey.delete({
            'name': new_ak['name'],
            'organization': self.org['name'],
        })
        with self.assertRaises(CLIReturnCodeError):
            ActivationKey.info({'id': new_ak['id']})
Beispiel #16
0
    def test_positive_delete_activation_key_2(self, test_data):
        """@Test: Create Activation key and delete it for all variations of
        Description

        @Feature: Activation key - Positive Delete

        @Steps:
        1. Create Activation key for all valid Description in [1]
        using valid Name, Environment, Content View, Usage limit
        2. Delete the Activation key

        @Assert: Activation key is deleted

        @bz: 1109650

        """
        try:
            activation_key = self._make_activation_key(
                {u"description": test_data["description"], u"organization-id": self.org["id"]}
            )
        except CLIFactoryError as err:
            self.fail(err)

        result = ActivationKey.delete({"id": activation_key["id"]})
        self.assertEqual(result.return_code, 0, "Failed to delete activation key")
        self.assertEqual(len(result.stderr), 0, "There should not be an error here")

        # Can we find the object?
        result = ActivationKey.info({"id": activation_key["id"]})
        self.assertNotEqual(result.return_code, 0, "Activation key should be deleted")
        self.assertGreater(len(result.stderr), 0, "There should be an error here")
        self.assertEqual(len(result.stdout), 0, "Output should be blank")
Beispiel #17
0
    def test_positive_delete_activation_key_1(self, test_data):
        """
        @Test: Create Activation key and delete it for all variations of
        Activation key name
        @Feature: Activation key - Positive Delete
        @Steps:
        1. Create Activation key for all valid Activation Key names in [1]
        using valid Description, Environment, Content View, Usage limit
        2. Delete the Activation key
        @Assert: Activation key is deleted
        @bz: 1109650
        """
        try:
            activation_key = self._make_activation_key({
                u'name': test_data['name'],
                u'organization-id': self.org['id'],
            })
        except CLIFactoryError as err:
            self.fail(err)

        result = ActivationKey.delete({'id': activation_key['id']})
        self.assertEqual(
            result.return_code, 0, 'Failed to delete activation key')
        self.assertEqual(
            len(result.stderr), 0, 'There should not be an error here')

        # Can we find the object?
        result = ActivationKey.info({'id': activation_key['id']})
        self.assertNotEqual(
            result.return_code, 0, 'Activation key should be deleted')
        self.assertGreater(
            len(result.stderr), 0, 'There should be an error here')
        self.assertEqual(
            len(result.stdout), 0, 'Output should be blank')
    def test_positive_delete_with_lce(self):
        """Create activation key with lifecycle environment assigned to
        it and delete it using activation key id

        :id: e1830e52-5b1a-4ac4-8d0a-df6efb218a8b

        :expectedresults: Activation key is deleted

        :CaseLevel: Integration
        """
        new_ak = self._make_activation_key({
            u'lifecycle-environment': self.get_default_env()['name'],
        })
        ActivationKey.delete({'id': new_ak['id']})
        with self.assertRaises(CLIReturnCodeError):
            ActivationKey.info({'id': new_ak['id']})
Beispiel #19
0
    def test_positive_delete_with_lce(self):
        """Create activation key with lifecycle environment assigned to
        it and delete it using activation key id

        :id: e1830e52-5b1a-4ac4-8d0a-df6efb218a8b

        :expectedresults: Activation key is deleted

        :CaseLevel: Integration
        """
        new_ak = self._make_activation_key({
            u'lifecycle-environment': self.get_default_env()['name'],
        })
        ActivationKey.delete({'id': new_ak['id']})
        with self.assertRaises(CLIReturnCodeError):
            ActivationKey.info({'id': new_ak['id']})
    def test_positive_delete_by_name(self):
        """Create Activation key and delete it for all variations of
        Activation key name

        @id: ef5f6a28-6bfd-415b-aac9-b3dc9a014ca9

        @Assert: Activation key is deleted
        """
        for name in valid_data_list():
            with self.subTest(name):
                new_ak = self._make_activation_key({
                    u'name': name,
                    u'organization-id': self.org['id'],
                })
                ActivationKey.delete({
                    'name': new_ak['name'],
                    'organization-id': self.org['id'],
                })
                with self.assertRaises(CLIReturnCodeError):
                    ActivationKey.info({'id': new_ak['id']})
    def test_positive_delete_by_name(self):
        """Create Activation key and delete it for all variations of
        Activation key name

        @id: ef5f6a28-6bfd-415b-aac9-b3dc9a014ca9

        @Assert: Activation key is deleted
        """
        for name in valid_data_list():
            with self.subTest(name):
                new_ak = self._make_activation_key({
                    u'name': name,
                    u'organization-id': self.org['id'],
                })
                ActivationKey.delete({
                    'name': new_ak['name'],
                    'organization-id': self.org['id'],
                })
                with self.assertRaises(CLIReturnCodeError):
                    ActivationKey.info({'id': new_ak['id']})
Beispiel #22
0
    def test_delete_ak_by_org_label(self):
        """@Test: Create Activation key and delete it using organization
        label for which that key was created

        @Feature: Activation key - Positive Delete

        @Steps:

        1. Create Activation key
        2. Delete Activation key using organization label

        @Assert: Activation key is deleted

        """
        activation_key = self._make_activation_key({
            u'name': gen_string('alpha'),
        })
        ActivationKey.delete({
            'name': activation_key['name'],
            'organization-label': self.org['label'],
        })
        with self.assertRaises(CLIReturnCodeError):
            ActivationKey.info({'id': activation_key['id']})
Beispiel #23
0
    def test_delete_ak_with_cv(self):
        """@Test: Create activation key with content view assigned to it and
        delete it using activation key id

        @Feature: Activation key - Positive Delete

        @Steps:

        1. Create Activation key with content view assigned to it
        2. Delete Activation key using activation key id

        @Assert: Activation key is deleted

        """
        contentview = make_content_view({
            u'organization-id': self.org['id'],
        })
        activation_key = self._make_activation_key({
            u'content-view': contentview['name'],
            u'name': gen_string('alpha'),
        })
        ActivationKey.delete({'id': activation_key['id']})
        with self.assertRaises(CLIReturnCodeError):
            ActivationKey.info({'id': activation_key['id']})