Beispiel #1
0
    def test_positive_create_with_cv(self):
        """Create Activation key for all variations of Content Views

        @id: 2ad000f1-6c80-46aa-a61b-9ea62cefe91b

        @Assert: Activation key is created

        @CaseLevel: Integration
        """
        with Session(self.browser) as session:
            for cv_name in valid_data_list():
                with self.subTest(cv_name):
                    name = gen_string('alpha')
                    env_name = gen_string('alpha')
                    # Helper function to create and promote CV to next env
                    repo_id = self.create_sync_custom_repo()
                    self.cv_publish_promote(cv_name, env_name, repo_id)
                    make_activationkey(
                        session,
                        org=self.organization.name,
                        name=name,
                        env=env_name,
                        content_view=cv_name,
                    )
                    self.assertIsNotNone(self.activationkey.search(name))
    def test_positive_update_activation_key_6(self):
        """@Test: Update Usage limit from definite number to Unlimited

        @Feature: Activation key - Positive Update

        @Steps:
        1. Create Activation key
        2. Update Usage limit from definite number to Unlimited

        @Assert: Activation key is updated

        @BZ: 1127090

        """

        name = gen_string("alpha", 10)
        limit = "6"
        new_limit = "Unlimited"
        with Session(self.browser) as session:
            make_activationkey(session, org=self.org_name,
                               name=name, env=ENVIRONMENT,
                               limit=limit)
            self.assertIsNotNone(self.activationkey.search_key(name))
            self.activationkey.update(name, limit=new_limit)
            self.assertIsNotNone(self.activationkey.wait_until_element
                                 (common_locators["alert.success"]))
    def test_positive_delete_with_cv(self):
        """Create Activation key with content view and delete it

        @id: 7e40e1ed-8314-406b-9451-05f64806a6e6

        @Assert: Activation key is deleted

        @CaseLevel: Integration
        """
        name = gen_string('alpha')
        cv_name = gen_string('utf8')
        env_name = gen_string('alpha')
        # Helper function to create and promote CV to next environment
        repo_id = self.create_sync_custom_repo()
        self.cv_publish_promote(cv_name, env_name, repo_id)
        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=env_name,
                content_view=cv_name,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            self.activationkey.delete(name)
Beispiel #4
0
    def test_negative_update_limit(self):
        """Update invalid Usage Limit in an activation key

        :id: d42d8b6a-d3f4-4baa-be20-127f52f2313e

        :expectedresults: Activation key is not updated.  Appropriate error
            shown.

        :CaseImportance: Critical
        """
        name = gen_string('alpha')
        with Session(self) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=ENVIRONMENT,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            for limit in ' ', -1, 'text', '0':
                with self.subTest(limit):
                    with self.assertRaises(ValueError) as context:
                        self.activationkey.update(name, limit=limit)
                    self.assertEqual(
                        str(context.exception),
                        'Please update content host limit with valid ' +
                        'integer value'
                    )
Beispiel #5
0
    def test_positive_remove_user(self):
        """Delete any user who has previously created an activation key
        and check that activation key still exists

        :id: f0504bd8-52d2-40cd-91c6-64d71b14c876

        :expectedresults: Activation Key can be read

        :BZ: 1291271
        """
        ak_name = gen_string('alpha')
        # Create user
        password = gen_string('alpha')
        user = entities.User(
            password=password, login=gen_string('alpha'), admin=True).create()
        # Create Activation Key with new user credentials
        with Session(self, user=user.login, password=password) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=ak_name,
                env=ENVIRONMENT,
            )
            self.assertIsNotNone(self.activationkey.search(ak_name))
        # Remove user and check that AK still exists
        user.delete()
        with Session(self) as session:
            set_context(session, org=self.organization.name)
            self.assertIsNotNone(self.activationkey.search(ak_name))
Beispiel #6
0
    def test_negative_update_name(self):
        """Update invalid name in an activation key

        :id: 6eb0f747-cd4d-421d-b11e-b8917bb0cec6

        :expectedresults: Activation key is not updated.  Appropriate error
            shown.

        :CaseImportance: Critical
        """
        name = gen_string('alpha', 10)
        with Session(self) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=ENVIRONMENT,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            for new_name in invalid_names_list():
                with self.subTest(new_name):
                    self.activationkey.update(name, new_name)
                    self.assertIsNotNone(self.activationkey.wait_until_element(
                        common_locators['alert.error_sub_form']))
                    self.assertIsNone(self.activationkey.search(new_name))
Beispiel #7
0
    def test_positive_delete_with_cv(self):
        """Create Activation key with content view and delete it

        @id: 7e40e1ed-8314-406b-9451-05f64806a6e6

        @Assert: Activation key is deleted

        @CaseLevel: Integration
        """
        name = gen_string('alpha')
        cv_name = gen_string('utf8')
        env_name = gen_string('alpha')
        # Helper function to create and promote CV to next environment
        repo_id = self.create_sync_custom_repo()
        self.cv_publish_promote(cv_name, env_name, repo_id)
        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=env_name,
                content_view=cv_name,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            self.activationkey.delete(name)
    def test_positive_update_env(self):
        """Update Environment in an Activation key

        @id: 895cda6a-bb1e-4b94-a858-95f0be78a17b

        @Assert: Activation key is updated

        @CaseLevel: Integration
        """
        name = gen_string('alpha')
        cv_name = gen_string('alpha')
        env_name = gen_string('utf8')
        # Helper function to create and promote CV to next environment
        repo_id = self.create_sync_custom_repo()
        self.cv_publish_promote(cv_name, env_name, repo_id)
        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=ENVIRONMENT,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            env_locator = locators['ak.selected_env']
            selected_env = self.activationkey.get_attribute(name, env_locator)
            self.assertEqual(ENVIRONMENT, selected_env)
            self.activationkey.update(name, content_view=cv_name, env=env_name)
            self.assertIsNotNone(self.activationkey.wait_until_element(
                common_locators['alert.success_sub_form']))
            selected_env = self.activationkey.get_attribute(name, env_locator)
            self.assertEqual(env_name, selected_env)
    def test_positive_create_with_host_collection(self):
        """Create Activation key with Host Collection

        @id: 0e4ad2b4-47a7-4087-828f-2b0535a97b69

        @Assert: Activation key is created

        @CaseLevel: Integration
        """
        name = gen_string(str_type='alpha')
        # create Host Collection using API
        host_col = entities.HostCollection(
            organization=self.organization,
            name=gen_string(str_type='utf8'),
        ).create()

        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=ENVIRONMENT,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            # add Host Collection
            self.activationkey.add_host_collection(name, host_col.name)
            self.assertIsNotNone(self.activationkey.find_element(
                common_locators['alert.success_sub_form']))

            # check added host collection is listed
            self.activationkey.click(tab_locators['ak.host_collections.list'])
            strategy, value = tab_locators['ak.host_collections.add.select']
            host_collection = self.activationkey.wait_until_element(
                (strategy, value % host_col.name))
            self.assertIsNotNone(host_collection)
    def test_positive_delete_with_env(self):
        """Create Activation key with environment and delete it

        @id: b6019881-3d6e-4b75-89f5-1b62aff3b1ca

        @Assert: Activation key is deleted

        @CaseLevel: Integration
        """
        name = gen_string('alpha')
        cv_name = gen_string('alpha')
        env_name = gen_string('utf8')
        # Helper function to create and promote CV to next environment
        repo_id = self.create_sync_custom_repo()
        self.cv_publish_promote(cv_name, env_name, repo_id)
        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=env_name,
                content_view=cv_name,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            self.activationkey.delete(name)
    def test_positive_update_activation_key_2(self, new_description):
        """@Test: Update Description in an Activation key

        @Feature: Activation key - Positive Update

        @Steps:
        1. Create Activation key
        2. Update Description for all variations in [1]

        @Assert: Activation key is updated

        @BZ: 1078676

        """

        name = gen_string("alpha", 10)
        description = gen_string("alpha", 10)
        with Session(self.browser) as session:
            make_activationkey(session, org=self.org_name,
                               name=name, env=ENVIRONMENT,
                               description=description)
            self.assertIsNotNone(self.activationkey.search_key(name))
            self.activationkey.update(name, description=new_description)
            self.assertIsNotNone(self.activationkey.wait_until_element
                                 (common_locators["alert.success"]))
    def test_positive_update_activation_key_3(self, env_name):
        """@Test: Update Environment in an Activation key

        @Feature: Activation key - Positive Update

        @Steps:
        1. Create Activation key
        2. Update Environment for all variations in [1]

        @Assert: Activation key is updated

        @BZ: 1089637

        """

        name = gen_string("alpha", 8)
        cv_name = gen_string("alpha", 8)
        # Helper function to create and promote CV to next environment
        self.create_cv(cv_name, env_name)
        with Session(self.browser) as session:
            make_activationkey(
                session, org=self.org_name, name=name, env=ENVIRONMENT,
                description=gen_string("alpha", 16)
            )
            self.assertIsNotNone(self.activationkey.search_key(name))
            env_locator = locators["ak.selected_env"]
            selected_env = self.activationkey.get_attribute(name, env_locator)
            self.assertEqual(ENVIRONMENT, selected_env)
            self.activationkey.update(name, content_view=cv_name, env=env_name)
            self.assertIsNotNone(self.activationkey.wait_until_element
                                 (common_locators["alert.success"]))
            selected_env = self.activationkey.get_attribute(name, env_locator)
            self.assertEqual(env_name, selected_env)
    def test_positive_create_with_host_collection(self):
        """Create Activation key with Host Collection

        @Feature: Activation key - Positive Create

        @Assert: Activation key is created
        """
        name = gen_string(str_type='alpha')
        # create Host Collection using API
        host_col = entities.HostCollection(
            organization=self.organization,
            name=gen_string(str_type='utf8'),
        ).create()

        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=ENVIRONMENT,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            # add Host Collection
            self.activationkey.add_host_collection(name, host_col.name)
            self.assertIsNotNone(
                self.activationkey.find_element(
                    common_locators['alert.success']))

            # check added host collection is listed
            self.activationkey.click(tab_locators['ak.host_collections.list'])
            strategy, value = tab_locators['ak.host_collections.add.select']
            host_collection = self.activationkey.wait_until_element(
                (strategy, value % host_col.name))
            self.assertIsNotNone(host_collection)
    def test_negative_delete_activation_key_1(self):
        """@Test: [UI ONLY] Attempt to delete an Activation Key and cancel it

        @Feature: Activation key - Positive Delete

        @Steps:
        1. Create an Activation key
        2. Attempt to remove an Activation Key
        3. Click Cancel in the confirmation dialog box

        @Assert: Activation key is not deleted

        @BZ: 1078676

        """

        name = gen_string("alpha", 10)
        with Session(self.browser) as session:
            make_activationkey(
                session, org=self.org_name, name=name, env=ENVIRONMENT,
                description=gen_string("alpha", 16)
            )
            self.assertIsNotNone(self.activationkey.search_key(name))
            self.activationkey.delete(name, really=False)
            self.assertIsNotNone(self.activationkey.search_key(name))
Beispiel #15
0
    def test_multiple_activation_keys_to_system(self):
        """@Test: Check if multiple Activation keys can be attached to a system

        @Feature: Activation key - System

        @Assert: Multiple Activation keys are attached to a system

        """
        key_1_name = gen_string('alpha')
        key_2_name = gen_string('alpha')
        cv_1_name = gen_string('alpha')
        cv_2_name = gen_string('alpha')
        env_1_name = gen_string('alpha')
        env_2_name = gen_string('alpha')
        product_1_name = gen_string('alpha')
        product_2_name = gen_string('alpha')
        # Helper function to create and promote CV to next environment
        repo_1_id = self.create_sync_custom_repo(product_name=product_1_name)
        self.cv_publish_promote(cv_1_name, env_1_name, repo_1_id)
        repo_2_id = self.create_sync_custom_repo(
            product_name=product_2_name, repo_url=FAKE_2_YUM_REPO)
        self.cv_publish_promote(cv_2_name, env_2_name, repo_2_id)
        with Session(self.browser) as session:
            # Create activation_key_1
            make_activationkey(
                session,
                org=self.organization.name,
                name=key_1_name,
                env=env_1_name,
                content_view=cv_1_name,
            )
            self.assertIsNotNone(self.activationkey.search(key_1_name))
            self.activationkey.associate_product(key_1_name, [product_1_name])
            self.assertIsNotNone(self.activationkey.wait_until_element(
                common_locators['alert.success']))
            # Create activation_key_2
            make_activationkey(
                session,
                org=self.organization.name,
                name=key_2_name,
                env=env_2_name,
                content_view=cv_2_name,
            )
            self.assertIsNotNone(self.activationkey.search(key_2_name))
            self.activationkey.associate_product(key_2_name, [product_2_name])
            self.assertIsNotNone(self.activationkey.wait_until_element(
                common_locators['alert.success']))
            # Create VM
            with VirtualMachine(distro=self.vm_distro) as vm:
                vm.install_katello_ca()
                result = vm.register_contenthost(
                    '{0},{1}'.format(key_1_name, key_2_name),
                    self.organization.label
                )
                self.assertEqual(result.return_code, 0)
                # Assert the content-host association with activation-key
                for key_name in [key_1_name, key_2_name]:
                    name = self.activationkey.fetch_associated_content_host(
                        key_name)
                    self.assertEqual(vm.hostname, name)
Beispiel #16
0
    def test_positive_update_description(self):
        """Update Description in an Activation key

        :id: 24988466-af1d-4dcd-80b7-9c7d317fb805

        :expectedresults: Activation key is updated

        :CaseImportance: Critical
        """
        name = gen_string('alpha')
        description = gen_string('alpha')
        with Session(self) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=ENVIRONMENT,
                description=description,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            for new_desc in valid_data_list():
                with self.subTest(new_desc):
                    self.activationkey.update(name, description=new_desc)
                    selected_desc = self.activationkey.get_attribute(
                        name, locators['ak.fetch_description'])
                    self.assertEqual(selected_desc, new_desc)
    def test_associate_product_2(self):
        """@Test: Test that custom product can be associated to Activation Keys

        @Feature: Activation key - Product

        @Steps:
        1. Create Activation key
        2. Associate custom product(s) to Activation Key

        @Assert: Custom products are successfully associated to Activation key

        @BZ: 1078676

        """

        name = gen_string("alpha", 8)
        cv_name = gen_string("alpha", 8)
        env_name = gen_string("alpha", 8)
        product_name = gen_string("alpha", 8)
        # Helper function to create and promote CV to next environment
        self.create_cv(cv_name, env_name, product_name)
        with Session(self.browser) as session:
            make_activationkey(
                session, org=self.org_name, name=name, env=env_name,
                description=gen_string("alpha", 16),
                content_view=cv_name
            )
            self.assertIsNotNone(self.activationkey.search_key(name))
            self.activationkey.associate_product(name, [product_name])
            self.assertIsNotNone(self.activationkey.wait_until_element
                                 (common_locators["alert.success"]))
    def test_positive_create_activation_key_3(self, env_name):
        """@Test: Create Activation key for all variations of Environments

        @Feature: Activation key - Positive Create

        @Steps:
        1. Create Activation key for all valid Environments in [1]
        using valid Name, Description, Content View and Usage limit

        @Assert: Activation key is created

        @BZ: 1078676

        """

        name = gen_string("alpha", 8)
        cv_name = gen_string("alpha", 8)
        # Helper function to create and promote CV to next environment
        self.create_cv(cv_name, env_name)
        with Session(self.browser) as session:
            make_activationkey(
                session, org=self.org_name, name=name, env=env_name,
                description=gen_string("alpha", 16),
                content_view=cv_name
            )
            self.assertIsNotNone(self.activationkey.search_key(name))
Beispiel #19
0
    def test_associate_host(self):
        """@Test: Test that hosts can be associated to Activation Keys

        @Feature: Activation key - Host

        @Steps:
        1. Create Activation key
        2. Create different hosts
        3. Associate the hosts to Activation key

        @Assert: Hosts are successfully associated to Activation key

        """
        key_name = gen_string('utf8')
        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=key_name,
                env=ENVIRONMENT,
            )
            self.assertIsNotNone(self.activationkey.search(key_name))
            # Creating VM
            with VirtualMachine(distro=self.vm_distro) as vm:
                vm.install_katello_ca()
                vm.register_contenthost(key_name, self.organization.label)
                name = self.activationkey.fetch_associated_content_host(
                    key_name)
                self.assertEqual(vm.hostname, name)
Beispiel #20
0
    def test_associate_product_custom(self):
        """@Test: Test that custom product can be associated to Activation Keys

        @Feature: Activation key - Product

        @Assert: Custom products are successfully associated to Activation key

        """
        name = gen_string('alpha')
        cv_name = gen_string('alpha')
        env_name = gen_string('alpha')
        product_name = gen_string('alpha')
        # Helper function to create and promote CV to next environment
        repo_id = self.create_sync_custom_repo(product_name=product_name)
        self.cv_publish_promote(cv_name, env_name, repo_id)
        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=env_name,
                content_view=cv_name,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            self.activationkey.associate_product(name, [product_name])
            self.assertIsNotNone(self.activationkey.wait_until_element(
                common_locators['alert.success']))
Beispiel #21
0
    def test_positive_update_activation_key_env(self):
        """@Test: Update Environment in an Activation key

        @Feature: Activation key - Positive Update

        @Assert: Activation key is updated

        """
        name = gen_string('alpha')
        cv_name = gen_string('alpha')
        env_name = gen_string('utf8')
        # Helper function to create and promote CV to next environment
        repo_id = self.create_sync_custom_repo()
        self.cv_publish_promote(cv_name, env_name, repo_id)
        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=ENVIRONMENT,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            env_locator = locators['ak.selected_env']
            selected_env = self.activationkey.get_attribute(name, env_locator)
            self.assertEqual(ENVIRONMENT, selected_env)
            self.activationkey.update(name, content_view=cv_name, env=env_name)
            self.assertIsNotNone(self.activationkey.wait_until_element(
                common_locators['alert.success']))
            selected_env = self.activationkey.get_attribute(name, env_locator)
            self.assertEqual(env_name, selected_env)
Beispiel #22
0
    def test_positive_create_activation_key_with_hc(self):
        """@Test: Create Activation key with Host Collection

        @Feature: Activation key - Positive Create

        @Assert: Activation key is created

        """
        name = gen_string(str_type='alpha')
        # create Host Collection using API
        host_col = entities.HostCollection(
            organization=self.organization,
            name=gen_string(str_type='utf8'),
        ).create()

        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=ENVIRONMENT,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            # add Host Collection
            self.activationkey.add_host_collection(name, host_col.name)
            self.assertIsNotNone(self.activationkey.find_element(
                common_locators['alert.success']))

            # check added host collection is listed
            self.activationkey.click(tab_locators['ak.host_collections.list'])
            strategy, value = tab_locators['ak.host_collections.add.select']
            host_collection = self.activationkey.wait_until_element(
                (strategy, value % host_col.name))
            self.assertIsNotNone(host_collection)
Beispiel #23
0
    def test_positive_create_activation_key_with_envs(self):
        """@Test: Create Activation key for all variations of Environments

        @Feature: Activation key - Positive Create

        @Assert: Activation key is created

        """
        with Session(self.browser) as session:
            for env_name in valid_data_list():
                with self.subTest(env_name):
                    name = gen_string('alpha')
                    cv_name = gen_string('alpha')
                    # Helper function to create and sync custom repository
                    repo_id = self.create_sync_custom_repo()
                    # Helper function to create and promote CV to next env
                    self.cv_publish_promote(cv_name, env_name, repo_id)
                    make_activationkey(
                        session,
                        org=self.organization.name,
                        name=name,
                        env=env_name,
                        content_view=cv_name,
                    )
                    self.assertIsNotNone(self.activationkey.search(name))
Beispiel #24
0
    def test_positive_delete_with_env(self):
        """Create Activation key with environment and delete it

        @id: b6019881-3d6e-4b75-89f5-1b62aff3b1ca

        @Assert: Activation key is deleted

        @CaseLevel: Integration
        """
        name = gen_string('alpha')
        cv_name = gen_string('alpha')
        env_name = gen_string('utf8')
        # Helper function to create and promote CV to next environment
        repo_id = self.create_sync_custom_repo()
        self.cv_publish_promote(cv_name, env_name, repo_id)
        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=env_name,
                content_view=cv_name,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            self.activationkey.delete(name)
    def test_negative_create_activation_key_3(self, limit):
        """@Test: Create Activation key with invalid Usage Limit

        @Feature: Activation key - Negative Create

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

        @Assert: Activation key is not created. Appropriate error shown.

        @BZ: 1139576

        """

        name = gen_string("alpha", 10)
        with Session(self.browser) as session:
            make_activationkey(session, org=self.org_name,
                               name=name, env=ENVIRONMENT,
                               limit=limit)
            invalid = self.activationkey.wait_until_element(
                locators["ak.invalid_limit"]
            )
            self.assertIsNotNone(invalid)
            self.assertIsNone(self.activationkey.search_key(name))
    def test_negative_update_activation_key_2(self):
        """@Test: Update invalid Description in an activation key

        @Feature: Activation key - Negative Update

        @Steps:
        1. Create Activation key
        2. Update Description for all variations in [2]

        @Assert: Activation key is not updated.  Appropriate error shown.

        @BZ: 1078676

        """

        name = gen_string("alpha", 10)
        description = gen_string("alpha", 10)
        new_description = gen_string("alpha", 1001)
        with Session(self.browser) as session:
            make_activationkey(session, org=self.org_name,
                               name=name, env=ENVIRONMENT,
                               description=description)
            self.assertIsNotNone(self.activationkey.search_key(name))
            self.activationkey.update(name, description=new_description)
            self.assertIsNotNone(self.activationkey.wait_until_element
                                 (common_locators["alert.error"]))
    def test_positive_delete_activation_key_4(self, cv_name):
        """@Test: Create Activation key and delete it for all variations of
        Content Views

        @Feature: Activation key - Positive Delete

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

        @Assert: Activation key is deleted

        """

        name = gen_string("alpha", 8)
        env_name = gen_string("alpha", 6)
        # Helper function to create and promote CV to next environment
        self.create_cv(cv_name, env_name)
        with Session(self.browser) as session:
            make_activationkey(
                session, org=self.org_name, name=name, env=env_name,
                description=gen_string("alpha", 16),
                content_view=cv_name
            )
            self.assertIsNotNone(self.activationkey.search_key(name))
            self.activationkey.delete(name, True)
            self.assertIsNone(self.activationkey.search_key(name))
    def test_positive_add_multiple_aks_to_system(self):
        """Check if multiple Activation keys can be attached to a system

        @Feature: Activation key - System

        @Assert: Multiple Activation keys are attached to a system
        """
        key_1_name = gen_string('alpha')
        key_2_name = gen_string('alpha')
        cv_1_name = gen_string('alpha')
        cv_2_name = gen_string('alpha')
        env_1_name = gen_string('alpha')
        env_2_name = gen_string('alpha')
        product_1_name = gen_string('alpha')
        product_2_name = gen_string('alpha')
        # Helper function to create and promote CV to next environment
        repo_1_id = self.create_sync_custom_repo(product_name=product_1_name)
        self.cv_publish_promote(cv_1_name, env_1_name, repo_1_id)
        repo_2_id = self.create_sync_custom_repo(product_name=product_2_name,
                                                 repo_url=FAKE_2_YUM_REPO)
        self.cv_publish_promote(cv_2_name, env_2_name, repo_2_id)
        with Session(self.browser) as session:
            # Create activation_key_1
            make_activationkey(
                session,
                org=self.organization.name,
                name=key_1_name,
                env=env_1_name,
                content_view=cv_1_name,
            )
            self.assertIsNotNone(self.activationkey.search(key_1_name))
            self.activationkey.associate_product(key_1_name, [product_1_name])
            self.assertIsNotNone(
                self.activationkey.wait_until_element(
                    common_locators['alert.success']))
            # Create activation_key_2
            make_activationkey(
                session,
                org=self.organization.name,
                name=key_2_name,
                env=env_2_name,
                content_view=cv_2_name,
            )
            self.assertIsNotNone(self.activationkey.search(key_2_name))
            self.activationkey.associate_product(key_2_name, [product_2_name])
            self.assertIsNotNone(
                self.activationkey.wait_until_element(
                    common_locators['alert.success']))
            # Create VM
            with VirtualMachine(distro=self.vm_distro) as vm:
                vm.install_katello_ca()
                result = vm.register_contenthost(
                    '{0},{1}'.format(key_1_name, key_2_name),
                    self.organization.label)
                self.assertEqual(result.return_code, 0)
                # Assert the content-host association with activation-key
                for key_name in [key_1_name, key_2_name]:
                    name = self.activationkey.fetch_associated_content_host(
                        key_name)
                    self.assertEqual(vm.hostname, name)
    def test_positive_delete_activation_key_6(self):
        """@Test: Delete a Content View associated to an Activation Key

        @Feature: Activation key - Positive Delete

        @Steps:
        1. Create an Activation key with a Content View
        2. Delete the Content View

        @Assert: Activation key should not be deleted

        @BZ: 1117753

        """

        name = gen_string("alpha", 8)
        env_name = gen_string("alpha", 6)
        cv_name = gen_string("alpha", 6)
        # Helper function to create and promote CV to next environment
        self.create_cv(cv_name, env_name)
        with Session(self.browser) as session:
            make_activationkey(
                session, org=self.org_name, name=name, env=env_name,
                description=gen_string("alpha", 16),
                content_view=cv_name
            )
            self.assertIsNotNone(self.activationkey.search_key(name))
            session.nav.go_to_content_views()
            self.content_views.delete_version(cv_name, is_affected_comps=True,
                                              env=ENVIRONMENT, cv=DEFAULT_CV)
            self.content_views.delete(name, True)
            self.assertIsNone(self.content_views.search(name))
            self.assertIsNotNone(self.activationkey.search_key(name))
Beispiel #30
0
    def test_positive_create_with_envs(self):
        """Create Activation key for all variations of Environments

        @id: f75e994a-6da1-40a3-9685-f8387388b3f0

        @Assert: Activation key is created

        @CaseLevel: Integration
        """
        with Session(self.browser) as session:
            for env_name in valid_data_list():
                with self.subTest(env_name):
                    name = gen_string('alpha')
                    cv_name = gen_string('alpha')
                    # Helper function to create and sync custom repository
                    repo_id = self.create_sync_custom_repo()
                    # Helper function to create and promote CV to next env
                    self.cv_publish_promote(cv_name, env_name, repo_id)
                    make_activationkey(
                        session,
                        org=self.organization.name,
                        name=name,
                        env=env_name,
                        content_view=cv_name,
                    )
                    self.assertIsNotNone(self.activationkey.search(name))
    def test_negative_update_activation_key_3(self, test_data):
        """@Test: Update invalid Usage Limit in an activation key

        @Feature: Activation key - Negative Update

        @Steps:
        1. Create Activation key
        2. Update Usage Limit for all variations in [2]

        @Assert: Activation key is not updated.  Appropriate error shown.

        @BZ: 1078676

        """

        name = gen_string("alpha", 10)
        with Session(self.browser) as session:
            make_activationkey(session, org=self.org_name,
                               name=name, env=ENVIRONMENT)
            self.assertIsNotNone(self.activationkey.search_key(name))
            with self.assertRaises(ValueError) as context:
                self.activationkey.update(name, limit=test_data['limit'])
            self.assertEqual(context.exception.message,
                             "Please update content host limit "
                             "with valid integer value")
    def test_negative_update_activation_key_1(self, new_name):
        """@Test: Update invalid name in an activation key

        @Feature: Activation key - Negative Update

        @Steps:
        1. Create Activation key
        2. Update Activation key name for all variations in [2]

        @Assert: Activation key is not updated.  Appropriate error shown.

        @BZ: 1083875

        """

        name = gen_string("alpha", 10)
        with Session(self.browser) as session:
            make_activationkey(session, org=self.org_name,
                               name=name, env=ENVIRONMENT)
            self.assertIsNotNone(self.activationkey.search_key(name))
            self.activationkey.update(name, new_name)
            invalid = self.products.wait_until_element(common_locators
                                                       ["alert.error"])
            self.assertIsNotNone(invalid)
            self.assertIsNone(self.activationkey.search_key(new_name))
    def test_positive_create_with_envs(self):
        """Create Activation key for all variations of Environments

        @id: f75e994a-6da1-40a3-9685-f8387388b3f0

        @Assert: Activation key is created

        @CaseLevel: Integration
        """
        with Session(self.browser) as session:
            for env_name in valid_data_list():
                with self.subTest(env_name):
                    name = gen_string('alpha')
                    cv_name = gen_string('alpha')
                    # Helper function to create and sync custom repository
                    repo_id = self.create_sync_custom_repo()
                    # Helper function to create and promote CV to next env
                    self.cv_publish_promote(cv_name, env_name, repo_id)
                    make_activationkey(
                        session,
                        org=self.organization.name,
                        name=name,
                        env=env_name,
                        content_view=cv_name,
                    )
                    self.assertIsNotNone(self.activationkey.search(name))
    def test_positive_create_with_cv(self):
        """Create Activation key for all variations of Content Views

        @id: 2ad000f1-6c80-46aa-a61b-9ea62cefe91b

        @Assert: Activation key is created

        @CaseLevel: Integration
        """
        with Session(self.browser) as session:
            for cv_name in valid_data_list():
                with self.subTest(cv_name):
                    name = gen_string('alpha')
                    env_name = gen_string('alpha')
                    # Helper function to create and promote CV to next env
                    repo_id = self.create_sync_custom_repo()
                    self.cv_publish_promote(cv_name, env_name, repo_id)
                    make_activationkey(
                        session,
                        org=self.organization.name,
                        name=name,
                        env=env_name,
                        content_view=cv_name,
                    )
                    self.assertIsNotNone(self.activationkey.search(name))
    def test_positive_update_description(self):
        """Update Description in an Activation key

        :id: 24988466-af1d-4dcd-80b7-9c7d317fb805

        :expectedresults: Activation key is updated

        :CaseImportance: Critical
        """
        name = gen_string('alpha')
        description = gen_string('alpha')
        with Session(self) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=ENVIRONMENT,
                description=description,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            for new_desc in valid_data_list():
                with self.subTest(new_desc):
                    self.activationkey.update(name, description=new_desc)
                    selected_desc = self.activationkey.get_attribute(
                        name, locators['ak.fetch_description'])
                    self.assertEqual(selected_desc, new_desc)
    def test_negative_update_name(self):
        """Update invalid name in an activation key

        :id: 6eb0f747-cd4d-421d-b11e-b8917bb0cec6

        :expectedresults: Activation key is not updated.  Appropriate error
            shown.

        :CaseImportance: Critical
        """
        name = gen_string('alpha', 10)
        with Session(self) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=ENVIRONMENT,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            for new_name in invalid_names_list():
                with self.subTest(new_name):
                    self.activationkey.update(name, new_name)
                    self.assertIsNotNone(self.activationkey.wait_until_element(
                        common_locators['alert.error_sub_form']))
                    self.assertIsNone(self.activationkey.search(new_name))
    def test_positive_add_custom_product(self):
        """Test that custom product can be associated to Activation Keys

        @Feature: Activation key - Product

        @Assert: Custom products are successfully associated to Activation key
        """
        name = gen_string('alpha')
        cv_name = gen_string('alpha')
        env_name = gen_string('alpha')
        product_name = gen_string('alpha')
        # Helper function to create and promote CV to next environment
        repo_id = self.create_sync_custom_repo(product_name=product_name)
        self.cv_publish_promote(cv_name, env_name, repo_id)
        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=env_name,
                content_view=cv_name,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            self.activationkey.associate_product(name, [product_name])
            self.assertIsNotNone(
                self.activationkey.wait_until_element(
                    common_locators['alert.success']))
    def test_negative_create_with_invalid_limit(self):
        """Create Activation key with invalid Usage Limit. Both with too
        long numbers and using letters.

        :id: 71ecf5b2-ce4f-41b0-b30d-45f89713f8c1

        :expectedresults: Activation key is not created. Appropriate error
            shown.

        :CaseLevel: Integration
        """
        with Session(self) as session:
            for limit in invalid_names_list():
                with self.subTest(limit):
                    name = gen_string('alpha')
                    make_activationkey(
                        session,
                        org=self.organization.name,
                        name=name,
                        env=ENVIRONMENT,
                        limit=limit,
                    )
                    self.assertIsNotNone(self.activationkey.wait_until_element(
                        common_locators['invalid_limit']))
                    self.assertIsNone(self.activationkey.search(name))
    def test_negative_update_limit(self):
        """Update invalid Usage Limit in an activation key

        @id: d42d8b6a-d3f4-4baa-be20-127f52f2313e

        @Assert: Activation key is not updated.  Appropriate error shown.
        """
        name = gen_string('alpha')
        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=ENVIRONMENT,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            for limit in ' ', -1, 'text', '0':
                with self.subTest(limit):
                    with self.assertRaises(ValueError) as context:
                        self.activationkey.update(name, limit=limit)
                    self.assertEqual(
                        context.exception.message,
                        'Please update content host limit with valid ' +
                        'integer value'
                    )
    def test_positive_add_host(self):
        """Test that hosts can be associated to Activation Keys

        @Feature: Activation key - Host

        @Steps:
        1. Create Activation key
        2. Create different hosts
        3. Associate the hosts to Activation key

        @Assert: Hosts are successfully associated to Activation key
        """
        key_name = gen_string('utf8')
        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=key_name,
                env=ENVIRONMENT,
            )
            self.assertIsNotNone(self.activationkey.search(key_name))
            # Creating VM
            with VirtualMachine(distro=self.vm_distro) as vm:
                vm.install_katello_ca()
                vm.register_contenthost(key_name, self.organization.label)
                name = self.activationkey.fetch_associated_content_host(
                    key_name)
                self.assertEqual(vm.hostname, name)
    def test_positive_update_env(self):
        """Update Environment in an Activation key

        @Feature: Activation key - Positive Update

        @Assert: Activation key is updated
        """
        name = gen_string('alpha')
        cv_name = gen_string('alpha')
        env_name = gen_string('utf8')
        # Helper function to create and promote CV to next environment
        repo_id = self.create_sync_custom_repo()
        self.cv_publish_promote(cv_name, env_name, repo_id)
        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=ENVIRONMENT,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            env_locator = locators['ak.selected_env']
            selected_env = self.activationkey.get_attribute(name, env_locator)
            self.assertEqual(ENVIRONMENT, selected_env)
            self.activationkey.update(name, content_view=cv_name, env=env_name)
            self.assertIsNotNone(
                self.activationkey.wait_until_element(
                    common_locators['alert.success']))
            selected_env = self.activationkey.get_attribute(name, env_locator)
            self.assertEqual(env_name, selected_env)
    def test_positive_add_host(self):
        """Test that hosts can be associated to Activation Keys

        @id: 886e9ea5-d917-40e0-a3b1-41254c4bf5bf

        @Steps:
        1. Create Activation key
        2. Create different hosts
        3. Associate the hosts to Activation key

        @Assert: Hosts are successfully associated to Activation key

        @CaseLevel: System
        """
        key_name = gen_string('utf8')
        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=key_name,
                env=ENVIRONMENT,
            )
            self.assertIsNotNone(self.activationkey.search(key_name))
            # Creating VM
            with VirtualMachine(distro=self.vm_distro) as vm:
                vm.install_katello_ca()
                vm.register_contenthost(self.organization.label, key_name)
                name = self.activationkey.fetch_associated_content_host(
                    key_name)
                self.assertEqual(vm.hostname, name)
    def test_positive_add_custom_product(self):
        """Test that custom product can be associated to Activation Keys

        @id: e66db2bf-517a-46ff-ba23-9f9744bef884

        @Assert: Custom products are successfully associated to Activation key

        @CaseLevel: Integration
        """
        name = gen_string('alpha')
        cv_name = gen_string('alpha')
        env_name = gen_string('alpha')
        product_name = gen_string('alpha')
        # Helper function to create and promote CV to next environment
        repo_id = self.create_sync_custom_repo(product_name=product_name)
        self.cv_publish_promote(cv_name, env_name, repo_id)
        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=env_name,
                content_view=cv_name,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            self.activationkey.associate_product(name, [product_name])
            self.assertIsNotNone(self.activationkey.wait_until_element(
                common_locators['alert.success_sub_form']))
Beispiel #44
0
    def test_negative_create_with_invalid_limit(self):
        """Create Activation key with invalid Usage Limit. Both with too
        long numbers and using letters.

        :id: 71ecf5b2-ce4f-41b0-b30d-45f89713f8c1

        :expectedresults: Activation key is not created. Appropriate error
            shown.

        :CaseLevel: Integration
        """
        with Session(self) as session:
            for limit in invalid_names_list():
                with self.subTest(limit):
                    name = gen_string('alpha')
                    make_activationkey(
                        session,
                        org=self.organization.name,
                        name=name,
                        env=ENVIRONMENT,
                        limit=limit,
                    )
                    self.assertIsNotNone(self.activationkey.wait_until_element(
                        common_locators['invalid_limit']))
                    self.assertIsNone(self.activationkey.search(name))
Beispiel #45
0
    def test_positive_add_rh_product(self):
        """Test that RH product can be associated to Activation Keys

        @id: d805341b-6d2f-4e16-8cb4-902de00b9a6c

        @Assert: RH products are successfully associated to Activation key

        @CaseLevel: Integration
        """
        name = gen_string('alpha')
        cv_name = gen_string('alpha')
        env_name = gen_string('alpha')
        rh_repo = {
            'name': ('Red Hat Enterprise Virtualization Agents for RHEL 6 '
                     'Server RPMs x86_64 6Server'),
            'product':
            'Red Hat Enterprise Linux Server',
            'reposet': ('Red Hat Enterprise Virtualization Agents '
                        'for RHEL 6 Server (RPMs)'),
            'basearch':
            'x86_64',
            'releasever':
            '6Server',
        }
        product_subscription = DEFAULT_SUBSCRIPTION_NAME
        # Create new org to import manifest
        org = entities.Organization().create()
        # Upload manifest
        with manifests.clone() as manifest:
            upload_manifest(org.id, manifest.content)
        # Helper function to create and promote CV to next environment
        repo_id = self.enable_sync_redhat_repo(rh_repo, org_id=org.id)
        self.cv_publish_promote(cv_name, env_name, repo_id, org.id)
        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=org.name,
                name=name,
                env=env_name,
                content_view=cv_name,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            self.activationkey.associate_product(name, [product_subscription])
            self.assertIsNotNone(
                self.activationkey.wait_until_element(
                    common_locators['alert.success_sub_form']))
    def test_positive_create_with_usage_limit(self):
        """Create Activation key with finite Usage limit

        @Feature: Activation key - Positive Create

        @Assert: Activation key is created
        """
        name = gen_string('alpha')
        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=ENVIRONMENT,
                limit='6',
            )
            self.assertIsNotNone(self.activationkey.search(name))
    def test_positive_create_with_description(self):
        """Create Activation key with description

        @Feature: Activation key - Positive Create

        @Assert: Activation key is created
        """
        name = gen_string('alpha')
        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=ENVIRONMENT,
                description=gen_string('utf8'),
            )
            self.assertIsNotNone(self.activationkey.search(name))
Beispiel #48
0
    def test_positive_create_with_usage_limit(self):
        """Create Activation key with finite Usage limit

        @id: cd45363e-8a79-4aa4-be97-885aea9434c9

        @Assert: Activation key is created
        """
        name = gen_string('alpha')
        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=ENVIRONMENT,
                limit='6',
            )
            self.assertIsNotNone(self.activationkey.search(name))
Beispiel #49
0
    def test_positive_create_with_description(self):
        """Create Activation key with description

        @id: 4c8f4dca-723f-4dae-a8df-4e00a7fc7d95

        @Assert: Activation key is created
        """
        name = gen_string('alpha')
        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=ENVIRONMENT,
                description=gen_string('utf8'),
            )
            self.assertIsNotNone(self.activationkey.search(name))
    def test_positive_create_with_name(self):
        """Create Activation key for all variations of Activation key
        name

        @Feature: Activation key - Positive Create

        @Assert: Activation key is created
        """
        with Session(self.browser) as session:
            for name in valid_data_list():
                with self.subTest(name):
                    make_activationkey(
                        session,
                        org=self.organization.name,
                        name=name,
                        env=ENVIRONMENT,
                    )
                    self.assertIsNotNone(self.activationkey.search(name))
Beispiel #51
0
    def test_positive_update_cv(self):
        """Update Content View in an Activation key

        @id: 68880ca6-acb9-4a16-aaa0-ced680126732

        @Steps:
        1. Create Activation key
        2. Update the Content view with another Content view which has custom
        products

        @Assert: Activation key is updated

        @CaseLevel: Integration
        """
        # Pick one of the valid data list items - data driven tests is not
        # necessary for this test
        cv2_name = random.choice(valid_data_list())
        name = gen_string('alpha')
        env1_name = gen_string('alpha')
        env2_name = gen_string('alpha')
        cv1_name = gen_string('alpha')
        # Helper function to create and promote CV to next environment
        repo1_id = self.create_sync_custom_repo()
        self.cv_publish_promote(cv1_name, env1_name, repo1_id)
        repo2_id = self.create_sync_custom_repo()
        self.cv_publish_promote(cv2_name, env2_name, repo2_id)
        with Session(self.browser) as session:
            make_activationkey(session,
                               org=self.organization.name,
                               name=name,
                               env=env1_name,
                               content_view=cv1_name)
            self.assertIsNotNone(self.activationkey.search(name))
            cv_locator = locators['ak.selected_cv']
            selected_cv = self.activationkey.get_attribute(name, cv_locator)
            self.assertEqual(cv1_name, selected_cv)
            self.activationkey.update(name,
                                      content_view=cv2_name,
                                      env=env2_name)
            self.assertIsNotNone(
                self.activationkey.wait_until_element(
                    common_locators['alert.success_sub_form']))
            selected_cv = self.activationkey.get_attribute(name, cv_locator)
            self.assertEqual(cv2_name, selected_cv)
Beispiel #52
0
    def test_positive_create_with_description(self):
        """Create Activation key with description

        :id: 4c8f4dca-723f-4dae-a8df-4e00a7fc7d95

        :expectedresults: Activation key is created

        :CaseImportance: Critical
        """
        name = gen_string('alpha')
        with Session(self) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=ENVIRONMENT,
                description=gen_string('utf8'),
            )
            self.assertIsNotNone(self.activationkey.search(name))
Beispiel #53
0
    def test_negative_usage_limit(self):
        """Test that Usage limit actually limits usage

        @id: 9fe2d661-66f8-46a4-ae3f-0a9329494bdd

        @Steps:
        1. Create Activation key
        2. Update Usage Limit to a finite number
        3. Register Systems to match the Usage Limit
        4. Attempt to register an other system after reaching the Usage Limit

        @Assert: System Registration fails. Appropriate error shown

        @CaseLevel: System
        """
        name = gen_string('alpha')
        host_limit = '1'
        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=ENVIRONMENT,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            self.activationkey.update(name, limit=host_limit)
            self.assertIsNotNone(
                self.activationkey.wait_until_element(
                    common_locators['alert.success_sub_form']))
            with VirtualMachine(distro=self.vm_distro) as vm1:
                with VirtualMachine(distro=self.vm_distro) as vm2:
                    vm1.install_katello_ca()
                    result = vm1.register_contenthost(self.organization.label,
                                                      name)
                    self.assertEqual(result.return_code, 0)
                    vm2.install_katello_ca()
                    result = vm2.register_contenthost(self.organization.label,
                                                      name)
                    self.assertNotEqual(result.return_code, 0)
                    self.assertGreater(len(result.stderr), 0)
                    self.assertIn(
                        'Max Hosts ({0}) reached for activation key'.format(
                            host_limit), result.stderr)
Beispiel #54
0
    def test_positive_create_with_usage_limit(self):
        """Create Activation key with finite Usage limit

        :id: cd45363e-8a79-4aa4-be97-885aea9434c9

        :expectedresults: Activation key is created

        :CaseImportance: Critical
        """
        name = gen_string('alpha')
        with Session(self) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=ENVIRONMENT,
                limit='6',
            )
            self.assertIsNotNone(self.activationkey.search(name))
Beispiel #55
0
    def test_positive_create_with_name(self):
        """Create Activation key for all variations of Activation key
        name

        :id: 091f1034-9850-4004-a0ca-d398d1626a5e

        :expectedresults: Activation key is created

        :CaseImportance: Critical
        """
        with Session(self) as session:
            for name in valid_data_list():
                with self.subTest(name):
                    make_activationkey(
                        session,
                        org=self.organization.name,
                        name=name,
                        env=ENVIRONMENT,
                    )
                    self.assertIsNotNone(self.activationkey.search(name))
    def test_negative_create_with_invalid_name(self):
        """Create Activation key with invalid Name

        @Feature: Activation key - Negative Create

        @Assert: Activation key is not created. Appropriate error shown.
        """
        with Session(self.browser) as session:
            for name in invalid_names_list():
                with self.subTest(name):
                    make_activationkey(
                        session,
                        org=self.organization.name,
                        name=name,
                        env=ENVIRONMENT,
                    )
                    self.assertIsNotNone(
                        self.activationkey.wait_until_element(
                            common_locators['common_invalid']))
                    self.assertIsNone(self.activationkey.search(name))
    def test_positive_delete(self):
        """Create Activation key and delete it for all variations of
        Activation key name

        @Feature: Activation key - Positive Delete

        @Assert: Activation key is deleted
        """
        with Session(self.browser) as session:
            for name in valid_data_list():
                with self.subTest(name):
                    make_activationkey(
                        session,
                        org=self.organization.name,
                        name=name,
                        env=ENVIRONMENT,
                        description=gen_string('utf8'),
                    )
                    self.assertIsNotNone(self.activationkey.search(name))
                    self.activationkey.delete(name)
    def test_positive_update_limit(self):
        """Update Usage limit from Unlimited to a finite number

        @Feature: Activation key - Positive Update

        @Assert: Activation key is updated
        """
        name = gen_string('alpha')
        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=ENVIRONMENT,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            self.activationkey.update(name, limit='8')
            self.assertIsNotNone(
                self.activationkey.wait_until_element(
                    common_locators['alert.success']))
Beispiel #59
0
    def test_positive_update_limit_to_unlimited(self):
        """Update Usage limit from definite number to Unlimited

        @id: 2585ac91-baf0-43de-ba6e-862415402e62

        @Assert: Activation key is updated
        """
        name = gen_string('alpha')
        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=ENVIRONMENT,
                limit='6',
            )
            self.assertIsNotNone(self.activationkey.search(name))
            self.activationkey.update(name, limit='Unlimited')
            self.assertIsNotNone(
                self.activationkey.wait_until_element(
                    common_locators['alert.success_sub_form']))
    def test_positive_update_name(self):
        """Update Activation Key Name in an Activation key

        @Feature: Activation key - Positive Update

        @Assert: Activation key is updated
        """
        name = gen_string('alpha', 10)
        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=ENVIRONMENT,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            for new_name in valid_data_list():
                with self.subTest(new_name):
                    self.activationkey.update(name, new_name)
                    self.assertIsNotNone(self.activationkey.search(new_name))
                    name = new_name