Exemplo n.º 1
0
    def test_positive_update_name(self):
        """Update Activation Key Name in an Activation key

        :id: 81d74424-893d-46c4-a20c-c20c85d4e898

        :expectedresults: Activation key is updated

        :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 valid_data_list():
                with self.subTest(new_name):
                    self.activationkey.update(name, new_name)
                    self.assertIsNotNone(self.activationkey.search(new_name))
                    name = new_name
Exemplo n.º 2
0
    def test_positive_update_surname(self):
        """Update Surname in My Account

        :id: 755c1acc-901b-40de-8bdc-1eace9713ed7

        :Steps: Update current User with all variations of Surname in [1]

        :expectedresults: Current User is updated

        :caseautomation: notautomated

        :CaseImportance: Critical
        """
        valid_names = _valid_string_data()
        valid_names.append('name with space')
        for last_name in valid_names:
            with self.subTest(last_name):
                with Session(self.browser, self.account_user.login,
                             self.account_password):
                    self.my_account.update(last_name=last_name)
                    self.assertEqual(
                        last_name,
                        self.my_account.get_field_value('last_name'))
Exemplo n.º 3
0
    def test_negative_create_with_invalid_name(self):
        """Create Activation key with invalid Name

        :id: 143ca57d-89ff-45e0-99cf-4d4033ea3690

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

        :CaseLevel: Integration
        """
        with Session(self) 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))
Exemplo n.º 4
0
    def test_negative_create_via_import_and_invalid_name(self):
        """Create gpg key with invalid name and valid gpg key via file import

        :id: bc5f96e6-e997-4995-ad04-614e66480b7f

        :expectedresults: gpg key is not created

        :CaseImportance: Critical
        """
        with Session(self) as session:
            for name in invalid_names_list():
                with self.subTest(name):
                    make_gpgkey(
                        session,
                        key_path=self.key_path,
                        name=name,
                        org=self.organization.name,
                        upload_key=True,
                    )
                    self.assertIsNotNone(
                        self.gpgkey.wait_until_element(
                            common_locators['alert.error']))
                    self.assertIsNone(self.gpgkey.search(name))
Exemplo n.º 5
0
    def test_negative_create_via_paste_and_invalid_name(self):
        """Create gpg key with invalid name and valid gpg key text via cut and
        paste/string

        :id: 652857de-c522-4c68-a758-13d0b37cc62a

        :expectedresults: gpg key is not created

        :CaseImportance: Critical
        """
        with Session(self) as session:
            for name in invalid_names_list():
                with self.subTest(name):
                    make_gpgkey(
                        session,
                        key_content=self.key_content,
                        name=name,
                        org=self.organization.name,
                    )
                    self.assertIsNotNone(
                        self.gpgkey.wait_until_element(
                            common_locators['alert.error']))
                    self.assertIsNone(self.gpgkey.search(name))
Exemplo n.º 6
0
    def test_negative_create_via_paste_and_same_name(self):
        """Create gpg key with valid name and valid gpg key text via cut and
        paste/string import then try to create new one with same name and same
        content

        :id: c6b256a5-6b9b-4927-a6c6-048ba36d2834

        :expectedresults: gpg key is not created

        :CaseImportance: Critical
        """
        name = gen_string('alphanumeric')
        kwargs = {
            'key_content': self.key_content,
            'name': name,
            'org': self.organization.name,
        }
        with Session(self) as session:
            make_gpgkey(session, **kwargs)
            self.assertIsNotNone(self.gpgkey.search(name))
            make_gpgkey(session, **kwargs)
            self.assertIsNotNone(
                self.gpgkey.wait_until_element(common_locators['alert.error']))
Exemplo n.º 7
0
    def test_negative_create_via_import_and_same_name(self):
        """Create gpg key with valid name and valid gpg key via file import
        then try to create new one with same name and same content

        :id: d5e28e8a-e0ef-4c74-a18b-e2646a2cdba5

        :expectedresults: gpg key is not created

        :CaseImportance: Critical
        """
        name = gen_string('alphanumeric')
        kwargs = {
            'key_path': self.key_path,
            'name': name,
            'org': self.organization.name,
            'upload_key': True,
        }
        with Session(self) as session:
            make_gpgkey(session, **kwargs)
            self.assertIsNotNone(self.gpgkey.search(name))
            make_gpgkey(session, **kwargs)
            self.assertIsNotNone(
                self.gpgkey.wait_until_element(common_locators['alert.error']))
Exemplo n.º 8
0
    def test_positive_register_host_via_rhsm(self):
        """Register a pre-installed host via rhsm using credentials

        :id: 4e685241-b671-4cfd-bfaa-f44a5cf78654

        :steps:
            1.  Register a host via rhsm using credentials
            2.  View host under content hosts
            3.  View host under 'All Hosts'

        :expectedresults: Hosts registered via rhsm appears under 'All hosts'
            as well as under content-hosts.

        :CaseLevel: System
        """
        with VirtualMachine(distro=DISTRO_RHEL7) as vm:
            vm.install_katello_ca()
            vm.register_contenthost(self.org_.label, lce='Library')
            self.assertTrue(vm.subscribed)
            with Session(self) as session:
                session.nav.go_to_select_org(self.org_.name)
                self.assertIsNotNone(self.hosts.search(vm.hostname))
                self.assertIsNotNone(self.contenthost.search(vm.hostname))
Exemplo n.º 9
0
    def test_positive_update_limit(self):
        """Update Usage limit from Unlimited to a finite number

        :id: e6ef8dbe-dfb6-4226-8253-ff2e24cabe12

        :expectedresults: Activation key is updated

        :CaseImportance: Critical
        """
        name = gen_string('alpha')
        limit = '8'
        with Session(self) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=ENVIRONMENT,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            self.activationkey.update(name, limit=limit)
            selected_limit = self.activationkey.get_attribute(
                name, locators['ak.fetch_limit'])
            self.assertEqual(selected_limit, limit)
Exemplo n.º 10
0
    def test_positive_update_limit_to_unlimited(self):
        """Update Usage limit from definite number to Unlimited

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

        :expectedresults: Activation key is updated

        :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))
            self.activationkey.update(name, limit='Unlimited')
            selected_limit = self.activationkey.get_attribute(
                name, locators['ak.fetch_limit'])
            self.assertEqual(selected_limit, 'Unlimited')
Exemplo n.º 11
0
    def test_positive_host_configuration_chart(self):
        """Check if the Host Configuration Chart is working in the Dashboard UI

        :id: b03314aa-4394-44e5-86da-c341c783003d

        :Steps:

            1. Navigate to Monitor -> Dashboard
            2. Review the Host Configuration Chart widget
            3. Check that chart contains correct percentage value

        :expectedresults: Chart showing correct data

        :CaseLevel: Integration
        """
        org = entities.Organization().create()
        entities.Host(organization=org).create()
        with Session(self.browser) as session:
            set_context(session, org=org.name)
            self.assertEqual(
                self.dashboard.get_hcc_host_percentage('No report'),
                '100%'
            )
Exemplo n.º 12
0
    def test_positive_delete_from_allhosts(self):
        """Delete a host from 'All hosts'

        :id: 896c1a7e-9292-45f2-a2b7-3d2560ae4a2d

        :steps:
            1.  Delete a host from 'All hosts' page
            2.  View host under 'Content-hosts'
            3.  View host under 'All hosts'

        :expectedresults: Host should be removed from 'All hosts' as well as
            content-hosts

        :CaseLevel: System
        """
        with VirtualMachine(distro=DISTRO_RHEL7) as vm:
            vm.install_katello_ca()
            vm.register_contenthost(self.org_.label, lce='Library')
            self.assertTrue(vm.subscribed)
            with Session(self) as session:
                session.nav.go_to_select_org(self.org_.name)
                self.hosts.delete(vm.hostname, dropdown_present=True)
                self.assertIsNone(self.contenthost.search(vm.hostname))
Exemplo n.º 13
0
    def test_positive_rename_foreman_host(self):
        """Hosts renamed in foreman appears in katello under content-hosts

        @id: 24182edc-8bff-46a1-b158-bcc7a3615166

        @steps:
        1.  Rename a host from 'All Hosts' page
        2.  View host under content-hosts page
        3.  View host under 'All Hosts'

        @assert: Host appears in both places despite being renamed

        @CaseLevel: System
        """
        with VirtualMachine(distro=DISTRO_RHEL7) as vm:
            vm.install_katello_ca()
            result = vm.register_contenthost(self.org_.label, lce='Library')
            self.assertEqual(result.return_code, 0)
            with Session(self.browser) as session:
                session.nav.go_to_select_org(self.org_.name)
                name, domain_name = vm.hostname.split('.', 1)
                new_name = gen_string('alphanumeric').lower()
                self.hosts.update(
                    name,
                    domain_name,
                    new_name=new_name,
                )
                # Host rename operation is not atomic and may take some time
                for _ in range(3):
                    searched = self.hosts.search(vm.hostname)
                    if not searched:
                        break
                else:
                    self.fail('Host was not renamed')
                self.assertIsNotNone(self.hosts.search(new_name))
                self.assertIsNone(self.contenthost.search(vm.hostname))
                self.assertIsNotNone(self.contenthost.search(new_name))
Exemplo n.º 14
0
    def test_negative_update_bookmark_query_empty(self):
        """Update and save a bookmark with an empty query

        :id: 516b314b-7712-455a-b1d4-d09730acbec9

        :Setup: Create a bookmark of a random name with random query

        :Steps:

            1. List the bookmarks (Navigate to Administer -> Bookmarks)
            2. Click the pre-created bookmark
            3. Delete the search query
            4. Submit
            5. Navigate to the entity page
            6. Click the search dropdown

        :expectedresults: Error - search query cannot be empty, bookmark not
            updated

        :CaseImportance: Critical
        """
        for entity in self.getOneEntity():
            with self.subTest(entity):
                with Session(self.browser):
                    name = gen_string(random.choice(STRING_TYPES))
                    query = gen_string(random.choice(STRING_TYPES))
                    ui_lib = getattr(self, entity['name'].lower())
                    ui_lib.create_a_bookmark(
                        name=name,
                        public=True,
                        query=query,
                    )
                    self.bookmark.update(name, new_query='')
                    self.assertTrue(self.bookmark.wait_until_element(
                        common_locators['haserror']))
                    self.assertTrue(
                        self.bookmark.validate_field(name, 'query', query))
Exemplo n.º 15
0
    def test_positive_update_bookmark_query(self):
        """Update and save a bookmark query

        @id: 19c994f0-2567-47bb-8486-bc441602bc7a

        @Setup:

        1. Create a bookmark of a random name with random query

        @Steps:

        1. List the bookmarks (Navigate to Administer -> Bookmarks)
        2. Click the pre-created bookmark
        3. Edit the Search query field
        4. Submit
        5. Navigate to the entity page
        6. Select the updated bookmark from the query

        @Assert: The updated query is populated and submitted
        """
        for entity in self.getOneEntity():
            with self.subTest(entity):
                with Session(self.browser):
                    name = gen_string(random.choice(STRING_TYPES))
                    ui_lib = getattr(self, entity['name'].lower())
                    ui_lib.create_a_bookmark(
                        name=name,
                        public=True,
                        query=gen_string(random.choice(STRING_TYPES)),
                    )
                    new_query = gen_string(random.choice(STRING_TYPES))
                    self.bookmark.update(entity['controller'],
                                         name,
                                         new_query=new_query)
                    self.assertTrue(
                        self.bookmark.validate_field(entity['controller'],
                                                     name, 'query', new_query))
Exemplo n.º 16
0
    def test_negative_update_bookmark_name_empty(self):
        """Update and save a bookmark with an empty name

        @id: 7d7f713d-e377-446e-a9e9-06364bcc25c0

        @Setup:

        1. Create a bookmark of a random name with random query

        @Steps:

        1. List the bookmarks (Navigate to Administer -> Bookmarks)
        2. Click the pre-created bookmark
        3. Delete the name
        4. Submit
        5. Navigate to the entity page
        6. Click the search dropdown

        @Assert: Error - name cannot be empty, bookmark not updated
        """
        for entity in self.getOneEntity():
            with self.subTest(entity):
                with Session(self.browser):
                    name = gen_string(random.choice(STRING_TYPES))
                    query = gen_string(random.choice(STRING_TYPES))
                    ui_lib = getattr(self, entity['name'].lower())
                    ui_lib.create_a_bookmark(
                        name=name,
                        public=True,
                        query=query,
                    )
                    self.bookmark.update(entity['controller'], name, '', query)
                    self.assertTrue(
                        self.bookmark.wait_until_element(
                            common_locators['name_haserror']))
                    self.assertIsNotNone(
                        self.bookmark.search(entity['controller'], name))
Exemplo n.º 17
0
    def test_negative_create_bookmark_same_name(self):
        """Create bookmarks with the same names

        @id: 210c36b2-29bd-40d9-b120-16a1a031b20c

        @Setup:

        1. Create a bookmark of a random name

        @Steps:

        1. Navigate to the entity page
        2. Choose "bookmark this search" from the search drop-down menu
        3. Input the same name as the pre-created bm
        4. Enter random text into Query field
        5. Click the create button
        6. List the bookmarks (Navigate to Administer -> Bookmarks)

        @Assert: Error notification - name already taken, Bookmark is not
        created (not listed)
        """
        for entity in self.getOneEntity():
            with self.subTest(entity):
                with Session(self.browser):
                    name = gen_string(random.choice(STRING_TYPES))
                    ui_lib = getattr(self, entity['name'].lower())
                    for _ in range(2):
                        ui_lib.create_a_bookmark(
                            name=name,
                            public=True,
                            query=gen_string(random.choice(STRING_TYPES)),
                        )
                    self.bookmark.navigate_to_entity()
                    strategy, value = locators['bookmark.select_name']
                    bms = self.browser.find_elements(
                        strategy, value % (entity['controller'], name))
                    self.assertEqual(len(bms), 1)
Exemplo n.º 18
0
    def test_negative_update_upstream_name(self):
        """Attempt to update upstream name for a Docker-type repository.

        :id: 4722cfa1-33d0-41c4-8ed2-46da9b6d0cd1

        :expectedresults: A repository is created with a Docker upstream
            repository and that its upstream name can not be updated with
            invalid values.

        :CaseImportance: Critical
        """
        with Session(self) as session:
            repo_name = gen_string('alphanumeric')
            product = entities.Product(organization=self.organization).create()
            _create_repository(
                session,
                org=self.organization.name,
                name=repo_name,
                product=product.name,
            )
            self.assertIsNotNone(self.repository.search(repo_name))
            self.assertTrue(
                self.repository.validate_field(repo_name, 'upstream',
                                               'busybox'))
            for new_upstream_name in invalid_docker_upstream_names():
                with self.subTest(new_upstream_name):
                    self.products.search_and_click(product.name)
                    self.repository.update(repo_name,
                                           new_upstream_name=new_upstream_name)
                    self.assertIsNotNone(
                        self.products.wait_until_element(
                            common_locators['alert.error']))
                    self.repository.click(common_locators['alert.close'])
                    self.products.search_and_click(product.name)
                    self.assertTrue(
                        self.repository.validate_field(repo_name, 'upstream',
                                                       'busybox'))
Exemplo n.º 19
0
    def test_positive_create_job_template_input(self):
        """Create a Job Template using input

        :id: dbaf5aa9-101d-47dc-bdf8-d5b4d1a52396

        :Steps:

            1. Navigate to Hosts -> Job Templates
            2. Enter a name
            3. Navigate to the job tab
            4. Enter a job name
            5. Click the +Add Input button
            6. Add an appropriate name
            7. Choose an input type
            8. Populate the template code and reference the newly created input
            9. Click submit

        :expectedresults: The job template was successfully saved with new
            input added

        :CaseImportance: Critical
        """
        name = gen_string('alpha')
        var_name = gen_string('alpha')
        with Session(self) as session:
            make_job_template(
                session,
                name=name,
                template_type='input',
                template_content=gen_string('alphanumeric', 20),
            )
            self.assertIsNotNone(self.jobtemplate.search(name))
            self.jobtemplate.add_input(name, var_name)
            self.jobtemplate.update(
                name,
                template_type='input',
                template_content='<%= input("{0}") %>'.format(var_name))
Exemplo n.º 20
0
    def test_positive_delete_with_system(self):
        """Delete an Activation key which has registered systems

        @Feature: Activation key - Positive Delete

        @Steps:
        1. Create an Activation key
        2. Register systems to it
        3. Delete the Activation key

        @Assert: Activation key is deleted
        """
        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']))
            with VirtualMachine(distro=self.vm_distro) as vm:
                vm.install_katello_ca()
                result = vm.register_contenthost(name, self.organization.label)
                self.assertEqual(result.return_code, 0)
                self.activationkey.delete(name)
Exemplo n.º 21
0
    def test_remove_computeresource_1(self, resource_name):
        """@test: Remove computeresource by using the organization
        name and computeresource name.

        @feature: Organizations dis-associate compute-resource.

        @assert: computeresource is added then removed.

        """
        strategy, value = common_locators["entity_select"]
        strategy1, value1 = 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, 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(
                (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.wait_until_element(
                tab_locators["context.tab_resources"]).click()
            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)
Exemplo n.º 22
0
    def test_cv_promote_custom_content(self):
        """@test: attempt to promote a content view containing custom content

        @feature: Content Views

        @setup: Multiple environments for an org; custom content synced

        @assert: Content view can be promoted

        """
        repo_name = gen_string("alpha", 8)
        env_name = gen_string("alpha", 8)
        publish_version = "Version 1"
        cv_name = gen_string("alpha", 8)
        strategy, value = locators["content_env.select_name"]
        with Session(self.browser) as session:
            make_lifecycle_environment(session,
                                       org=self.org_name,
                                       name=env_name)
            self.assertIsNotNone(
                session.nav.wait_until_element((strategy, value % env_name)))
            self.setup_to_create_cv(repo_name=repo_name)
            # Create content-view
            make_contentview(session, org=self.org_name, name=cv_name)
            self.assertIsNotNone(self.content_views.search(cv_name))
            self.content_views.add_remove_repos(cv_name, [repo_name])
            self.assertIsNotNone(
                self.content_views.wait_until_element(
                    common_locators["alert.success"]))
            self.content_views.publish(cv_name)
            self.assertIsNotNone(
                self.content_views.wait_until_element(
                    common_locators["alert.success"]))
            self.content_views.promote(cv_name, publish_version, env_name)
            self.assertIsNotNone(
                self.content_views.wait_until_element(
                    common_locators["alert.success"]))
Exemplo n.º 23
0
    def test_positive_update_vmware_name(self):
        """Update a vmware compute resource name

        :id: e2bf2fcb-4611-445e-bc36-a54b3fd2d559

        :setup: vmware hostname and credentials.

        :steps:
            1. Create a compute resource of type vmware.
            2. Provide valid hostname, username and password.
            3. Provide valid name to vmware compute resource.
            4. Test the connection using Load Datacenters and submit.
            5. Update the name of the created CR with valid string.

        :expectedresults: The vmware compute resource is updated

        :Caseautomation: Automated

        :CaseImportance: Critical
        """
        parameter_list = [
            ['VCenter/Server', self.vmware_url, 'field'],
            ['Username', self.vmware_username, 'field'],
            ['Password', self.vmware_password, 'field'],
            ['Datacenter', self.vmware_datacenter, 'special select'],
        ]
        newname = gen_string('alpha')
        name = gen_string('alpha')
        with Session(self) as session:
            with self.subTest(newname):
                make_resource(session,
                              name=name,
                              provider_type=FOREMAN_PROVIDERS['vmware'],
                              parameter_list=parameter_list)
                self.assertIsNotNone(self.compute_resource.search(name))
                self.compute_resource.update(name=name, newname=newname)
                self.assertIsNotNone(self.compute_resource.search(newname))
Exemplo n.º 24
0
    def test_positive_provision_atomic_host(self):
        """Provision an atomic host on libvirt and register it with satellite

        :id: 5ddf2f7f-f7aa-4321-8717-372c7b6e99b6

        :expectedresults: Atomic host should be provisioned and listed under
            content-hosts/Hosts

        :CaseLevel: System
        """
        resource = u'{0} (Libvirt)'.format(self.computeresource.name)
        root_pwd = gen_string('alpha', 15)
        with Session(self) as session:
            make_host(
                session,
                name=self.hostname,
                org=self.org_name,
                loc=self.loc_name,
                force_context=True,
                parameters_list=[
                    ['Host', 'Organization', self.org_name],
                    ['Host', 'Location', self.loc_name],
                    ['Host', 'Host group', self.host_group.name],
                    ['Host', 'Deploy on', resource],
                    ['Virtual Machine', 'Memory', '1 GB'],
                    ['Operating System', 'Media', self.media.name],
                    ['Operating System', 'Partition table', DEFAULT_PTABLE],
                    ['Operating System', 'Root password', root_pwd],
                ],
                interface_parameters=[
                    ['Network type', 'Physical (Bridge)'],
                    ['Network', settings.vlan_networking.bridge],
                ],
            )
            search = self.hosts.search(u'{0}.{1}'.format(
                self.hostname, self.domain_name))
            self.assertIsNotNone(search)
Exemplo n.º 25
0
    def test_positive_access_ec2_with_custom_profile(self):
        """Associate custom (3-Large) compute profile to ec2 compute resource

        :id: 88cb2f19-4f6e-4533-859b-59c7d99c206f

        :setup: ec2 hostname and credentials, custom flavor.

        :steps:

            1. Create a compute resource of type ec2.
            2. Provide a valid Access Key and Secret Key.
            3. Select the created ec2 CR.
            4. Click Compute Profile tab.
            5. Edit (3-Large) with valid configurations and submit.

        :expectedresults: The compute resource created and opened successfully

        :Caseautomation: Automated
        """
        parameter_list = [['Access Key', self.aws_access_key, 'field'],
                          ['Secret Key', self.aws_secret_key, 'field'],
                          ['Region', self.aws_region, 'special select']]
        name = gen_string('alpha')
        with Session(self) as session:
            make_resource(session,
                          name=name,
                          provider_type=FOREMAN_PROVIDERS['ec2'],
                          parameter_list=parameter_list)
            self.compute_resource.set_profile_values(
                name,
                COMPUTE_PROFILE_LARGE,
                flavor=AWS_EC2_FLAVOR_T2_MICRO,
                availability_zone=self.aws_availability_zone,
                subnet=self.aws_subnet,
                security_groups=self.aws_security_groups,
                managed_ip=self.aws_managed_ip,
            )
Exemplo n.º 26
0
    def test_positive_update_with_all_users(self):
        """Create location and add user to it. Check and uncheck 'all users'
        setting. Verify that user is assigned to location and vice versa
        location is assigned to user

        :id: 17f85968-4aa6-4e2e-82d9-b01bc17031e7

        :customerscenario: true

        :expectedresults: Location and user entities assigned to each other

        :BZ: 1479736

        :CaseLevel: Integration
        """
        loc_name = gen_string('alpha')
        user = entities.User().create()
        with Session(self) as session:
            set_context(session, org=ANY_CONTEXT['org'])
            make_loc(session, name=loc_name)
            self.location.update(loc_name, new_users=[user.login])
            self.location.search_and_click(loc_name)
            self.location.click(tab_locators['context.tab_users'])
            self.assertIsNotNone(self.location.wait_until_element(
                common_locators['entity_deselect'] % user.login))
            for value in [True, False]:
                self.location.assign_value(
                    locators['location.all_users'], value)
                self.location.click(common_locators['submit'])
                self.user.search_and_click(user.login)
                self.user.click(tab_locators['tab_loc'])
                self.assertIsNotNone(self.user.wait_until_element(
                    common_locators['entity_deselect'] % loc_name))
                self.location.search_and_click(loc_name)
                self.location.click(tab_locators['context.tab_users'])
                self.assertIsNotNone(self.location.wait_until_element(
                    common_locators['entity_deselect'] % user.login))
Exemplo n.º 27
0
    def test_positive_chost_library(self):
        """Check if the applicable errata are available from the content
        host's Library

        @id: 4e627410-b7b8-471b-b9b4-a18e77fdd3f8

        @Setup:

        1. Make sure multiple environments are present.
        2. Content host's Library environment has additional errata.

        @Steps:

        1. Go to Content Hosts -> Select content host -> Errata Tab -> Select
        'Library'.

        @Assert: The errata from Library are displayed.

        @CaseLevel: System
        """
        with VirtualMachine(distro='rhel71') as client:
            client.install_katello_ca()
            result = client.register_contenthost(
                self.session_org.label,
                self.activation_key.name,
            )
            self.assertEqual(result.return_code, 0)
            client.enable_repo(REPOS['rhst7']['id'])
            client.install_katello_agent()
            client.run('yum install -y {0}'.format(FAKE_1_CUSTOM_PACKAGE))
            with Session(self.browser):
                self.assertIsNotNone(
                    self.contenthost.errata_search(
                        client.hostname,
                        CUSTOM_REPO_ERRATA_ID,
                        environment_name='Library Synced Content',
                    ))
Exemplo n.º 28
0
    def test_negative_create_rhev_with_invalid_name(self):
        """Create a new rhev Compute Resource with incorrect values
        only

        :id: 5598b123-b6ad-4bdf-b192-2b1ccc2f41eb

        :setup: rhev hostname and credentials.

        :steps:

            1. Create a compute resource of type rhev.
            2. Provide it with the valid hostname, username and password.
            3. Provide a invalid name to rhev Compute Resource.
            4. Test the connection using Load Datacenter and submit.

        :CaseAutomation: Automated

        :expectedresults: A rhev Compute Resource is not created

        :CaseImportance: Critical
        """
        parameter_list = [
            ['URL', self.rhev_url, 'field'],
            ['Username', self.rhev_username, 'field'],
            ['Password', self.rhev_password, 'field'],
            ['Datacenter', self.rhev_datacenter, 'special select'],
        ]
        with Session(self) as session:
            for name in invalid_names_list():
                with self.subTest(name):
                    make_resource(session,
                                  name=name,
                                  provider_type=FOREMAN_PROVIDERS['rhev'],
                                  parameter_list=parameter_list)
                    self.assertIsNotNone(
                        self.compute_resource.wait_until_element(
                            common_locators["name_haserror"]))
Exemplo n.º 29
0
    def test_positive_preview_verify(self):
        """Use preview within the job template editor to verify template

        :id: 4b4939f3-c056-4716-8071-e8fa00233e3e

        :Steps:

            1. Create a new job template.
            2. Add input controls under jobs
            3. Reference those input controls in the template text
            4. Select "preview" within the template viewer

        :expectedresults: Verify no errors are thrown

        :CaseImportance: Critical
        """
        name = gen_string('alpha')
        var_name = gen_string('alpha')
        with Session(self) as session:
            make_job_template(
                session,
                name=name,
                template_type='input',
                template_content=gen_string('alpha'),
                org=self.organization.name,
            )
            self.jobtemplate.add_input(name, var_name)
            self.jobtemplate.update(
                name,
                template_type='input',
                template_content='<%= input("{0}") %>'.format(var_name))
            self.jobtemplate.click(self.jobtemplate.search(name))
            self.jobtemplate.click(common_locators['ace.preview'])
            self.assertEqual(
                u'$USER_INPUT[{0}]'.format(var_name),
                self.jobtemplate.wait_until_element(
                    locators['job.template_input']).text)
Exemplo n.º 30
0
    def test_positive_update_bookmark_name(self):
        """Update and save a bookmark

        @Feature: Scoped Search Bookmark Update

        @Setup:

        1. Create a bookmark of a random name with random query

        @Steps:

        1. List the bookmarks (Navigate to Administer -> Bookmarks)
        2. Click the pre-created bookmark
        3. Edit the name
        4. Submit
        5. Navigate to the entity page
        6. Click the search dropdown

        @Assert: The new bookmark name is listed
        """
        for entity in self.entities:
            with self.subTest(entity):
                with Session(self.browser) as session:
                    name = gen_string(choice(STRING_TYPES))
                    query = gen_string(choice(STRING_TYPES))
                    session.nav.go_to_select_org(self.org_.name)
                    ui_lib = getattr(self, entity['name'].lower())
                    ui_lib.create_a_bookmark(
                        name=name,
                        public=True,
                        query=query,
                    )
                    new_name = gen_string(choice(STRING_TYPES))
                    self.bookmark.update(entity['controller'], name, new_name,
                                         query)
                    self.assertIsNotNone(
                        self.bookmark.search(entity['controller'], new_name))