コード例 #1
0
    def test_remove_user_3(self, user_name):
        """
        @feature: Organizations
        @test: Create admin users then add user and remove it
        by using the organization name
        @assert: The user is added then removed from the organization
        @BZ: 1076562
        """

        strategy = common_locators["entity_select"][0]
        value = common_locators["entity_select"][1]
        strategy1 = common_locators["entity_deselect"][0]
        value1 = common_locators["entity_deselect"][1]
        org_name = generate_string("alpha", 8)
        password = generate_string("alpha", 8)
        email = generate_email_address()
        search_key = "login"
        self.login.login(self.katello_user, self.katello_passwd)
        self.navigator.go_to_users()
        self.user.create(user_name, email, password, password)
        self.assertIsNotNone(self.user.search(user_name, search_key))
        self.navigator.go_to_org()
        self.org.create(org_name, users=[user_name], edit=True)
        self.org.search(org_name).click()
        self.org.wait_until_element(tab_locators["orgs.tab_users"]).click()
        element = self.org.wait_until_element((strategy1, value1 % user_name))
        # Item is listed in 'Selected Items' list and not 'All Items' list.
        self.assertTrue(element)
        self.navigator.go_to_org()
        self.org.update(org_name, users=[user_name], new_users=None)
        self.org.search(org_name).click()
        self.org.wait_until_element(tab_locators["orgs.tab_users"]).click()
        element = self.org.wait_until_element((strategy, value % user_name))
        # Item is listed in 'All Items' list and not 'Selected Items' list.
        self.assertTrue(element)
コード例 #2
0
    def test_update_os_template(self):
        """
        @Test: Update provisioning template
        @Feature: OS - Positive Update
        @Assert: OS is updated
        @BZ: 1129612
        """

        os_name = generate_string("alpha", 6)
        major_version = generate_string('numeric', 1)
        template_name = generate_string("alpha", 4)
        temp_type = 'provision'
        template_path = get_data_file(OS_TEMPLATE_DATA_FILE)
        os_list = [os_name]
        with Session(self.browser) as session:
            make_os(session, name=os_name,
                    major_version=major_version)
            self.assertIsNotNone(self.operatingsys.search(os_name))
            make_templates(session, name=template_name,
                           template_path=template_path,
                           custom_really=True, template_type=temp_type,
                           os_list=os_list)
            self.assertIsNotNone(self.template.search(template_name))
            self.navigator.go_to_operating_systems()
            self.operatingsys.update(os_name, template=template_name)
            result_obj = self.operatingsys.get_os_entities(os_name, "template")
            self.assertEqual(template_name, result_obj['template'])
コード例 #3
0
 def setup_to_create_cv(self,
                        cv_name,
                        repo_name=None,
                        repo_url=None,
                        repo_type=None):
     """
     Create product/repo and sync it and create CV
     """
     cv_name = cv_name or generate_string("alpha", 8)
     repo_name = repo_name or generate_string("alpha", 8)
     prd_name = generate_string("alpha", 8)
     repo_url = repo_url or "http://inecas.fedorapeople.org/fakerepos/zoo3/"
     repo_type = repo_type or REPO_TYPE['yum']
     self.navigator.go_to_products()
     self.products.create(prd_name)
     self.assertIsNotNone(self.products.search(prd_name))
     self.repository.create(repo_name,
                            product=prd_name,
                            url=repo_url,
                            repo_type=repo_type)
     self.assertIsNotNone(self.repository.search(repo_name))
     self.navigator.go_to_sync_status()
     sync = self.sync.sync_custom_repos(prd_name, [repo_name])
     self.assertIsNotNone(sync)
     self.navigator.go_to_content_views()
     self.content_views.create(cv_name)
     self.assertIsNotNone(self.content_views.search(cv_name))
コード例 #4
0
 def test_create_package_group_filter(self):
     """
     @test: create content views package group filter(positive)
     @feature: Content Views
     @assert: content views filter created and selected package groups
     can be added for inclusion/exclusion
     """
     cv_name = generate_string("alpha", 8)
     filter_name = generate_string("alpha", 8)
     repo_name = generate_string("alpha", 8)
     repo_url = "http://inecas.fedorapeople.org/fakerepos/zoo3/"
     content_type = FILTER_CONTENT_TYPE['package group']
     filter_type = FILTER_TYPE['include']
     package_group = 'mammals'
     self.login.login(self.katello_user, self.katello_passwd)
     self.navigator.go_to_select_org(self.org_name)
     self.navigator.go_to_content_views()
     self.setup_to_create_cv(cv_name, repo_name, repo_url)
     # Navigating to dashboard is a workaround to
     # refresh the repos under selected CV
     self.navigator.go_to_dashboard()
     self.navigator.go_to_content_views()
     self.content_views.add_remove_repos(cv_name, [repo_name])
     self.content_views.add_filter(cv_name, filter_name, content_type,
                                   filter_type)
     # Navigating to dashboard is a workaround to
     # refresh filters under selected CV
     self.navigator.go_to_dashboard()
     self.navigator.go_to_content_views()
     self.content_views.add_remove_package_groups_to_filter(
         cv_name, filter_name, [package_group])
     self.assertTrue(
         self.content_views.wait_until_element(
             common_locators["alert.success"]))
コード例 #5
0
    def test_add_user_2(self, user):
        """
        @feature: Organizations
        @test: Create different types of users then add user
        by using the organization name
        @assert: User is added to organization
        @BZ: 1076562
        """

        strategy = common_locators["entity_deselect"][0]
        value = common_locators["entity_deselect"][1]
        org_name = generate_string("alpha", 8)
        password = generate_string("alpha", 8)
        email = generate_email_address()
        search_key = "login"
        self.login.login(self.katello_user, self.katello_passwd)
        self.navigator.go_to_org()
        self.org.create(org_name)
        self.navigator.go_to_org()
        self.assertIsNotNone(self.org.search(org_name))
        self.navigator.go_to_users()
        self.user.create(user, email, password, password)
        self.assertIsNotNone(self.user.search(user, search_key))
        self.navigator.go_to_org()
        self.org.update(org_name, new_users=[user])
        self.org.search(org_name).click()
        self.org.wait_until_element(tab_locators["orgs.tab_users"]).click()
        element = self.org.wait_until_element((strategy, value % user))
        self.assertTrue(element)
コード例 #6
0
    def test_delete_template_1(self):
        """
        @Test: Check if Template can be deleted
        @Feature: Template - Delete
        @Assert: Template is deleted
        @BZ: 1096333
        """

        content = generate_string("alpha", 10)
        name = generate_string("alpha", 10)

        new_obj = make_template({
            'name': name,
            'content': content,
        })

        result = Template.info({'id': new_obj['id']})
        self.assertEqual(result.return_code, 0)
        self.assertEqual(len(result.stderr), 0)
        self.assertEqual(new_obj['name'], result.stdout['name'])

        Template.delete({'id': new_obj['id']})

        result = Template.info({'id': new_obj['id']})
        self.assertNotEqual(result.return_code, 0)
        self.assertGreater(len(result.stderr), 0)
コード例 #7
0
 def test_negative_create_os_8(self):
     """
     @Test: OS - Create a new OS with same name and version
     @Feature: Create a new OS - Negative
     @Assert: OS is not created
     @BZ: 1120985
     """
     name = generate_string("alpha", 6)
     major_version = generate_string('numeric', 1)
     minor_version = generate_string('numeric', 1)
     os_family = "Red Hat"
     arch = "x86_64"
     with Session(self.browser) as session:
         make_os(session, name=name,
                 major_version=major_version,
                 minor_version=minor_version,
                 os_family=os_family, archs=[arch])
         self.assertIsNotNone(self.operatingsys.search(name))
         make_os(session, name=name,
                 major_version=major_version,
                 minor_version=minor_version,
                 os_family=os_family, archs=[arch])
         self.assertIsNotNone(self.operatingsys.wait_until_element
                              (common_locators["haserror"]))
         self.assertIsNone(self.operatingsys.search(name))
コード例 #8
0
    def test_remove_medium_1(self, medium):
        """@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 = generate_string("alpha", 8)
        path = URL % generate_string("alpha", 6)
        os_family = "Red Hat"
        with Session(self.browser) as session:
            make_media(session, name=medium, path=path, os_family=os_family)
            self.assertIsNotNone(self.medium.search(medium))
            make_org(session, org_name=org_name, medias=[medium], edit=True)
            self.org.search(org_name).click()
            session.nav.wait_until_element(
                tab_locators["context.tab_media"]).click()
            element = session.nav.wait_until_element((strategy1,
                                                      value1 % medium))
            # 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],
                            new_medias=None)
            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))
            # Item is listed in 'All Items' list and not 'Selected Items' list.
            self.assertIsNotNone(element)
コード例 #9
0
    def test_positive_delete_activation_key_4(self, cv_name):
        """
        @Feature: Activation key - Positive Delete
        @Test: Create Activation key and delete it for all variations of
        Content Views
        @Steps:
        1. Create Activation key for all valid Content Views in [1]
        using valid Name, Description, Environment, Usage limit
        2. Delete the Activation key
        @Assert: Activation key is deleted
        """

        name = generate_string("alpha", 8)
        env_name = generate_string("alpha", 6)
        self.login.login(self.katello_user, self.katello_passwd)
        self.navigator.go_to_select_org(self.org_name)
        self.navigator.go_to_life_cycle_environments()
        self.contentenv.create(env_name,
                               description=generate_string("alpha", 16))
        self.assertTrue(
            self.contentenv.wait_until_element(
                common_locators["alert.success"]))
        self.create_cv(cv_name, env_name)
        self.navigator.go_to_activation_keys()
        self.activationkey.create(name,
                                  env_name,
                                  description=generate_string("alpha", 16),
                                  content_view=cv_name)
        self.assertIsNotNone(self.activationkey.search_key(name))
        self.activationkey.delete(name, True)
        self.assertIsNone(self.activationkey.search_key(name))
コード例 #10
0
 def test_update_template_os(self):
     """
     @Feature: Template - Positive Update
     @Test: Creates new template, along with two OS's
     and associate list of OS's with created template
     @Assert: The template should be updated with newly created OS's
     successfully
     """
     name = generate_string("alpha", 6)
     new_name = generate_string("alpha", 6)
     temp_type = 'provision'
     os_name1 = generate_string("alpha", 6)
     os_name2 = generate_string("alpha", 6)
     os_list = [os_name1, os_name2]
     major_version = generate_string('numeric', 1)
     template_path = get_data_file(OS_TEMPLATE_DATA_FILE)
     self.login.login(self.katello_user, self.katello_passwd)
     for os_name in os_list:
         self.navigator.go_to_operating_systems()
         self.operatingsys.create(os_name, major_version)
         self.assertIsNotNone(self.operatingsys.search(os_name))
     self.create_template(name, template_path, True,
                          temp_type, None)
     self.template.update(name, False, new_name, new_os_list=os_list)
     self.assertIsNotNone(self.template.search(new_name))
コード例 #11
0
def make_sync_plan(options=None):
    """
    Usage:
        hammer sync-plan create [OPTIONS]

    Options:
        --description DESCRIPTION     sync plan description
        --interval INTERVAL           how often synchronization should run
                                      One of ''none',', ''hourly',',
                                      ''daily',', ''weekly''
                                      Default: "none"
        --name NAME                   sync plan name
        --organization-id ORGANIZATION_ID Filter products by organization
                                      name or label
        --sync-date SYNC_DATE         start date and time of the
                                      synchronization Date and time
                                      in YYYY-MM-DD HH:MM:SS or ISO 8601 format
    """

    # Organization ID is a required field.
    if not options or not options.get('organization-id', None):
        raise Exception("Please provide a valid ORG ID.")

    args = {
        'name': generate_string('alpha', 20),
        'description': generate_string('alpha', 20),
        'organization-id': None,
        'sync-date': datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
        'interval': random.choice(SYNC_INTERVAL.values()),
    }

    args = update_dictionary(args, options)
    args.update(create_object(SyncPlan, args))

    return args
コード例 #12
0
    def test_remove_content_host(self):
        """@Test: Check if content host can be removed from host collection

        @Feature: Host Collection

        @Assert: Host collection is created and content-host is removed

        """

        host_col_name = generate_string('alpha', 15)
        content_host_name = generate_string('alpha', 15)

        try:
            new_host_col = self._new_host_collection({'name': host_col_name})
            new_system = make_content_host({
                u'name': content_host_name,
                u'organization-id': self.org['id'],
                u'content-view-id': self.default_cv['id'],
                u'lifecycle-environment-id': self.library['id']})
        except CLIFactoryError as err:
            self.fail(err)

        result = HostCollection.add_content_host({
            u'id': new_host_col['id'],
            u'organization-id': self.org['id'],
            u'content-host-ids': new_system['id']
        })
        self.assertEqual(result.return_code, 0,
                         "Content Host not added to host collection")
        self.assertEqual(len(result.stderr), 0,
                         "No error was expected")

        result = HostCollection.info({
            u'id': new_host_col['id'],
            u'organization-id': self.org['id']
        })

        no_of_content_host = result.stdout['total-content-hosts']

        result = HostCollection.remove_content_host({
            u'id': new_host_col['id'],
            u'organization-id': self.org['id'],
            u'content-host-ids': new_system['id']
        })
        self.assertEqual(result.return_code, 0,
                         "Content Host not removed host collection")
        self.assertEqual(len(result.stderr), 0,
                         "No error was expected")

        result = HostCollection.info({
            u'id': new_host_col['id'],
            u'organization-id': self.org['id']
        })
        self.assertEqual(
            result.return_code, 0, 'Failed to get info for host collection')
        self.assertEqual(
            len(result.stderr), 0, 'There should not be an error here')
        self.assertGreater(no_of_content_host,
                           result.stdout['total-content-hosts'],
                           "There should not be an exception here")
コード例 #13
0
    def test_cv_publish_custom_content(self):
        """
        @test: attempt to publish a content view containing custom content
        @feature: Content Views
        @setup: Multiple environments for an org; custom content synced
        @assert: Content view can be published
        """

        repo_name = generate_string("alpha", 8)
        env_name = generate_string("alpha", 8)
        repo_url = "http://inecas.fedorapeople.org/fakerepos/zoo3/"
        name = generate_string("alpha", 8)
        with Session(self.browser) as session:
            session.nav.go_to_select_org(self.org_name)
            session.nav.go_to_life_cycle_environments()
            self.contentenv.create(env_name)
            self.assertIsNotNone(self.contentenv.wait_until_element
                                 (common_locators["alert.success"]))
            self.setup_to_create_cv(name, repo_name, repo_url)
            self.content_views.add_remove_repos(name, [repo_name])
            self.assertIsNotNone(self.content_views.wait_until_element
                                 (common_locators["alert.success"]))
            self.content_views.publish(name)
            self.assertIsNotNone(self.content_views.wait_until_element
                                 (common_locators["alert.success"]))
コード例 #14
0
def make_product(options=None):
    """
    Usage:
        hammer product create [OPTIONS]

    Options:
        --description DESCRIPTION     Product description
        --gpg-key-id GPG_KEY_ID       Identifier of the GPG key
        --label LABEL
        --name NAME
        --organization-id ORGANIZATION_ID ID of the organization
        --sync-plan-id SYNC_PLAN_ID   Plan numeric identifier
        -h, --help                    print help
    """

    # Organization ID is a required field.
    if not options or not options.get('organization-id', None):
        raise Exception("Please provide a valid ORG ID.")

    args = {
        'name': generate_string('alpha', 20),
        'label': generate_string('alpha', 20),
        'description': generate_string('alpha', 20),
        'organization-id': None,
        'gpg-key-id': None,
        'sync-plan-id': None,
    }

    args = update_dictionary(args, options)
    args.update(create_object(Product, args))

    return args
コード例 #15
0
    def test_add_medium_1(self, medium):
        """@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 = generate_string("alpha", 8)
        path = URL % generate_string("alpha", 6)
        os_family = "Red Hat"
        with Session(self.browser) as session:
            make_org(session, org_name=org_name)
            self.assertIsNotNone(self.org.search(org_name))
            make_media(session, name=medium, path=path,
                       os_family=os_family)
            self.assertIsNotNone(self.medium.search(medium))
            self.org.update(org_name, new_medias=[medium])
            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))
            self.assertIsNotNone(element)
コード例 #16
0
    def test_cv_composite_create(self):
        # Note: puppet repos cannot/should not be used in this test
        # It shouldn't work - and that is tested in a different case.
        # Individual modules from a puppet repo, however, are a valid
        # variation.
        """
        @test: create a composite content views
        @feature: Content Views
        @setup: sync multiple content source/types (RH, custom, etc.)
        @assert: Composite content views are created
        """

        repo_url = "http://davidd.fedorapeople.org/repos/random_puppet/"
        puppet_module = "httpd"
        module_ver = 'Latest'
        cv_name = generate_string("alpha", 8)
        composite_name = generate_string("alpha", 8)
        self.login.login(self.katello_user, self.katello_passwd)
        self.navigator.go_to_select_org(self.org_name)
        self.setup_to_create_cv(cv_name, repo_url=repo_url,
                                repo_type=REPO_TYPE['puppet'])
        module = self.content_views.add_puppet_module(cv_name,
                                                      puppet_module,
                                                      filter_term=module_ver)
        self.assertIsNotNone(module)
        self.content_views.publish(cv_name)
        self.content_views.create(composite_name, is_composite=True)
        self.content_views.add_remove_cv(composite_name, [cv_name])
        self.assertIsNotNone(self.content_views.wait_until_element
                             (common_locators["alert.success"]))
コード例 #17
0
    def test_cv_end_2_end(self):
        """
        @test: create content view
        @feature: Content Views
        @steps:
        1. Create Product/repo and Sync it
        2. Create CV and add created repo in step1
        3. Publish and promote it to 'Library'
        4. Promote it to next environment
        @assert: content view is created, updated with repo publish and
        promoted to next selected env
        """

        repo_name = generate_string("alpha", 8)
        env_name = generate_string("alpha", 8)
        repo_url = "http://inecas.fedorapeople.org/fakerepos/zoo3/"
        name = generate_string("alpha", 8)
        publish_version = "Version 1"
        self.login.login(self.katello_user, self.katello_passwd)
        self.navigator.go_to_select_org(self.org_name)
        self.navigator.go_to_life_cycle_environments()
        self.contentenv.create(env_name)
        self.assertIsNotNone(self.contentenv.wait_until_element
                             (common_locators["alert.success"]))
        self.setup_to_create_cv(name, repo_name, repo_url)
        self.content_views.add_remove_repos(name, [repo_name])
        self.assertIsNotNone(self.content_views.wait_until_element
                             (common_locators["alert.success"]))
        self.content_views.publish(name)
        self.assertIsNotNone(self.content_views.wait_until_element
                             (common_locators["alert.success"]))
        self.content_views.promote(name, publish_version, env_name)
        self.assertIsNotNone(self.content_views.wait_until_element
                             (common_locators["alert.success"]))
コード例 #18
0
    def test_create_package_filter(self):
        """
        @test: create content views package filter(positive)
        @feature: Content Views
        @assert: content views filter created and selected packages
        can be added for inclusion/exclusion
        """

        cv_name = generate_string("alpha", 8)
        filter_name = generate_string("alpha", 8)
        repo_name = generate_string("alpha", 8)
        repo_url = "http://inecas.fedorapeople.org/fakerepos/zoo3/"
        content_type = FILTER_CONTENT_TYPE['package']
        filter_type = FILTER_TYPE['include']
        package_names = ['cow', 'bird', 'crow', 'bear']
        version_types = ['Equal To', 'Greater Than', 'Less Than', 'Range']
        values = ['0.3', '0.5', '0.5', '4.1']
        max_values = [None, None, None, '4.6']
        self.login.login(self.katello_user, self.katello_passwd)
        self.navigator.go_to_select_org(self.org_name)
        self.navigator.go_to_content_views()
        self.setup_to_create_cv(cv_name, repo_name, repo_url)
        self.content_views.add_remove_repos(cv_name, [repo_name])
        self.content_views.add_filter(cv_name, filter_name,
                                      content_type, filter_type)
        self.content_views.add_packages_to_filter(cv_name, filter_name,
                                                  package_names, version_types,
                                                  values, max_values)
コード例 #19
0
    def test_negative_update_activation_key_2(self):
        """@Test: Update invalid Description in an activation key

        @Feature: Activation key - Negative Update

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

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

        @BZ: 1078676

        """

        name = generate_string("alpha", 10)
        description = generate_string("alpha", 10)
        new_description = generate_string("alpha", 1001)
        with Session(self.browser) as session:
            make_activationkey(session, org=self.org_name,
                               name=name, env=ENVIRONMENT,
                               description=description)
            self.assertIsNotNone(self.activationkey.search_key(name))
            self.activationkey.update(name, description=new_description)
            self.assertIsNotNone(self.activationkey.wait_until_element
                                 (common_locators["alert.error"]))
コード例 #20
0
    def test_associate_product_2(self):
        """@Test: Test that custom product can be associated to Activation Keys

        @Feature: Activation key - Product

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

        @Assert: Custom products are successfully associated to Activation key

        @BZ: 1078676

        """

        name = generate_string("alpha", 8)
        cv_name = generate_string("alpha", 8)
        env_name = generate_string("alpha", 8)
        # Helper function to create and promote CV to next environment
        # and it returns product name to associate it with key
        product_name = self.create_cv(cv_name, env_name)
        with Session(self.browser) as session:
            make_activationkey(session, org=self.org_name,
                               name=name, env=env_name,
                               description=generate_string("alpha", 16),
                               content_view=cv_name)
            self.assertIsNotNone(self.activationkey.search_key(name))
            self.activationkey.associate_product(name, [product_name])
            self.assertIsNotNone(self.activationkey.wait_until_element
                                 (common_locators["alert.success"]))
コード例 #21
0
    def test_positive_update_activation_key_3(self, env_name):
        """@Test: Update Environment in an Activation key

        @Feature: Activation key - Positive Update

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

        @Assert: Activation key is updated

        @BZ: 1089637

        """

        name = generate_string("alpha", 8)
        cv_name = generate_string("alpha", 8)
        # Helper function to create and promote CV to next environment
        self.create_cv(cv_name, env_name)
        with Session(self.browser) as session:
            make_activationkey(session, org=self.org_name,
                               name=name, env=ENVIRONMENT,
                               description=generate_string("alpha", 16))
            self.assertIsNotNone(self.activationkey.search_key(name))
            env_locator = locators["ak.selected_env"]
            selected_env = self.activationkey.get_attribute(name, env_locator)
            self.assertEqual(ENVIRONMENT, selected_env)
            self.activationkey.update(name, content_view=cv_name, env=env_name)
            self.assertIsNotNone(self.activationkey.wait_until_element
                                 (common_locators["alert.success"]))
            selected_env = self.activationkey.get_attribute(name, env_locator)
            self.assertEqual(env_name, selected_env)
コード例 #22
0
 def test_update_resource(self):
     """
     @Feature: Compute Resource - Update
     @Test: Update a libvirt Compute Resource
     @Assert: The libvirt Compute Resource is updated
     """
     name = generate_string("alpha", 8)
     newname = generate_string("alpha", 8)
     org_name = generate_string("alpha", 8)
     new_org = generate_string("alpha", 8)
     libvirt_url = "qemu+tcp://%s:16509/system"
     url = (libvirt_url % conf.properties['main.server.hostname'])
     self.login.login(self.katello_user, self.katello_passwd)
     self.create_org(org_name)
     self.create_org(new_org)
     self.navigator.go_to_compute_resources()
     self.compute_resource.create(name, [org_name],
                                  provider_type="Libvirt",
                                  url=url)
     self.navigator.go_to_compute_resources()
     self.compute_resource.update(name,
                                  newname, [org_name], [new_org],
                                  libvirt_set_passwd=False)
     self.navigator.go_to_compute_resources()
     search = self.compute_resource.search(newname)
     self.assertIsNotNone(search)
コード例 #23
0
ファイル: factory.py プロジェクト: bluesky-sgao/robottelo
def make_sync_plan(options=None):
    """
    Usage:
        hammer sync-plan create [OPTIONS]

    Options:
        --description DESCRIPTION     sync plan description
        --interval INTERVAL           how often synchronization should run
                                      One of ''none',', ''hourly',',
                                      ''daily',', ''weekly''
                                      Default: "none"
        --name NAME                   sync plan name
        --organization-id ORGANIZATION_ID Filter products by organization
                                      name or label
        --sync-date SYNC_DATE         start date and time of the
                                      synchronization Date and time
                                      in YYYY-MM-DD HH:MM:SS or ISO 8601 format
    """

    # Organization ID is a required field.
    if not options or not options.get('organization-id', None):
        raise Exception("Please provide a valid ORG ID.")

    args = {
        'name': generate_string('alpha', 20),
        'description': generate_string('alpha', 20),
        'organization-id': None,
        'sync-date': datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
        'interval': random.choice(SYNC_INTERVAL.values()),
    }

    args = update_dictionary(args, options)
    args.update(create_object(SyncPlan, args))

    return args
コード例 #24
0
    def test_add_user_2(self, name):
        """@test: Create different types of users then add user
        by using the organization name.

        @feature: Organizations associate user.

        @assert: User is added to organization.

        """

        strategy, value = common_locators["entity_deselect"]
        org_name = generate_string("alpha", 8)
        password = generate_string("alpha", 8)
        email = generate_email_address()
        search_key = "login"
        with Session(self.browser) as session:
            make_org(session, org_name=org_name)
            self.assertIsNotNone(self.org.search(org_name))
            make_user(session, username=name, first_name=name,
                      last_name=name, email=email,
                      password1=password, password2=password)
            self.assertIsNotNone(self.user.search(name, search_key))
            self.org.wait_for_ajax()
            self.org.update(org_name, new_users=[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 % name))
            self.assertIsNotNone(element)
コード例 #25
0
 def test_create_package_group_filter(self):
     """
     @test: create content views package group filter(positive)
     @feature: Content Views
     @assert: content views filter created and selected package groups
     can be added for inclusion/exclusion
     """
     cv_name = generate_string("alpha", 8)
     filter_name = generate_string("alpha", 8)
     repo_name = generate_string("alpha", 8)
     repo_url = "http://inecas.fedorapeople.org/fakerepos/zoo3/"
     content_type = FILTER_CONTENT_TYPE['package group']
     filter_type = FILTER_TYPE['include']
     package_group = 'mammals'
     self.login.login(self.katello_user, self.katello_passwd)
     self.navigator.go_to_select_org(self.org_name)
     self.navigator.go_to_content_views()
     self.setup_to_create_cv(cv_name, repo_name, repo_url)
     self.content_views.add_remove_repos(cv_name, [repo_name])
     self.content_views.add_filter(cv_name, filter_name,
                                   content_type, filter_type)
     self.content_views.add_remove_package_groups_to_filter(cv_name,
                                                            filter_name,
                                                            [package_group])
     self.assertIsNotNone(self.content_views.wait_until_element
                          (common_locators["alert.success"]))
コード例 #26
0
    def test_positive_create_activation_key_3(self, env):
        """
        @Feature: Activation key - Positive Create
        @Test: Create Activation key for all variations of Environments
        @Steps:
        1. Create Activation key for all valid Environments in [1]
        using valid Name, Description, Content View and Usage limit
        @Assert: Activation key is created
        @BZ: 1078676
        """

        name = generate_string("alpha", 8)
        cv_name = generate_string("alpha", 8)
        self.login.login(self.katello_user, self.katello_passwd)
        self.navigator.go_to_select_org(self.org_name)
        self.navigator.go_to_life_cycle_environments()
        self.contentenv.create(env, description=generate_string("alpha", 16))
        self.assertTrue(
            self.contentenv.wait_until_element(
                common_locators["alert.success"]))
        self.create_cv(cv_name, env)
        self.navigator.go_to_activation_keys()
        self.activationkey.create(name,
                                  env,
                                  description=generate_string("alpha", 16),
                                  content_view=cv_name)
        self.assertIsNotNone(self.activationkey.search_key(name))
コード例 #27
0
ファイル: factory.py プロジェクト: bluesky-sgao/robottelo
def make_product(options=None):
    """
    Usage:
        hammer product create [OPTIONS]

    Options:
        --description DESCRIPTION     Product description
        --gpg-key-id GPG_KEY_ID       Identifier of the GPG key
        --label LABEL
        --name NAME
        --organization-id ORGANIZATION_ID ID of the organization
        --sync-plan-id SYNC_PLAN_ID   Plan numeric identifier
        -h, --help                    print help
    """

    # Organization ID is a required field.
    if not options or not options.get('organization-id', None):
        raise Exception("Please provide a valid ORG ID.")

    args = {
        'name': generate_string('alpha', 20),
        'label': generate_string('alpha', 20),
        'description': generate_string('alpha', 20),
        'organization-id': None,
        'gpg-key-id': None,
        'sync-plan-id': None,
    }

    args = update_dictionary(args, options)
    args.update(create_object(Product, args))

    return args
コード例 #28
0
    def test_create_package_filter(self):
        """@test: create content views package filter(positive)

        @feature: Content Views

        @assert: content views filter created and selected packages
        can be added for inclusion/exclusion

        """

        cv_name = generate_string("alpha", 8)
        filter_name = generate_string("alpha", 8)
        repo_name = generate_string("alpha", 8)
        content_type = FILTER_CONTENT_TYPE['package']
        filter_type = FILTER_TYPE['include']
        package_names = ['cow', 'bird', 'crow', 'bear']
        version_types = ['Equal To', 'Greater Than', 'Less Than', 'Range']
        values = ['0.3', '0.5', '0.5', '4.1']
        max_values = [None, None, None, '4.6']
        with Session(self.browser) as session:
            self.setup_to_create_cv(session, cv_name, repo_name)
            self.content_views.add_remove_repos(cv_name, [repo_name])
            self.content_views.add_filter(cv_name, filter_name,
                                          content_type, filter_type)
            self.content_views.add_packages_to_filter(cv_name, filter_name,
                                                      package_names,
                                                      version_types,
                                                      values, max_values)
コード例 #29
0
    def test_positive_update_user_1(self, new_username):
        """@Test: Update Username in User

        @Feature: User - Positive Update

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

        @Assert: User is updated

        @Status: Manual

        @BZ: 1139616

        """
        name = generate_string("alpha", 6)
        password = generate_string("alpha", 8)
        search_key = "login"
        self.login.login(self.katello_user, self.katello_passwd)  # login
        self.create_user(name, password)
        self.user.update(search_key, name, new_username)
        self.assertIsNotNone(
            self.user.search(new_username, search_key))
        self.login.logout()
        self.login.login(new_username, password)
        self.assertTrue(self.login.is_logged())
コード例 #30
0
 def create_medium(self, name=None, path=None, os_family=None):
     "Create Installation media with navigation steps"
     name = name or generate_string("alpha", 6)
     path = path or URL % generate_string("alpha", 6)
     self.navigator.go_to_installation_media()  # go to media page
     self.medium.create(name, path, os_family)
     self.assertIsNotNone(self.medium.search(name))
コード例 #31
0
    def test_positive_create_user_10(self):
        """@Test: Create User with multiple roles

        @Feature: User - Positive Create

        @Steps:
        1. Create User with multiple roles assigned to it

        @Assert: User is created

        @Status: Manual

        """
        strategy = common_locators["entity_deselect"][0]
        value = common_locators["entity_deselect"][1]
        name = generate_string("alpha", 6)
        role1 = generate_string("alpha", 6)
        role2 = generate_string("alpha", 6)
        search_key = "login"
        self.login.login(self.katello_user, self.katello_passwd)  # login
        self.navigator.go_to_roles()
        self.role.create(role1)
        self.role.create(role2)
        self.create_user(name, roles=[role1, role2])
        self.user.search(name, search_key).click()
        self.user.wait_until_element(tab_locators["users.tab_roles"]).click()
        element1 = self.user.wait_until_element((strategy,
                                                value % role1))
        element2 = self.user.wait_until_element((strategy,
                                                value % role2))
        self.assertTrue(element1)
        self.assertTrue(element2)
コード例 #32
0
    def test_positive_create_user_25(self):
        """@Test: Create User associated to multiple Orgs

        @Feature: User - Positive Create

        @Assert: User is created

        @Status: Manual

        """
        strategy = common_locators["entity_deselect"][0]
        value = common_locators["entity_deselect"][1]
        name = generate_string("alpha", 6)
        org_name1 = generate_string("alpha", 6)
        org_name2 = generate_string("alpha", 6)
        search_key = "login"
        self.login.login(self.katello_user, self.katello_passwd)  # login
        make_org(Session(self.browser), org_name=org_name1)
        make_org(Session(self.browser), org_name=org_name2)
        self.create_user(name, organizations=[org_name1, org_name2])
        self.user.search(name, search_key).click()
        self.user.wait_until_element(
            tab_locators["users.tab_organizations"]).click()
        element1 = self.user.wait_until_element((strategy,
                                                value % org_name1))
        element2 = self.user.wait_until_element((strategy,
                                                 value % org_name2))
        self.assertTrue(element1)
        self.assertTrue(element2)
コード例 #33
0
    def test_cv_publish_custom_content(self):
        """@test: attempt to publish a content view containing custom content

        @feature: Content Views

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

        @assert: Content view can be published

        """

        repo_name = generate_string("alpha", 8)
        env_name = generate_string("alpha", 8)
        name = generate_string("alpha", 8)
        with Session(self.browser) as session:
            make_lifecycle_environment(session, org=self.org_name,
                                       name=env_name)
            self.assertIsNotNone(self.contentenv.wait_until_element
                                 (common_locators["alert.success"]))
            self.setup_to_create_cv(session, name, repo_name)
            self.content_views.add_remove_repos(name, [repo_name])
            self.assertIsNotNone(self.content_views.wait_until_element
                                 (common_locators["alert.success"]))
            self.content_views.publish(name)
            self.assertIsNotNone(self.content_views.wait_until_element
                                 (common_locators["alert.success"]))
コード例 #34
0
    def test_update_role(self):
        """@Test: Update role for a user

        @Feature: User - Update

        @Assert: User role is updated

        """

        strategy = common_locators["entity_deselect"][0]
        value = common_locators["entity_deselect"][1]
        name = generate_string("alpha", 6)
        role = generate_string("alpha", 6)
        search_key = "login"
        self.login.login(self.katello_user, self.katello_passwd)  # login
        self.navigator.go_to_roles()
        self.role.create(role)
        self.assertIsNotNone(self, self.role.search(role))
        self.create_user(name)
        self.user.search(name, search_key).click()
        self.user.wait_until_element(tab_locators["users.tab_roles"]).click()
        element1 = self.user.wait_until_element((strategy,
                                                 value % role))
        self.assertIsNone(element1)
        self.user.update(search_key, name, new_roles=[role])
        self.user.search(name, search_key).click()
        self.user.wait_until_element(tab_locators["users.tab_roles"]).click()
        element2 = self.user.wait_until_element((strategy,
                                                value % role))
        self.assertTrue(element2)
コード例 #35
0
    def test_update_template_1(self):
        """@Test: Check if Template can be updated

        @Feature: Template - Update

        @Assert: Template is updated

        """

        content = generate_string("alpha", 10)
        name = generate_string("alpha", 10)

        try:
            new_obj = make_template(
                {
                    'name': name,
                    'content': content,
                }
            )
        except CLIFactoryError as e:
            self.fail(e)

        result = Template.info({'id': new_obj['id']})
        self.assertEqual(result.return_code, 0)
        self.assertEqual(len(result.stderr), 0)
        self.assertEqual(new_obj['name'], result.stdout['name'])

        updated_name = generate_string("alpha", 10)
        Template.update({'id': new_obj['id'], 'name': updated_name})
        result = Template.info({'id': new_obj['id']})
        self.assertEqual(result.return_code, 0)
        self.assertEqual(len(result.stderr), 0)
        self.assertEqual(updated_name, result.stdout['name'])
コード例 #36
0
    def test_create_package_group_filter(self):
        """@test: create content views package group filter(positive)

        @feature: Content Views

        @assert: content views filter created and selected package groups
        can be added for inclusion/exclusion

        """
        cv_name = generate_string("alpha", 8)
        filter_name = generate_string("alpha", 8)
        repo_name = generate_string("alpha", 8)
        content_type = FILTER_CONTENT_TYPE['package group']
        filter_type = FILTER_TYPE['include']
        package_group = 'mammals'
        with Session(self.browser) as session:
            self.setup_to_create_cv(session, cv_name, repo_name)
            self.content_views.add_remove_repos(cv_name, [repo_name])
            self.content_views.add_filter(cv_name, filter_name,
                                          content_type, filter_type)
            self.content_views.add_remove_package_groups_to_filter(
                cv_name,
                filter_name,
                [package_group]
            )
            self.assertIsNotNone(self.content_views.wait_until_element
                                 (common_locators["alert.success"]))
コード例 #37
0
    def test_create_errata_filter(self):
        """@test: create content views errata filter(positive)

        @feature: Content Views

        @assert: content views filter created and selected errata-id
        can be added for inclusion/exclusion

        """

        cv_name = generate_string("alpha", 8)
        filter_name = generate_string("alpha", 8)
        repo_name = generate_string("alpha", 8)
        content_type = FILTER_CONTENT_TYPE['erratum by id']
        filter_type = FILTER_TYPE['include']
        errata_ids = ['RHEA-2012:0001', 'RHEA-2012:0004']
        with Session(self.browser) as session:
            self.setup_to_create_cv(session, cv_name, repo_name)
            self.content_views.add_remove_repos(cv_name, [repo_name])
            self.content_views.add_filter(cv_name, filter_name,
                                          content_type, filter_type)
            self.content_views.add_remove_errata_to_filter(cv_name,
                                                           filter_name,
                                                           errata_ids)
            self.assertIsNotNone(self.content_views.wait_until_element
                                 (common_locators["alert.success"]))
コード例 #38
0
    def test_dump_template_1(self):
        """@Test: Check if Template can be created with specific content

        @Feature: Template - Create

        @Assert: Template is created with specific content

        """

        content = generate_string("alpha", 10)
        name = generate_string("alpha", 10)

        new_obj = make_template(
            {
                'name': name,
                'content': content,
            }
        )

        result = Template.info({'id': new_obj['id']})
        self.assertEqual(result.return_code, 0)
        self.assertEqual(len(result.stderr), 0)
        self.assertEqual(new_obj['name'], result.stdout['name'])

        template_content = Template.dump({'id': new_obj['id']})
        self.assertIn(content, template_content.stdout[0])
コード例 #39
0
    def test_add_medium_1(self, medium):
        """
        @feature: Organizations
        @test: Add medium by using the organization name and medium name
        @assert: medium is added
        @BZ: 1076562
        """

        strategy = common_locators["entity_deselect"][0]
        value = common_locators["entity_deselect"][1]
        org_name = generate_string("alpha", 8)
        path = URL % generate_string("alpha", 6)
        os_family = "Red Hat"
        self.login.login(self.katello_user, self.katello_passwd)
        self.navigator.go_to_org()
        self.org.create(org_name)
        self.navigator.go_to_org()
        self.assertIsNotNone(self.org.search(org_name))
        self.navigator.go_to_installation_media()
        self.medium.create(medium, path, os_family)
        self.assertIsNotNone(self.medium.search(medium))
        self.navigator.go_to_org()
        self.org.update(org_name, new_medias=[medium])
        self.org.search(org_name).click()
        self.org.wait_until_element(tab_locators["orgs.tab_media"]).click()
        element = self.org.wait_until_element((strategy, value % medium))
        self.assertTrue(element)
コード例 #40
0
 def test_remove_filter(self):
     """
     @test: create empty content views filter and remove it(positive)
     @feature: Content Views
     @assert: content views filter removed successfully
     """
     cv_name = generate_string("alpha", 8)
     filter_name = generate_string("alpha", 8)
     content_type = FILTER_CONTENT_TYPE['package']
     filter_type = FILTER_TYPE['exclude']
     self.login.login(self.katello_user, self.katello_passwd)
     self.navigator.go_to_select_org(self.org_name)
     self.navigator.go_to_content_views()
     self.content_views.create(cv_name)
     self.assertIsNotNone(self.content_views.search(cv_name))
     self.content_views.add_filter(cv_name, filter_name, content_type,
                                   filter_type)
     # Navigating to dashboard is a workaround to
     # refresh filters under selected CV
     self.navigator.go_to_dashboard()
     self.navigator.go_to_content_views()
     self.content_views.remove_filter(cv_name, [filter_name])
     self.assertTrue(
         self.content_views.wait_until_element(
             common_locators["alert.success"]))
コード例 #41
0
    def test_delete_template_1(self):
        """@Test: Check if Template can be deleted

        @Feature: Template - Delete

        @Assert: Template is deleted

        @BZ: 1096333

        """

        content = generate_string("alpha", 10)
        name = generate_string("alpha", 10)

        new_obj = make_template(
            {
                'name': name,
                'content': content,
            }
        )

        result = Template.info({'id': new_obj['id']})
        self.assertEqual(result.return_code, 0)
        self.assertEqual(len(result.stderr), 0)
        self.assertEqual(new_obj['name'], result.stdout['name'])

        Template.delete({'id': new_obj['id']})

        result = Template.info({'id': new_obj['id']})
        self.assertNotEqual(result.return_code, 0)
        self.assertGreater(len(result.stderr), 0)
コード例 #42
0
    def create_user(self, name=None, password=None,
                    email=None, firstname=None,
                    lastname=None,
                    locale=None, roles=None,
                    organizations=None,
                    locations=None, authorized_by="INTERNAL",
                    password2=None):
        """Function to create a new User"""

        name = name or generate_string("alpha", 8)
        password = password or generate_string("alpha", 8)
        if not password2:
            password2 = password
        email = email or generate_email_address()
        first_name = firstname or generate_string("alpha", 10)
        last_name = lastname or generate_string("alpha", 8)
        self.navigator.go_to_users()
        self.user.create(username=name, email=email,
                         password1=password,
                         password2=password2,
                         first_name=first_name,
                         last_name=last_name,
                         roles=roles,
                         locations=locations,
                         organizations=organizations,
                         locale=locale,
                         authorized_by=authorized_by,
                         edit=True)
コード例 #43
0
 def create_arch(self, arch_name, os_names=None):
     """
     Function navigates and creates new architecture from UI
     """
     arch_name = arch_name or generate_string("alpha", 10)
     os_names = os_names or [generate_string("alpha", 10)]
     self.navigator.go_to_architectures()  # go to architecture page
     self.architecture.create(arch_name, os_names)
     self.assertIsNotNone(self.architecture.search(arch_name))
コード例 #44
0
 def test_create_medium(self):
     """
     @Feature: Media - Create
     @Test: Create a new media
     @Assert: Media is created
     """
     name = generate_string("alpha", 6)
     path = URL % generate_string("alpha", 6)
     os_family = "Red Hat"
     self.login.login(self.katello_user, self.katello_passwd)  # login
     self.create_medium(name, path, os_family)
コード例 #45
0
 def test_set_parameter(self):
     """
     @Feature: OS - Positive Update
     @Test: Set OS parameter
     @Assert: OS is updated
     """
     name = generate_string("alpha", 4)
     major_version = generate_string('numeric', 1)
     param_name = generate_string("alpha", 4)
     param_value = generate_string("alpha", 3)
     self.login.login(self.katello_user, self.katello_passwd)  # login
     self.create_os(name, major_version)
     self.operatingsys.set_os_parameter(name, param_name, param_value)
コード例 #46
0
    def create_os(self, name=None, major_version=None,
                  minor_version=None, os_family=None, archs=None):
        """
        Function to create OS with all navigation steps
        """

        name = name or generate_string("alpha", 6)
        major_version = major_version or generate_string('numeric', 1)
        minor_version = minor_version or generate_string('numeric', 1)
        self.navigator.go_to_operating_systems()  # go to operating system page
        self.operatingsys.create(name, major_version,
                                 minor_version, os_family, archs)
        self.assertIsNotNone(self.operatingsys.search(name))
コード例 #47
0
 def test_create_env(self):
     """
     @Feature: Environment - Positive Create
     @Test: Create new environment
     @Assert: Environment is created
     """
     name = generate_string("alpha", 8)
     org_name = generate_string("alpha", 8)
     self.login.login(self.katello_user, self.katello_passwd)
     self.create_org(org_name)
     self.navigator.go_to_environments()
     self.environment.create(name, [org_name])
     search = self.environment.search(name)
     self.assertIsNotNone(search)
コード例 #48
0
 def test_create_arch(self):
     """
     @Feature: Architecture - Create
     @Test: Create a new Architecture
     @Assert: Architecture is created
     """
     name = generate_string("alpha", 4)
     os_name = generate_string("alpha", 6)
     major_version = generate_string('numeric', 1)
     self.login.login(self.katello_user, self.katello_passwd)  # login
     self.navigator.go_to_operating_systems()  # go to operating system page
     self.operatingsys.create(os_name, major_version)
     self.assertIsNotNone(self.operatingsys.search(os_name))
     self.create_arch(name, [os_name])
コード例 #49
0
 def test_remove_env(self):
     """
     @Feature: Environment - Positive Delete
     @Test: Delete an environment
     @Assert: Environment is deleted
     """
     name = generate_string("alpha", 6)
     org_name = generate_string("alpha", 8)
     self.login.login(self.katello_user, self.katello_passwd)
     self.create_org(org_name)
     self.navigator.go_to_environments()
     self.environment.create(name, [org_name])
     self.environment.delete(name, really=True)
     notif = self.user.wait_until_element(common_locators["notif.success"])
     self.assertTrue(notif)
コード例 #50
0
 def test_update_hostgroup(self):
     """
     @Feature: Hostgroup - Positive Update
     @Test: Update hostgroup with a new name
     @Assert: Hostgroup is updated
     """
     name = generate_string("alpha", 7)
     updated_name = generate_string("alpha", 7)
     self.login.login(self.katello_user, self.katello_passwd)
     self.navigator.go_to_host_groups()
     self.hostgroup.create(name)
     # confirm the Hostgroup appears in the UI
     self.assertIsNotNone(self.hostgroup.search(name))
     self.hostgroup.update(name, new_name=updated_name)
     self.assertIsNotNone(self.hostgroup.search(updated_name))
コード例 #51
0
 def test_remove_medium(self):
     """
     @Feature: Media - Delete
     @Test: Delete a media
     @Assert: Media is deleted
     """
     name = generate_string("alpha", 6)
     path = URL % generate_string("alpha", 6)
     os_family = "Red Hat"
     self.login.login(self.katello_user, self.katello_passwd)  # login
     self.create_medium(name, path, os_family)
     self.medium.delete(name, True)
     self.assertTrue(self.medium.wait_until_element
                     (common_locators["notif.success"]))
     self.assertIsNone(self.medium.search(name))
コード例 #52
0
 def test_positive_create_content_environment_1(self):
     """
     @Feature: Content Environment - Positive Create
     @Test: Create Content Environment with minimal input parameters
     @Assert: Environment is created
     """
     name = generate_string("alpha", 6)
     description = generate_string("alpha", 6)
     self.login.login(self.katello_user, self.katello_passwd)
     self.navigator.go_to_select_org(self.org_name)
     self.navigator.go_to_life_cycle_environments()
     self.contentenv.create(name, description)
     self.assertTrue(
         self.contentenv.wait_until_element(
             common_locators["alert.success"]))
コード例 #53
0
class TestFact(BaseCLI):
    """
    Fact related tests.
    """
    @unittest.skip("Need to create facts before we can check them.")
    @data(
        'uptime',
        'uptime_days',
        'uptime_seconds',
        'memoryfree',
        'ipaddress',
    )
    @attr('cli', 'fact')
    def test_list_success(self, fact):
        """
        @Feature: Fact - List Positive
        @Test: Test Fact List
        @Assert: Fact List is displayed
        """

        args = {
            'search': "fact='%s'" % fact,
        }

        result = Fact().list(args)
        stdout = result.stdout

        self.assertEqual(stdout[0]['fact'], fact)

    @data(
        generate_string("alpha", 10),
        generate_string("alpha", 10),
        generate_string("alpha", 10),
        generate_string("alpha", 10),
    )
    @attr('cli', 'fact')
    def test_list_fail(self, fact):
        """
        @Feature: Fact - List Negative
        @Test: Test Fact List failure
        @Assert: Fact List is not displayed
        """

        args = {
            'search': "fact='%s'" % fact,
        }
        self.assertEqual(Fact().list(args).stdout, [],
                         "No records should be returned")
コード例 #54
0
    def test_update_subnet_1(self):
        """
        @Feature: Subnet - Positive Update
        @Test: Update Subnet name
        @Assert: Subnet name is updated
        """

        subnet_name = generate_string("alpha", 8)
        subnet_network = generate_ipaddr(ip3=True)
        subnet_mask = "255.255.255.0"
        self.login.login(self.katello_user, self.katello_passwd)
        self.create_subnet(subnet_name, subnet_network, subnet_mask)
        new_subnet_name = generate_string("alpha", 10)
        self.subnet.update(subnet_name, new_subnet_name=new_subnet_name)
        result_object = self.subnet.search_subnet(new_subnet_name)
        self.assertEqual(new_subnet_name, result_object['name'])
コード例 #55
0
 def test_update_medium(self):
     """
     @Feature: Media - Update
     @Test: Update a media with name, path, OS family
     @Assert: Media is updated
     """
     name = generate_string("alpha", 6)
     newname = generate_string("alpha", 4)
     path = URL % generate_string("alpha", 6)
     newpath = URL % generate_string("alpha", 6)
     os_family = "Red Hat"
     new_os_family = "Debian"
     self.login.login(self.katello_user, self.katello_passwd)  # login
     self.create_medium(name, path, os_family)
     self.medium.update(name, newname, newpath, new_os_family)
     self.assertTrue(self, self.medium.search(newname))
コード例 #56
0
    def test_positive_create_3(self):
        """
        @Feature: Content Sync Plan - Positive Create
        @Test: Create Sync plan with specified start time
        @Assert: Sync Plan is created with the specified time.
        @BZ: 1082632
        """

        locator = locators["sp.fetch_startdate"]
        plan_name = generate_string("alpha", 8)
        self.configure_syncplan()
        description = "sync plan create with start date"
        current_date = datetime.now()
        startdate = current_date + timedelta(minutes=10)
        starthour = startdate.strftime("%H")
        startminute = startdate.strftime("%M")
        # Formatting current_date to web-UI format "%b %d, %Y %I:%M:%S %p"
        # Removed zero padded hrs & mins as fetching via web-UI doesn't have it
        # Removed the seconds info as it would be too quick to validate via UI.
        fetch_starttime = startdate.strftime("%b %d, %Y %I:%M:%S %p").\
            lstrip("0").replace(" 0", " ").rpartition(':')[0]
        self.syncplan.create(plan_name,
                             description,
                             start_hour=starthour,
                             start_minute=startminute)
        self.assertIsNotNone(self.products.search(plan_name))
        self.syncplan.search(plan_name).click()
        self.syncplan.wait_for_ajax()
        # Removed the seconds info as it would be too quick to validate via UI.
        starttime_text = str(self.syncplan.wait_until_element(locator).text).\
            rpartition(':')[0]
        self.assertEqual(starttime_text, fetch_starttime)
コード例 #57
0
 def setUp(self):
     super(ActivationKey, self).setUp()
     # Make sure to use the Class' org_name instance
     if ActivationKey.org_name is None:
         ActivationKey.org_name = generate_string("alpha", 10)
         with Session(self.browser) as session:
             make_org(session, org_name=ActivationKey.org_name)
コード例 #58
0
 def setUp(self):
     super(Syncplan, self).setUp()
     # Make sure to use the Class' org_name instance
     if Syncplan.org_name is None:
         Syncplan.org_name = generate_string("alpha", 8)
         with Session(self.browser) as session:
             make_org(session, org_name=Syncplan.org_name)
コード例 #59
0
    def test_positive_update_3(self, plan_name):
        """
        @Feature: Content Sync Plan - Positive Update add products
        @Test: Update Sync plan and associate products
        @Assert: Sync Plan has the associated product
        """

        prd_name = generate_string("alpha", 8)
        description = "update sync plan, add prds"
        strategy, value = locators["sp.prd_select"]
        self.login.login(self.katello_user, self.katello_passwd)
        self.navigator.go_to_select_org(self.org_name)
        self.navigator.go_to_products()
        self.products.create(prd_name, description)
        self.assertIsNotNone(self.products.search(prd_name))
        self.navigator.go_to_sync_plans()
        self.syncplan.create(plan_name, description)
        self.assertIsNotNone(self.products.search(plan_name))
        self.syncplan.update(plan_name, add_products=[prd_name])
        self.syncplan.search(plan_name).click()
        self.syncplan.wait_for_ajax()
        self.syncplan.wait_until_element(tab_locators["sp.tab_products"]).\
            click()
        self.syncplan.wait_for_ajax()
        prd_element = self.syncplan.wait_until_element(
            (strategy, value % prd_name))
        self.assertTrue(prd_element)