示例#1
0
    def test_positive_update_environment(self):
        """Add and Remove environment by using org & environment name.

        :id: 270de90d-062e-4893-89c9-f6d0665ab967

        :expectedresults: environment is added then removed from Organization.

        :CaseLevel: Integration
        """
        with Session(self) as session:
            org_name = gen_string('alpha')
            make_org(session, org_name=org_name)
            for environment_name in valid_env_names():
                with self.subTest(environment_name):
                    # Create environment using nailgun
                    environment = entities.Environment(
                        name=environment_name).create()
                    self.assertEqual(environment.name, environment_name)
                    kwargs = {
                        'org_name': org_name,
                        'entity_type': 'envs',
                        'entity_name': environment_name
                    }
                    self.assertIsNotNone(self.org.add_entity(**kwargs))
                    self.assertIsNotNone(self.org.remove_entity(**kwargs))
示例#2
0
 def setUp(self):
     super(Sync, self).setUp()
     # Make sure to use the Class' org_name instance
     if Sync.org_name is None:
         Sync.org_name = generate_string("alpha", 10)
         with Session(self.browser) as session:
             make_org(session, org_name=Sync.org_name)
示例#3
0
    def test_positive_remove_environment(self):
        """Remove environment by using org & environment name.

        @feature: Organizations dis-associate environment.

        @assert: environment is removed from Organization.
        """
        strategy, value = common_locators["entity_select"]
        strategy1, value1 = common_locators["entity_deselect"]
        with Session(self.browser) as session:
            for env_name in valid_env_names():
                with self.subTest(env_name):
                    org_name = gen_string("alpha")
                    # Create environment using nailgun
                    env = entities.Environment(name=env_name).create_json()
                    self.assertEqual(env["name"], env_name)
                    make_org(session, org_name=org_name, envs=[env_name])
                    self.org.search(org_name).click()
                    session.nav.click(tab_locators["context.tab_env"])
                    element = session.nav.wait_until_element((strategy1, value1 % env_name))
                    # Item is listed in 'Selected Items' list and not
                    # 'All Items' list.
                    self.assertIsNotNone(element)
                    self.org.update(org_name, envs=[env_name])
                    self.org.search(org_name).click()
                    session.nav.click(tab_locators["context.tab_env"])
                    element = session.nav.wait_until_element((strategy, value % env_name))
                    # Item is listed in 'All Items' list and not
                    # 'Selected Items' list.
                    self.assertIsNotNone(element)
示例#4
0
    def test_remove_hostgroup_1(self, host_grp_name):
        """@test: Add a hostgroup and remove it by using the organization
        name and hostgroup name.

        @feature: Organizations remove hostgroup.

        @assert: hostgroup is added to organization then removed.

        """
        strategy, value = common_locators["entity_select"]
        strategy1, value1 = common_locators["entity_deselect"]
        org_name = gen_string("alpha", 8)
        host_grp = entities.HostGroup(name=host_grp_name).create()
        self.assertEqual(host_grp['name'], host_grp_name)
        with Session(self.browser) as session:
            make_org(session, org_name=org_name, hostgroups=[host_grp_name])
            self.org.search(org_name).click()
            session.nav.wait_until_element(
                tab_locators["context.tab_hostgrps"]).click()
            element = session.nav.wait_until_element((strategy1,
                                                      value1 % host_grp_name))
            # Item is listed in 'Selected Items' list and not 'All Items' list.
            self.assertIsNotNone(element)
            self.org.update(org_name, hostgroups=[host_grp_name],
                            new_hostgroups=None)
            self.org.search(org_name).click()
            session.nav.wait_until_element(
                tab_locators["context.tab_hostgrps"]).click()
            element = session.nav.wait_until_element((strategy,
                                                      value % host_grp_name))
            # Item is listed in 'All Items' list and not 'Selected Items' list.
            self.assertIsNotNone(element)
示例#5
0
    def test_positive_remove_template(self):
        """Remove config template.

        @feature: Organizations dissociate config templates.

        @assert: Config Template is added and then removed.
        """
        strategy, value = common_locators["entity_select"]
        strategy1, value1 = common_locators["entity_deselect"]
        with Session(self.browser) as session:
            for template_name in generate_strings_list():
                with self.subTest(template_name):
                    org_name = gen_string("alpha")
                    # Create config template using nailgun
                    entities.ConfigTemplate(name=template_name).create()
                    make_org(session, org_name=org_name, templates=[template_name])
                    self.org.search(org_name).click()
                    session.nav.click(tab_locators["context.tab_template"])
                    element = session.nav.wait_until_element((strategy1, value1 % template_name))
                    # Item is listed in 'Selected Items' list and not
                    # 'All Items' list.
                    self.assertIsNotNone(element)
                    self.org.update(org_name, templates=[template_name])
                    self.org.search(org_name).click()
                    session.nav.click(tab_locators["context.tab_template"])
                    element = self.org.wait_until_element((strategy, value % template_name))
                    # Item is listed in 'All Items' list and not
                    # 'Selected Items' list.
                    self.assertIsNotNone(element)
示例#6
0
    def test_remove_user(self, user_name):
        """@test: Create admin users then add user and remove it
        by using the organization name.

        @feature: Organizations Disassociate user.

        @assert: The user is added then removed from the organization

        """
        strategy, value = common_locators['entity_select']
        strategy1, value1 = common_locators['entity_deselect']
        org_name = gen_string('alpha')
        user = entities.User(
            login=user_name,
            firstname=user_name,
            lastname=user_name,
            password=gen_string('alpha'),
        ).create()
        self.assertEqual(user.login, user_name)
        with Session(self.browser) as session:
            make_org(session, org_name=org_name, users=[user_name])
            self.org.search(org_name).click()
            session.nav.click(tab_locators['context.tab_users'])
            element = session.nav.wait_until_element((strategy1,
                                                      value1 % user_name))
            # Item is listed in 'Selected Items' list and not 'All Items' list.
            self.assertIsNotNone(element)
            self.org.update(org_name, users=[user_name], new_users=None)
            self.org.search(org_name).click()
            session.nav.click(tab_locators['context.tab_users'])
            element = session.nav.wait_until_element((strategy,
                                                      value % user_name))
            # Item is listed in 'All Items' list and not 'Selected Items' list.
            self.assertIsNotNone(element)
示例#7
0
    def test_positive_remove_user(self):
        """Create admin users then add user and remove it
        by using the organization name.

        @feature: Organizations Disassociate user.

        @assert: The user is added then removed from the organization
        """
        strategy, value = common_locators["entity_select"]
        strategy1, value1 = common_locators["entity_deselect"]
        with Session(self.browser) as session:
            for user_name in valid_users():
                with self.subTest(user_name):
                    org_name = gen_string("alpha")
                    # Use nailgun to create user
                    user = entities.User(
                        login=user_name, firstname=user_name, lastname=user_name, password=gen_string("alpha")
                    ).create()
                    self.assertEqual(user.login, user_name)
                    make_org(session, org_name=org_name, users=[user_name])
                    self.org.search(org_name).click()
                    session.nav.click(tab_locators["context.tab_users"])
                    element = session.nav.wait_until_element((strategy1, value1 % user_name))
                    # Item is listed in 'Selected Items' list and not
                    # 'All Items' list.
                    self.assertIsNotNone(element)
                    self.org.update(org_name, users=[user_name], new_users=None)
                    self.org.search(org_name).click()
                    session.nav.click(tab_locators["context.tab_users"])
                    element = session.nav.wait_until_element((strategy, value % user_name))
                    # Item is listed in 'All Items' list and not
                    # 'Selected Items' list.
                    self.assertIsNotNone(element)
示例#8
0
    def test_positive_remove_compresource(self):
        """Remove compute resource using the organization name and
        compute resource name.

        @feature: Organizations dis-associate compute-resource.

        @assert: compute resource is added then removed.
        """
        strategy, value = common_locators["entity_select"]
        strategy1, value1 = common_locators["entity_deselect"]
        with Session(self.browser) as session:
            for resource_name in generate_strings_list():
                with self.subTest(resource_name):
                    org_name = gen_string("alpha")
                    url = LIBVIRT_RESOURCE_URL % settings.server.hostname
                    # Create compute resource using nailgun
                    resource = entities.LibvirtComputeResource(name=resource_name, url=url).create()
                    self.assertEqual(resource.name, resource_name)
                    make_org(session, org_name=org_name, resources=[resource_name])
                    self.org.search(org_name).click()
                    session.nav.click(tab_locators["context.tab_resources"])
                    element = session.nav.wait_until_element((strategy1, value1 % resource_name))
                    # Item is listed in 'Selected Items' list and not
                    # 'All Items' list.
                    self.assertIsNotNone(element)
                    self.org.update(org_name, resources=[resource_name], new_resources=None)
                    self.org.search(org_name).click()
                    session.nav.click(tab_locators["context.tab_resources"])
                    element = session.nav.wait_until_element((strategy, value % resource_name))
                    # Item is listed in 'All Items' list and not
                    # 'Selected Items' list.
                    self.assertIsNotNone(element)
示例#9
0
    def test_add_medium_1(self, medium_name):
        """@test: Add medium by using the organization name and medium name.

        @feature: Organizations associate medium.

        @assert: medium is added.

        """
        strategy, value = common_locators["entity_deselect"]
        org_name = gen_string("alpha", 8)
        path = URL % gen_string("alpha", 6)
        medium = entities.Media(
            name=medium_name,
            media_path=path,
            os_family='Redhat',
        ).create()
        self.assertEqual(medium['name'], medium_name)
        with Session(self.browser) as session:
            make_org(session, org_name=org_name)
            self.assertIsNotNone(self.org.search(org_name))
            self.org.update(org_name, new_medias=[medium_name])
            self.org.search(org_name).click()
            session.nav.wait_until_element(
                tab_locators["context.tab_media"]).click()
            element = session.nav.wait_until_element((strategy,
                                                      value % medium_name))
            self.assertIsNotNone(element)
示例#10
0
    def test_remove_environment_1(self, env_name):
        """@test: Remove environment by using org & evironment name.

        @feature: Organizations dis-associate environment.

        @assert: environment is removed from Organization.

        """
        strategy, value = common_locators["entity_select"]
        strategy1, value1 = common_locators["entity_deselect"]
        org_name = gen_string("alpha", 8)
        env = entities.Environment(name=env_name).create()
        self.assertEqual(env['name'], env_name)
        with Session(self.browser) as session:
            make_org(session, org_name=org_name, envs=[env_name])
            self.org.search(org_name).click()
            session.nav.wait_until_element(
                tab_locators["context.tab_env"]).click()
            element = session.nav.wait_until_element((strategy1,
                                                      value1 % env_name))
            # Item is listed in 'Selected Items' list and not 'All Items' list.
            self.assertIsNotNone(element)
            self.org.update(org_name, envs=[env_name])
            self.org.search(org_name).click()
            session.nav.wait_until_element(
                tab_locators["context.tab_env"]).click()
            element = session.nav.wait_until_element((strategy,
                                                      value % env_name))
            # Item is listed in 'All Items' list and not 'Selected Items' list.
            self.assertIsNotNone(element)
示例#11
0
    def test_positive_update_domain(self):
        """Add a domain to an organization and remove it by organization
        name and domain name.

        :id: a49e86c7-f859-4120-b59e-3f89e99a9054

        :expectedresults: the domain is added and removed from the organization

        :CaseLevel: Integration
        """

        with Session(self) as session:
            org_name = gen_string('alpha')
            make_org(session, org_name=org_name)
            for domain_name in generate_strings_list():
                with self.subTest(domain_name):
                    domain = entities.Domain(name=domain_name).create()
                    self.assertEqual(domain.name, domain_name)
                    kwargs = {
                        'org_name': org_name,
                        'entity_type': 'domains',
                        'entity_name': domain_name
                    }
                    self.assertIsNotNone(self.org.add_entity(**kwargs))
                    self.assertIsNotNone(self.org.remove_entity(**kwargs))
示例#12
0
    def test_remove_configtemplate_1(self, template_name):
        """@test: Remove config template.

        @feature: Organizations dissociate config templates.

        @assert: configtemplate is added then removed.

        @BZ: 1129612

        """
        strategy, value = common_locators["entity_select"]
        strategy1, value1 = common_locators["entity_deselect"]
        org_name = gen_string("alpha", 8)
        entities.ConfigTemplate(name=template_name).create()
        with Session(self.browser) as session:
            make_org(session, org_name=org_name, templates=[template_name])
            self.org.search(org_name).click()
            session.nav.wait_until_element(
                tab_locators["context.tab_template"]).click()
            element = session.nav.wait_until_element(
                (strategy1, value1 % template_name))
            # Item is listed in 'Selected Items' list and not 'All Items' list.
            self.assertIsNotNone(element)
            self.org.update(org_name, templates=[template_name])
            self.org.search(org_name).click()
            session.nav.wait_until_element(
                tab_locators["context.tab_template"]).click()
            element = self.org.wait_until_element(
                (strategy, value % template_name))
            # Item is listed in 'All Items' list and not 'Selected Items' list.
            self.assertIsNotNone(element)
示例#13
0
    def test_add_medium(self, medium_name):
        """@test: Add medium by using the organization name and medium name.

        @feature: Organizations associate medium.

        @assert: medium is added.

        """
        strategy, value = common_locators['entity_deselect']
        org_name = gen_string('alpha')
        medium = entities.Media(
            name=medium_name,
            path_=INSTALL_MEDIUM_URL % gen_string('alpha', 6),
            os_family='Redhat',
        ).create()
        self.assertEqual(medium.name, medium_name)
        with Session(self.browser) as session:
            make_org(session, org_name=org_name)
            self.assertIsNotNone(self.org.search(org_name))
            self.org.update(org_name, new_medias=[medium_name])
            self.org.search(org_name).click()
            session.nav.click(tab_locators['context.tab_media'])
            element = session.nav.wait_until_element((strategy,
                                                      value % medium_name))
            self.assertIsNotNone(element)
示例#14
0
    def test_remove_subnet(self, subnet_name):
        """@test: Remove subnet by using organization name and subnet name.

        @feature: Organizations dis-associate subnet.

        @assert: subnet is added then removed.

        """
        strategy, value = common_locators['entity_select']
        strategy1, value1 = common_locators['entity_deselect']
        org_name = gen_string('alpha')
        subnet = entities.Subnet(
            name=subnet_name,
            network=gen_ipaddr(ip3=True),
            mask='255.255.255.0',
        ).create()
        self.assertEqual(subnet.name, subnet_name)
        with Session(self.browser) as session:
            make_org(session, org_name=org_name, subnets=[subnet_name])
            self.org.search(org_name).click()
            session.nav.click(tab_locators['context.tab_subnets'])
            element = session.nav.wait_until_element((strategy1,
                                                      value1 % subnet_name))
            # Item is listed in 'Selected Items' list and not 'All Items' list.
            self.assertIsNotNone(element)
            self.org.update(org_name, subnets=[subnet_name])
            self.org.search(org_name).click()
            session.nav.click(tab_locators['context.tab_subnets'])
            element = session.nav.wait_until_element((strategy,
                                                      value % subnet_name))
            # Item is listed in 'All Items' list and not 'Selected Items' list.
            self.assertIsNotNone(element)
示例#15
0
    def test_add_computeresource(self, resource_name):
        """@test: Add compute resource using the organization
        name and compute resource name.

        @feature: Organizations associate compute resource.

        @assert: compute resource is added.

        """
        strategy, value = common_locators['entity_deselect']
        org_name = gen_string('alpha')
        url = (LIBVIRT_RESOURCE_URL % conf.properties['main.server.hostname'])
        resource = entities.LibvirtComputeResource(
            name=resource_name,
            url=url,
        ).create()
        self.assertEqual(resource.name, resource_name)
        with Session(self.browser) as session:
            make_org(session, org_name=org_name)
            self.assertIsNotNone(self.org.search(org_name))
            self.org.update(org_name, new_resources=[resource_name])
            self.org.search(org_name).click()
            session.nav.click(tab_locators['context.tab_resources'])
            element = session.nav.wait_until_element((strategy,
                                                      value % resource_name))
            self.assertIsNotNone(element)
示例#16
0
    def test_remove_medium(self, medium_name):
        """@test: Remove medium by using organization name and medium name.

        @feature: Organizations disassociate installation media.

        @assert: medium is added then removed.

        """
        strategy, value = common_locators['entity_select']
        strategy1, value1 = common_locators['entity_deselect']
        org_name = gen_string('alpha')
        medium = entities.Media(
            name=medium_name,
            path_=INSTALL_MEDIUM_URL % gen_string('alpha', 6),
            os_family='Redhat',
        ).create()
        self.assertEqual(medium.name, medium_name)
        with Session(self.browser) as session:
            make_org(session, org_name=org_name,
                     medias=[medium_name])
            self.org.search(org_name).click()
            session.nav.click(tab_locators['context.tab_media'])
            element = session.nav.wait_until_element((strategy1,
                                                      value1 % medium_name))
            # Item is listed in 'Selected Items' list and not 'All Items' list.
            self.assertIsNotNone(element)
            self.navigator.go_to_org()
            self.org.update(org_name, medias=[medium_name],
                            new_medias=None)
            self.org.search(org_name).click()
            session.nav.click(tab_locators['context.tab_media'])
            element = session.nav.wait_until_element((strategy,
                                                      value % medium_name))
            # Item is listed in 'All Items' list and not 'Selected Items' list.
            self.assertIsNotNone(element)
示例#17
0
    def test_add_user(self, user_name):
        """@test: Create different types of users then add user using
        organization name.

        @feature: Organizations associate user.

        @assert: User is added to organization.

        """
        strategy, value = common_locators['entity_deselect']
        org_name = gen_string('alpha')
        user = entities.User(
            login=user_name,
            firstname=user_name,
            lastname=user_name,
            password=gen_string('alpha')
        ).create()
        self.assertEqual(user.login, user_name)
        with Session(self.browser) as session:
            make_org(session, org_name=org_name)
            self.assertIsNotNone(self.org.search(org_name))
            self.org.update(org_name, new_users=[user_name])
            self.org.search(org_name).click()
            session.nav.click(tab_locators['context.tab_users'])
            element = session.nav.wait_until_element((strategy,
                                                      value % user_name))
            self.assertIsNotNone(element)
示例#18
0
    def test_add_subnet_1(self, subnet_name):
        """@test: Add a subnet by using organization name and subnet name.

        @feature: Organizations associate subnet.

        @assert: subnet is added.

        """
        strategy, value = common_locators["entity_deselect"]
        org_name = gen_string("alpha", 8)
        subnet_network = gen_ipaddr(ip3=True)
        subnet_mask = "255.255.255.0"
        subnet = entities.Subnet(
            name=subnet_name,
            network=subnet_network,
            mask=subnet_mask
        ).create()
        self.assertEqual(subnet['name'], subnet_name)
        with Session(self.browser) as session:
            make_org(session, org_name=org_name)
            self.assertIsNotNone(self.org.search(org_name))
            self.org.update(org_name, new_subnets=[subnet_name])
            self.org.search(org_name).click()
            self.org.wait_until_element(
                tab_locators["context.tab_subnets"]).click()
            element = session.nav.wait_until_element((strategy,
                                                      value % subnet_name))
            self.assertIsNotNone(element)
示例#19
0
    def test_positive_update_user(self):
        """Create admin users then add user and remove it
        by using the organization name.

        :id: 01a221f7-d0fe-4b46-ab5c-b4e861677126

        :expectedresults: The user is added then removed from the organization

        :CaseLevel: Integration
        """
        with Session(self) as session:
            org_name = gen_string('alpha')
            make_org(session, org_name=org_name)
            for user_name in valid_users():
                with self.subTest(user_name):
                    # Use nailgun to create user
                    user = entities.User(
                        login=user_name,
                        firstname=user_name,
                        lastname=user_name,
                        password=gen_string('alpha'),
                    ).create()
                    self.assertEqual(user.login, user_name)
                    kwargs = {
                        'org_name': org_name,
                        'entity_type': 'users',
                        'entity_name': user_name
                    }
                    self.assertIsNotNone(self.org.add_entity(**kwargs))
                    self.assertIsNotNone(self.org.remove_entity(
                        **kwargs))
示例#20
0
    def test_add_user_2(self, test_data):
        """@test: Create different types of users then add user
        by using the organization name.

        @feature: Organizations associate user.

        @assert: User is added to organization.

        """
        user_name = test_data['user_name']
        strategy, value = common_locators["entity_deselect"]
        org_name = gen_string("alpha", 8)
        password = gen_string("alpha", 8)
        user = entities.User(
            login=user_name,
            firstname=user_name,
            lastname=user_name,
            password=password).create()
        self.assertEqual(user['login'], user_name)
        with Session(self.browser) as session:
            make_org(session, org_name=org_name)
            self.assertIsNotNone(self.org.search(org_name))
            self.org.update(org_name, new_users=[user_name])
            self.org.search(org_name).click()
            session.nav.wait_until_element(
                tab_locators["context.tab_users"]).click()
            element = session.nav.wait_until_element((strategy,
                                                      value % user_name))
            self.assertIsNotNone(element)
示例#21
0
    def test_positive_update_hostgroup(self):
        """Add a hostgroup and remove it by using the organization
        name and hostgroup name.

        :id: 12e2fc40-d721-4e71-af7c-3db67b9e718e

        :expectedresults: hostgroup is added to organization then removed.

        :CaseLevel: Integration
        """
        with Session(self) as session:
            org_name = gen_string('alpha')
            make_org(session, org_name=org_name)
            for hostgroup_name in generate_strings_list():
                with self.subTest(hostgroup_name):
                    # Create hostgroup using nailgun
                    hostgroup = entities.HostGroup(
                        name=hostgroup_name).create()
                    self.assertEqual(hostgroup.name, hostgroup_name)
                    kwargs = {
                        'org_name': org_name,
                        'entity_type': 'hostgroups',
                        'entity_name': hostgroup_name,
                    }
                    self.assertIsNotNone(self.org.add_entity(**kwargs))
                    self.assertIsNotNone(self.org.remove_entity(**kwargs))
示例#22
0
    def test_add_computeresource_1(self, resource_name):
        """@test: Add compute resource using the organization
        name and computeresource name.

        @feature: Organizations associate compute resource.

        @assert: computeresource is added.

        """
        strategy, value = common_locators["entity_deselect"]
        org_name = gen_string("alpha", 8)
        libvirt_url = "qemu+tcp://%s:16509/system"
        url = (libvirt_url % conf.properties['main.server.hostname'])
        resource = entities.ComputeResource(
            name=resource_name,
            provider='Libvirt',
            url=url
        ).create()
        self.assertEqual(resource['name'], resource_name)
        with Session(self.browser) as session:
            make_org(session, org_name=org_name)
            self.assertIsNotNone(self.org.search(org_name))
            self.org.update(org_name, new_resources=[resource_name])
            self.org.search(org_name).click()
            session.nav.wait_until_element(
                tab_locators["context.tab_resources"]).click()
            element = session.nav.wait_until_element((strategy,
                                                      value % resource_name))
            self.assertIsNotNone(element)
示例#23
0
    def test_positive_update_compresource(self):
        """Remove compute resource using the organization name and
        compute resource name.

        :id: db119bb1-8f79-415b-a056-70a19ffceeea

        :expectedresults: compute resource is added then removed.

        :CaseLevel: Integration
        """
        with Session(self) as session:
            org_name = gen_string('alpha')
            make_org(session, org_name=org_name)
            for resource_name in generate_strings_list():
                with self.subTest(resource_name):
                    url = (LIBVIRT_RESOURCE_URL %
                           settings.compute_resources.libvirt_hostname)
                    # Create compute resource using nailgun
                    resource = entities.LibvirtComputeResource(
                        name=resource_name,
                        url=url
                    ).create()
                    self.assertEqual(resource.name, resource_name)
                    kwargs = {
                        'org_name': org_name,
                        'entity_type': 'resources',
                        'entity_name': resource_name
                    }
                    self.assertIsNotNone(self.org.add_entity(**kwargs))
                    self.assertIsNotNone(self.org.remove_entity(**kwargs))
示例#24
0
    def test_add_configtemplate_1(self, template_name):
        """@test: Add config template by using organization name and
        configtemplate name.

        @feature: Organizations associate config template.

        @assert: configtemplate is added

        @BZ: 1129612

        """
        strategy, value = common_locators["entity_deselect"]
        org_name = gen_string("alpha", 8)
        entities.ConfigTemplate(name=template_name).create()

        with Session(self.browser) as session:
            make_org(session, org_name=org_name)
            self.assertIsNotNone(self.org.search(org_name))
            self.org.update(org_name, new_templates=[template_name])
            self.org.search(org_name).click()
            self.org.wait_until_element(
                tab_locators["context.tab_template"]).click()
            element = session.nav.wait_until_element(
                (strategy, value % template_name))
            self.assertIsNotNone(element)
示例#25
0
    def test_positive_update_media(self):
        """Add/Remove medium from/to organization.

        :id: bcf3aaf4-cad9-4a22-a087-60b213eb87cf

        :expectedresults: medium is added then removed.

        :CaseLevel: Integration
        """
        with Session(self) as session:
            org_name = gen_string('alpha')
            make_org(session, org_name=org_name)
            for media_name in generate_strings_list():
                with self.subTest(media_name):
                    # Create media using nailgun
                    media = entities.Media(
                        name=media_name,
                        path_=INSTALL_MEDIUM_URL % gen_string('alpha', 6),
                        os_family='Redhat',
                    ).create()
                    self.assertEqual(media.name, media_name)
                    kwargs = {
                        'org_name': org_name,
                        'entity_type': 'medias',
                        'entity_name': media_name
                    }
                    self.assertIsNotNone(self.org.add_entity(**kwargs))
                    self.assertIsNotNone(self.org.remove_entity(**kwargs))
示例#26
0
    def test_positive_remove_domain(self):
        """Add a domain to an organization and remove it by organization
        name and domain name.

        @feature: Organizations Disassociate domain.

        @assert: the domain is removed from the organization
        """
        strategy, value = common_locators["entity_select"]
        strategy1, value1 = common_locators["entity_deselect"]
        with Session(self.browser) as session:
            for domain_name in generate_strings_list():
                with self.subTest(domain_name):
                    org_name = gen_string("alpha")
                    domain = entities.Domain(name=domain_name).create()
                    self.assertEqual(domain.name, domain_name)
                    make_org(session, org_name=org_name, domains=[domain_name])
                    self.org.search(org_name).click()
                    session.nav.click(tab_locators["context.tab_domains"])
                    element = session.nav.wait_until_element((strategy1, value1 % domain_name))
                    # Item is listed in 'Selected Items' list and not
                    # 'All Items' list.
                    self.assertIsNotNone(element)
                    self.org.update(org_name, domains=[domain_name])
                    self.org.search(org_name).click()
                    session.nav.click(tab_locators["context.tab_domains"])
                    element = session.nav.wait_until_element((strategy, value % domain_name))
                    # Item is listed in 'All Items' list and not
                    # 'Selected Items' list.
                    self.assertIsNotNone(element)
示例#27
0
    def test_positive_update_template(self):
        """Add and Remove config template.

        :id: 67bec745-5f10-494c-92a7-173ee63e8297

        :expectedresults: Config Template is added and then removed.

        :CaseLevel: Integration
        """
        with Session(self) as session:
            org_name = gen_string('alpha')
            make_org(session, org_name=org_name)
            for template_name in generate_strings_list():
                with self.subTest(template_name):
                    # Create config template using nailgun
                    template = entities.ProvisioningTemplate(
                        name=template_name).create()
                    self.assertEqual(template.name, template_name)
                    kwargs = {
                        'org_name': org_name,
                        'entity_type': 'templates',
                        'entity_name': template_name
                    }
                    self.assertIsNotNone(self.org.add_entity(**kwargs))
                    self.assertIsNotNone(self.org.remove_entity(**kwargs))
示例#28
0
    def test_positive_remove_hostgroup(self):
        """Add a hostgroup and remove it by using the organization
        name and hostgroup name.

        @feature: Organizations Remove Hostgroup.

        @assert: hostgroup is added to organization then removed.
        """
        strategy, value = common_locators["entity_select"]
        strategy1, value1 = common_locators["entity_deselect"]
        with Session(self.browser) as session:
            for host_grp_name in generate_strings_list():
                with self.subTest(host_grp_name):
                    org_name = gen_string("alpha")
                    # Create hostgroup using nailgun
                    host_grp = entities.HostGroup(name=host_grp_name).create()
                    self.assertEqual(host_grp.name, host_grp_name)
                    make_org(session, org_name=org_name, hostgroups=[host_grp_name])
                    self.org.search(org_name).click()
                    session.nav.click(tab_locators["context.tab_hostgrps"])
                    element = session.nav.wait_until_element((strategy1, value1 % host_grp_name))
                    # Item is listed in 'Selected Items' list and not
                    # 'All Items' list.
                    self.assertIsNotNone(element)
                    self.org.update(org_name, hostgroups=[host_grp_name], new_hostgroups=None)
                    self.org.search(org_name).click()
                    session.nav.click(tab_locators["context.tab_hostgrps"])
                    element = session.nav.wait_until_element((strategy, value % host_grp_name))
                    # Item is listed in 'All Items' list and not
                    # Selected Items' list.
                    self.assertIsNotNone(element)
示例#29
0
    def test_positive_remove_subnet(self):
        """Remove subnet by using organization name and subnet name.

        @feature: Organizations dis-associate subnet.

        @assert: subnet is added then removed.
        """
        strategy, value = common_locators["entity_select"]
        strategy1, value1 = common_locators["entity_deselect"]
        with Session(self.browser) as session:
            for subnet_name in generate_strings_list():
                with self.subTest(subnet_name):
                    org_name = gen_string("alpha")
                    # Create subnet using nailgun
                    subnet = entities.Subnet(
                        name=subnet_name, network=gen_ipaddr(ip3=True), mask="255.255.255.0"
                    ).create()
                    self.assertEqual(subnet.name, subnet_name)
                    make_org(session, org_name=org_name, subnets=[subnet_name])
                    self.org.search(org_name).click()
                    session.nav.click(tab_locators["context.tab_subnets"])
                    element = session.nav.wait_until_element((strategy1, value1 % subnet_name))
                    # Item is listed in 'Selected Items' list and not
                    # 'All Items' list.
                    self.assertIsNotNone(element)
                    self.org.update(org_name, subnets=[subnet_name])
                    self.org.search(org_name).click()
                    session.nav.click(tab_locators["context.tab_subnets"])
                    element = session.nav.wait_until_element((strategy, value % subnet_name))
                    # Item is listed in 'All Items' list and not
                    # 'Selected Items' list.
                    self.assertIsNotNone(element)
示例#30
0
    def test_positive_remove_medium(self):
        """Remove medium by using organization name and medium name.

        @feature: Organizations disassociate installation media.

        @assert: medium is added then removed.
        """
        strategy, value = common_locators["entity_select"]
        strategy1, value1 = common_locators["entity_deselect"]
        with Session(self.browser) as session:
            for medium_name in generate_strings_list():
                with self.subTest(medium_name):
                    org_name = gen_string("alpha")
                    # Create media using nailgun
                    medium = entities.Media(
                        name=medium_name, path_=INSTALL_MEDIUM_URL % gen_string("alpha", 6), os_family="Redhat"
                    ).create()
                    self.assertEqual(medium.name, medium_name)
                    make_org(session, org_name=org_name, medias=[medium_name])
                    self.org.search(org_name).click()
                    session.nav.click(tab_locators["context.tab_media"])
                    element = session.nav.wait_until_element((strategy1, value1 % medium_name))
                    # Item is listed in 'Selected Items' list and not
                    # 'All Items' list.
                    self.assertIsNotNone(element)
                    self.navigator.go_to_org()
                    self.org.update(org_name, medias=[medium_name], new_medias=None)
                    self.org.search(org_name).click()
                    session.nav.click(tab_locators["context.tab_media"])
                    element = session.nav.wait_until_element((strategy, value % medium_name))
                    # Item is listed in 'All Items' list and not
                    # 'Selected Items' list.
                    self.assertIsNotNone(element)
示例#31
0
    def test_positive_end_to_end(self):
        """Perform end to end smoke tests using RH repos.

        @Feature: Smoke test

        @Assert: All tests should succeed and Content should be successfully
        fetched by client

        """
        org_name = gen_string('alpha', 6)
        cv_name = gen_string('alpha', 6)
        activation_key_name = gen_string('alpha', 6)
        env_name = gen_string('alpha', 6)
        repos = self.sync.create_repos_tree(RHVA_REPO_TREE)
        with Session(self.browser) as session:
            # Create New organization
            make_org(session, org_name=org_name)
            self.assertIsNotNone(self.org.search(org_name))
            # Create New Lifecycle environment
            make_lifecycle_environment(session, org=org_name, name=env_name)
            self.assertIsNotNone(self.lifecycleenvironment.search(env_name))
            # Navigate UI to select org and redhat subscription page
            session.nav.go_to_select_org(org_name)
            session.nav.go_to_red_hat_subscriptions()
            # Upload manifest from webui
            with manifests.clone() as manifest:
                self.subscriptions.upload(manifest)
            self.assertTrue(session.nav.wait_until_element(
                common_locators['alert.success']
            ))
            session.nav.go_to_red_hat_repositories()
            # List of dictionary passed to enable the redhat repos
            # It selects Product->Reposet-> Repo
            self.sync.enable_rh_repos(repos)
            session.nav.go_to_sync_status()
            # Sync the repos
            # syn.sync_rh_repos returns boolean values and not objects
            self.assertTrue(self.sync.sync_rh_repos(repos))
            # Create new content-view
            make_contentview(session, org=org_name, name=cv_name)
            self.assertIsNotNone(self.content_views.search(cv_name))
            # Add YUM repository to content-view
            self.content_views.add_remove_repos(
                cv_name,
                [REPOS['rhva65']['name'], REPOS['rhva6']['name']]
            )
            if not bz_bug_is_open(1191422):
                self.assertIsNotNone(self.content_views.wait_until_element(
                    common_locators['alert.success']
                ))
            # Publish content-view
            self.content_views.publish(cv_name)
            if not bz_bug_is_open(1191422):
                self.assertIsNotNone(self.content_views.wait_until_element(
                    common_locators['alert.success']
                ))

            # Promote content-view to life-cycle environment 1
            self.content_views.promote(
                cv_name, version='Version 1', env=env_name)
            if not bz_bug_is_open(1191422):
                self.assertIsNotNone(self.content_views.wait_until_element(
                    common_locators['alert.success']
                ))
            # Create Activation-Key
            make_activationkey(
                session,
                org=org_name,
                name=activation_key_name,
                env=env_name,
                content_view=cv_name
            )
            self.activationkey.associate_product(
                activation_key_name, [DEFAULT_SUBSCRIPTION_NAME])
            self.activationkey.enable_repos(
                activation_key_name, [REPOSET['rhva6']])
            if not bz_bug_is_open(1191541):
                self.assertIsNotNone(self.activationkey.wait_until_element(
                    common_locators['alert.success']
                ))
            # Create VM
            with VirtualMachine(distro='rhel66') as vm:
                vm.install_katello_ca()
                result = vm.register_contenthost(activation_key_name, org_name)
                self.assertEqual(result.return_code, 0)

                # Install contents from sat6 server
                package_name = 'python-kitchen'
                result = vm.run(u'yum install -y {0}'.format(package_name))
                self.assertEqual(result.return_code, 0)
                # Verify if package is installed by query it
                result = vm.run(u'rpm -q {0}'.format(package_name))
                self.assertEqual(result.return_code, 0)
示例#32
0
    def test_positive_update_external_user_roles(self):
        """Assure that user has roles/can access feature areas for
        additional roles assigned outside any roles assigned by his group

        @id: a487f7d6-22f2-4e42-b34f-8d984f721c83

        @setup: Assign roles to UserGroup and configure external
        UserGroup subsequently assign specified roles to the user(s).
        roles that are not part of the larger UserGroup

        @steps:
        1. Create an UserGroup.
        2. Assign some roles to UserGroup.
        3. Create an External AD UserGroup as per the UserGroup name in AD.
        4. Assign some more roles to a User(which is part of external AD
        UserGroup) at the User level.
        5. Login to sat6 with the above AD user and attempt to access areas
        assigned specifically to user.

        @assert: User can access not only those feature areas in his
        UserGroup but those additional feature areas / roles assigned
        specifically to user

        @CaseLevel: Integration
        """
        self.check_external_user()
        foreman_role = gen_string('alpha')
        katello_role = gen_string('alpha')
        org_name = gen_string('alpha')
        loc_name = gen_string('alpha')
        with Session(self.browser) as session:
            make_role(session, name=foreman_role)
            self.role.add_permission(
                foreman_role,
                permission_list=PERMISSIONS['Location'],
                resource_type='Location',
            )
            make_usergroup(
                session,
                name=self.usergroup_name,
                roles=[foreman_role],
                ext_usergrp='foobargroup',
                ext_authsourceid='LDAP-' + self.ldap_server_name,
            )
            self.assertIsNotNone(self.usergroup.search(self.usergroup_name))
            set_context(session, org=ANY_CONTEXT['org'])
            self.user.update(
                username=self.ldap_user_name,
                authorized_by='LDAP-' + self.ldap_server_name,
                new_password=self.ldap_user_passwd,
                password_confirmation=self.ldap_user_passwd,
            )
        with Session(
            self.browser,
            self.ldap_user_name,
            self.ldap_user_passwd,
        ) as session:
            make_loc(session, name=loc_name)
            self.assertIsNotNone(self.location.search(loc_name))
        with Session(self.browser) as session:
            make_role(session, name=katello_role)
            self.role.add_permission(
                katello_role,
                permission_list=PERMISSIONS['Organization'],
                resource_type='Organization',
            )
            set_context(session, org=ANY_CONTEXT['org'])
            self.user.update(
                self.ldap_user_name,
                new_roles=[katello_role],
                select=True,
            )
        with Session(
            self.browser,
            self.ldap_user_name,
            self.ldap_user_passwd,
        ) as session:
            make_org(session, org_name=org_name)
            self.assertIsNotNone(self.org.search(org_name))
示例#33
0
    def test_positive_puppet_install(self):
        """Perform puppet end to end smoke tests using RH repos.

        @Feature: Smoke test puppet install and configure on client

        @Assert: Client should get configured by puppet-module.

        """
        activation_key_name = gen_string('alpha')
        cv_name = gen_string('alpha')
        env_name = gen_string('alpha')
        org_name = gen_string('alpha')
        product_name = gen_string('alpha')
        puppet_module = 'motd'
        puppet_repository_name = gen_string('alpha')
        repos = self.sync.create_repos_tree(SAT6_TOOLS_TREE)
        rhel_prd = DEFAULT_SUBSCRIPTION_NAME
        rhel6_repo = settings.rhel6_repo
        with Session(self.browser) as session:
            # Create New organization
            make_org(session, org_name=org_name)
            self.assertIsNotNone(self.org.search(org_name))
            # Create New Lifecycle environment
            make_lifecycle_environment(session, org=org_name, name=env_name)
            self.assertIsNotNone(self.lifecycleenvironment.search(env_name))
            session.nav.go_to_red_hat_subscriptions()
            # Upload manifest from webui
            with manifests.clone() as manifest:
                self.subscriptions.upload(manifest)
            self.assertTrue(session.nav.wait_until_element(
                common_locators['alert.success']
            ))
            session.nav.go_to_red_hat_repositories()
            # List of dictionary passed to enable the redhat repos
            # It selects Product->Reposet-> Repo
            self.sync.enable_rh_repos(repos)
            session.nav.go_to_sync_status()
            # Sync the repos
            # syn.sync_rh_repos returns boolean values and not objects
            self.assertTrue(self.sync.sync_noversion_rh_repos(
                PRDS['rhel'], [REPOS['rhst6']['name']]
            ))
            # Create custom product
            make_product(session, org=org_name, name=product_name)
            product = self.products.search(product_name)
            self.assertIsNotNone(product)
            # Create a puppet Repository
            product.click()
            make_repository(
                session,
                name=puppet_repository_name,
                url=FAKE_6_PUPPET_REPO,
                repo_type=REPO_TYPE['puppet']
            )
            self.assertIsNotNone(self.repository.search(
                puppet_repository_name
            ))
            # Sync the repos
            # syn.sync_rh_repos returns boolean values and not objects
            session.nav.go_to_sync_status()
            self.assertIsNotNone(self.sync.sync_custom_repos(
                product_name,
                [puppet_repository_name]
            ))
            # Create new content-view
            make_contentview(session, org=org_name, name=cv_name)
            self.assertIsNotNone(self.content_views.search(cv_name))
            # Add YUM repository to content-view
            self.content_views.add_remove_repos(
                cv_name,
                [REPOS['rhst6']['name']],
            )
            if not bz_bug_is_open(1191422):
                self.assertIsNotNone(self.content_views.wait_until_element(
                    common_locators['alert.success']
                ))
            # Add puppet-module to content-view
            self.content_views.add_puppet_module(
                cv_name, puppet_module, filter_term='Latest')
            # Publish content-view
            self.content_views.publish(cv_name)
            if not bz_bug_is_open(1191422):
                self.assertIsNotNone(self.content_views.wait_until_element(
                    common_locators['alert.success']
                ))
            # Promote content-view to life-cycle environment.
            self.content_views.promote(
                cv_name, version='Version 1', env=env_name)
            if not bz_bug_is_open(1191422):
                self.assertIsNotNone(self.content_views.wait_until_element(
                    common_locators['alert.success']
                ))
            # Create Activation-Key
            make_activationkey(
                session,
                org=org_name,
                name=activation_key_name,
                env=env_name,
                content_view=cv_name
            )
            self.activationkey.associate_product(
                activation_key_name, [product_name, rhel_prd])
            self.activationkey.enable_repos(
                activation_key_name, [REPOSET['rhst6']]
            )
            if not bz_bug_is_open(1191541):
                self.assertIsNotNone(self.activationkey.wait_until_element(
                    common_locators['alert.success']
                ))
            # Create VM
            with VirtualMachine(distro='rhel67') as vm:
                vm.install_katello_ca()
                vm.register_contenthost(activation_key_name, org_name)
                vm.configure_puppet(rhel6_repo)
                host = vm.hostname
                set_context(session, org=ANY_CONTEXT['org'])
                session.nav.go_to_hosts()
                self.hosts.update_host_bulkactions(host=host, org=org_name)
                self.hosts.update(
                    name=host,
                    parameters_list=[
                        ['Host', 'Lifecycle Environment', env_name],
                        ['Host', 'Content View', cv_name],
                        ['Host', 'Reset Puppet Environment', True],
                    ],
                    puppet_classes=[puppet_module]
                )
                vm.run(u'puppet agent -t')
                result = vm.run(u'cat /etc/motd | grep FQDN')
                self.assertEqual(result.return_code, 0)
示例#34
0
    def test_positive_update_external_roles(self):
        """Added AD UserGroup roles get pushed down to user

        @id: f3ca1aae-5461-4af3-a508-82679bb6afed

        @setup: assign additional roles to the UserGroup

        @steps:
        1. Create an UserGroup.
        2. Assign some roles to UserGroup.
        3. Create an External AD UserGroup as per the UserGroup name in AD.
        4. Login to sat6 with the AD user.
        5. Assign additional roles to the UserGroup.
        6. Login to sat6 with LDAP user that is part of aforementioned
        UserGroup.

        @assert: User has access to all NEW functional areas that are assigned
        to aforementioned UserGroup.

        @CaseLevel: Integration
        """
        self.check_external_user()
        foreman_role = gen_string('alpha')
        katello_role = gen_string('alpha')
        org_name = gen_string('alpha')
        loc_name = gen_string('alpha')
        with Session(self.browser) as session:
            make_role(session, name=foreman_role)
            self.role.add_permission(
                foreman_role,
                permission_list=PERMISSIONS['Location'],
                resource_type='Location',
            )
            make_usergroup(
                session,
                name=self.usergroup_name,
                roles=[foreman_role],
                ext_usergrp='foobargroup',
                ext_authsourceid='LDAP-' + self.ldap_server_name,
            )
            self.assertIsNotNone(self.usergroup.search(self.usergroup_name))
            set_context(session, org=ANY_CONTEXT['org'])
            self.user.update(
                username=self.ldap_user_name,
                authorized_by='LDAP-' + self.ldap_server_name,
                new_password=self.ldap_user_passwd,
                password_confirmation=self.ldap_user_passwd,
            )
        with Session(
            self.browser,
            self.ldap_user_name,
            self.ldap_user_passwd,
        ) as session:
            make_loc(session, name=loc_name)
            self.assertIsNotNone(self.location.search(loc_name))
        with Session(self.browser) as session:
            make_role(session, name=katello_role)
            self.role.add_permission(
                katello_role,
                permission_list=PERMISSIONS['Organization'],
                resource_type='Organization',
            )
            self.usergroup.update(
                self.usergroup_name,
                new_roles=[katello_role],
                entity_select=True,
            )
            self.usergroup.refresh_ext_group(
                self.usergroup_name, 'foobargroup')
            self.assertIsNotNone(self.usergroup.wait_until_element(
                common_locators['notif.success']))
        with Session(
            self.browser,
            self.ldap_user_name,
            self.ldap_user_passwd,
        ) as session:
            make_org(session, org_name=org_name)
            self.assertIsNotNone(self.org.search(org_name))
示例#35
0
    def test_positive_end_to_end(self):
        """Perform end to end smoke tests using RH and custom repos.

        1. Create a new user with admin permissions
        2. Using the new user from above
            1. Create a new organization
            2. Clone and upload manifest
            3. Create a new lifecycle environment
            4. Create a custom product
            5. Create a custom YUM repository
            6. Create a custom PUPPET repository
            7. Enable a Red Hat repository
            8. Synchronize the three repositories
            9. Create a new content view
            10. Associate the YUM and Red Hat repositories to new content view
            11. Add a PUPPET module to new content view
            12. Publish content view
            13. Promote content view to the lifecycle environment
            14. Create a new activation key
            15. Add the products to the activation key
            16. Create a new libvirt compute resource
            17. Create a new subnet
            18. Create a new domain
            19. Create a new hostgroup and associate previous entities to it
            20. Provision a client

        :id: 6b7c6187-3cc2-4bd3-89f2-fa7a5f570986

        :expectedresults: All tests should succeed and Content should be
            successfully fetched by client.
        """
        activation_key_name = gen_string('alpha')
        compute_resource_name = gen_string('alpha')
        cv_name = gen_string('alpha')
        domain_name = DOMAIN % gen_string('alpha')
        hostgroup_name = gen_string('alpha')
        lce_name = gen_string('alpha')
        org_name = gen_string('alpha')
        password = gen_string('alpha')
        product_name = gen_string('alpha')
        puppet_repository_name = gen_string('alpha')
        if self.fake_manifest_is_set:
            repos = self.sync.create_repos_tree(RHVA_REPO_TREE)
        subnet_name = gen_string('alpha')
        username = gen_string('alpha')
        yum_repository_name = gen_string('alpha')

        # step 1: Create a new user with admin permissions
        with Session(self.browser) as session:
            make_user(
                session,
                admin=True,
                password1=password,
                password2=password,
                username=username,
            )
            self.assertIsNotNone(self.user.search(username))
            self.assertTrue(self.user.user_admin_role_toggle(username))

        with Session(self.browser, username, password) as session:
            # step 2.1: Create a new organization
            make_org(session, org_name=org_name)
            self.assertIsNotNone(self.org.search(org_name))

            # step 2.2: Clone and upload manifest
            if self.fake_manifest_is_set:
                session.nav.go_to_select_org(org_name)
                session.nav.go_to_red_hat_subscriptions()
                with manifests.clone() as manifest:
                    self.subscriptions.upload(manifest)
                self.assertTrue(session.nav.wait_until_element(
                    common_locators['alert.success']
                ))

            # step 2.3: Create a new lifecycle environment
            make_lifecycle_environment(session, org=org_name, name=lce_name)
            self.assertIsNotNone(self.lifecycleenvironment.search(lce_name))

            # step 2.4: Create a custom product
            make_product(session, org=org_name, name=product_name)
            self.assertIsNotNone(self.products.search(product_name))

            # step 2.5: Create custom YUM repository
            self.products.search_and_click(product_name)
            make_repository(
                session,
                name=yum_repository_name,
                url=CUSTOM_RPM_REPO
            )
            self.assertIsNotNone(self.repository.search(yum_repository_name))

            # step 2.6: Create custom PUPPET repository
            self.products.search_and_click(product_name)
            make_repository(
                session,
                name=puppet_repository_name,
                url=FAKE_0_PUPPET_REPO,
                repo_type=REPO_TYPE['puppet']
            )
            self.assertIsNotNone(
                self.repository.search(puppet_repository_name))

            # step 2.7: Enable a Red Hat repository
            if self.fake_manifest_is_set:
                self.sync.enable_rh_repos(repos, REPO_TAB['rpms'])

            # step 2.8: Synchronize the three repositories
            self.navigator.go_to_sync_status()
            self.assertIsNotNone(self.sync.sync_custom_repos(
                product_name,
                [yum_repository_name, puppet_repository_name]
            ))
            if self.fake_manifest_is_set:
                self.assertTrue(self.sync.sync_rh_repos(repos))

            # step 2.9: Create content view
            make_contentview(session, org=org_name, name=cv_name)
            self.assertIsNotNone(self.content_views.search(cv_name))

            self.content_views.add_remove_repos(cv_name, [yum_repository_name])
            self.assertIsNotNone(self.content_views.wait_until_element(
                common_locators['alert.success']
            ))

            # step 2.10: Associate the YUM and Red Hat repositories to new
            # content view
            repositories = [yum_repository_name]
            if self.fake_manifest_is_set:
                repositories.append(REPOS['rhva65']['name'])
                repositories.append(REPOS['rhva6']['name'])
            self.content_views.add_remove_repos(cv_name, repositories)
            self.assertIsNotNone(self.content_views.wait_until_element(
                common_locators['alert.success']
            ))

            # step 2.11: Add a PUPPET module to new content view
            self.content_views.add_puppet_module(
                cv_name, 'httpd', filter_term='Latest')

            # step 2.12: Publish content view
            self.content_views.publish(cv_name)
            self.assertIsNotNone(self.content_views.wait_until_element(
                common_locators['alert.success_sub_form']
            ))

            # step 2.13: Promote content view to the lifecycle environment
            self.content_views.promote(
                cv_name, version='Version 1', env=lce_name)
            self.assertIsNotNone(self.content_views.wait_until_element(
                common_locators['alert.success_sub_form']
            ))

            # step 2.14: Create a new activation key
            make_activationkey(
                session,
                org=org_name,
                name=activation_key_name,
                env=lce_name,
                content_view=cv_name
            )
            self.assertIsNotNone(self.activationkey.wait_until_element(
                common_locators['alert.success']
            ))

            # step 2.15: Add the products to the activation key
            self.activationkey.associate_product(
                activation_key_name, [DEFAULT_SUBSCRIPTION_NAME])

            # step 2.15.1: Enable product content
            if self.fake_manifest_is_set:
                self.activationkey.enable_repos(
                    activation_key_name, [REPOSET['rhva6']])

            # step 2.16: Create a new libvirt compute resource
            make_resource(
                session,
                org=org_name,
                name=compute_resource_name,
                provider_type=FOREMAN_PROVIDERS['libvirt'],
                parameter_list=[[
                    'URL',
                    (LIBVIRT_RESOURCE_URL %
                     settings.compute_resources.libvirt_hostname),
                    'field'
                ]],
            )
            self.assertIsNotNone(
                self.compute_resource.search(compute_resource_name))

            # step 2.17: Create a new subnet
            make_subnet(
                session,
                org=org_name,
                subnet_name=subnet_name,
                subnet_network=gen_ipaddr(ip3=True),
                subnet_mask='255.255.255.0'
            )
            self.assertIsNotNone(self.subnet.search(subnet_name))

            # step 2.18: Create a new domain
            make_domain(
                session,
                org=org_name,
                name=domain_name,
                description=domain_name
            )
            self.assertIsNotNone(self.domain.search(domain_name))

            # step 2.19: Create a new hostgroup and associate previous entities
            # to it
            make_hostgroup(session, name=hostgroup_name)
            self.assertIsNotNone(self.hostgroup.search(hostgroup_name))

        # step 2.20: Provision a client
        self.client_provisioning(activation_key_name, org_name)