def test_positive_rhev_vm_power_on(self):
        """The virtual machine in rhev cr should be powered on.

        @id: fb42e739-c35b-4c6f-a727-b99a4d695191

        @Assert: The virtual machine is switched on

        @CaseAutomation: Automated
        """
        parameter_list = [
            ['URL', self.rhev_url, 'field'],
            ['Username', self.rhev_username, 'field'],
            ['Password', self.rhev_password, 'field'],
            ['Datacenter', self.rhev_datacenter, 'special select'],
        ]
        name = gen_string('alpha')
        with Session(self.browser) as session:
            make_resource(
                session,
                name=name,
                provider_type=FOREMAN_PROVIDERS['rhev'],
                parameter_list=parameter_list
            )
            self.assertEqual(self.compute_resource.set_power_status(
                name, self.rhev_vm_name, True), u'On')
    def test_positive_rhev_vm_power_off(self):
        """The virtual machine in rhev cr should be powered Off.

        @id: e2996210-7f49-4de4-a298-4a142506ed48

        @Assert: The virtual machine is switched Off

        @CaseAutomation: Automated
        """
        parameter_list = [
            ['URL', self.rhev_url, 'field'],
            ['Username', self.rhev_username, 'field'],
            ['Password', self.rhev_password, 'field'],
            ['Datacenter', self.rhev_datacenter, 'special select'],
        ]
        name = gen_string('alpha')
        with Session(self.browser) as session:
            make_resource(
                session,
                name=name,
                provider_type=FOREMAN_PROVIDERS['rhev'],
                parameter_list=parameter_list
            )
            self.assertEqual(self.compute_resource.set_power_status(
                name, self.rhev_vm_name, False), u'Off')
    def test_positive_rhev_vm_power_on_off(self):
        """The virtual machine in rhev cr should be powered on and off.

        :id: fb42e739-c35b-4c6f-a727-b99a4d695191

        :expectedresults: The virtual machine is switched on and switched off

        :CaseAutomation: Automated
        """
        parameter_list = [
            ['URL', self.rhev_url, 'field'],
            ['Username', self.rhev_username, 'field'],
            ['Password', self.rhev_password, 'field'],
            ['Datacenter', self.rhev_datacenter, 'special select'],
        ]
        cr_name = gen_string('alpha')
        with Session(self) as session:
            make_resource(
                session,
                name=cr_name,
                provider_type=FOREMAN_PROVIDERS['rhev'],
                parameter_list=parameter_list
            )
            if self.compute_resource.power_on_status(
                    cr_name, self.rhev_vm_name) == 'on':
                self.compute_resource.set_power_status(
                    cr_name, self.rhev_vm_name, False)
            self.assertEqual(self.compute_resource.set_power_status(
                cr_name, self.rhev_vm_name, True), u'On')
            self.assertEqual(self.compute_resource.set_power_status(
                cr_name, self.rhev_vm_name, False), u'Off')
Exemplo n.º 4
0
    def test_update_resource(self, testdata):
        """@Test: Update a libvirt Compute Resource's Organization

        @Feature: Compute Resource - Update

        @Assert: The libvirt Compute Resource is updated

        """
        name = testdata['name']
        newname = testdata['newname']
        org_name1 = entities.Organization(
            name=gen_string("alpha", 8)).create_json()['name']
        org_name2 = entities.Organization(
            name=gen_string("alpha", 8)).create_json()['name']
        libvirt_url = "qemu+tcp://%s:16509/system"
        provider_type = FOREMAN_PROVIDERS['libvirt']
        url = (libvirt_url % conf.properties['main.server.hostname'])
        with Session(self.browser) as session:
            make_resource(session,
                          name=name,
                          orgs=[org_name1],
                          provider_type=provider_type,
                          url=url,
                          org_select=True)
            search = self.compute_resource.search(name)
            self.assertIsNotNone(search)
            self.compute_resource.update(name,
                                         newname, [org_name1], [org_name2],
                                         libvirt_set_passwd=False)
            search = self.compute_resource.search(newname)
            self.assertIsNotNone(search)
    def test_positive_retrieve_rhev_vm_list(self):
        """Retrieve the Virtual machine list from rhev compute resource

        :id: f8cef7fb-e14c-4d12-9862-0e448a59ca50

        :setup: rhev hostname and credentials.

        :steps:

            1. Select the created compute resource.
            2. Go to "Virtual Machines" tab.

        :CaseAutomation: Automated

        :expectedresults: The Virtual machines should be displayed
        """
        parameter_list = [
            ['URL', self.rhev_url, 'field'],
            ['Username', self.rhev_username, 'field'],
            ['Password', self.rhev_password, 'field'],
            ['Datacenter', self.rhev_datacenter, 'special select'],
        ]
        name = gen_string('alpha')
        with Session(self) as session:
            make_resource(
                session,
                name=name,
                provider_type=FOREMAN_PROVIDERS['rhev'],
                parameter_list=parameter_list
            )
            self.assertIsNotNone(self.compute_resource.search(name))
            vms = self.compute_resource.list_vms(name)
            self.assertTrue(self.rhev_vm_name in vms)
    def test_positive_access_rhev_with_default_profile(self):
        """Associate default (3-Large) compute profile to rhev compute resource

        :id: 7049227e-f384-4aa1-8a01-228c3e7292a6

        :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. Select the created rhev CR.
            4. Click Compute Profile tab.
            5. Select (3-Large) and submit.

        :CaseAutomation: Automated

        :expectedresults: The Compute Resource created and opened successfully
        """
        parameter_list = [
            ['URL', self.rhev_url, 'field'],
            ['Username', self.rhev_username, 'field'],
            ['Password', self.rhev_password, 'field'],
            ['Datacenter', self.rhev_datacenter, 'special select'],
        ]
        name = gen_string('alpha')
        with Session(self) as session:
            make_resource(
                session,
                name=name,
                provider_type=FOREMAN_PROVIDERS['rhev'],
                parameter_list=parameter_list
            )
            self.assertIsNotNone(self.compute_profile.select_resource(
                '3-Large', name, 'RHEV'))
    def test_positive_create_rhev_with_same_name(self):
        """Create a new rhev Compute Resource with existing name correction

        :id: b9499d65-ef70-48b7-854a-f4cf740fbf9c

        :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 valid name to rhev Compute Resource.
            4. Test the connection using Load Datacenter and submit.
            5. Create again a compute resource with same name.
            6. After error of name already taken,
               update with different name
            7. Click submit

        :CaseAutomation: Automated

        :expectedresults: A rhev CR is created successfully with proper
            connection.

        :CaseImportance: Critical

        :BZ: 1467664
        """
        name = gen_string('alpha')
        new_name = gen_string('alpha')
        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:
            make_resource(
                session,
                name=name,
                provider_type=FOREMAN_PROVIDERS['rhev'],
                parameter_list=parameter_list
            )
            self.assertIsNotNone(self.compute_resource.search(name))
            make_resource(
                session,
                name=name,
                provider_type=FOREMAN_PROVIDERS['rhev'],
                parameter_list=parameter_list
            )
            self.compute_resource.assign_value(
                locators['resource.name'],
                new_name
            )
            self.compute_resource.click(common_locators['submit'])
            self.assertIsNone(
                self.compute_resource.wait_until_element(
                    common_locators["alert.error"],
                    timeout=2,
                )
            )
Exemplo n.º 8
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 = generate_string("alpha", 8)
     libvirt_url = "qemu+tcp://%s:16509/system"
     url = (libvirt_url % conf.properties['main.server.hostname'])
     with Session(self.browser) as session:
         make_resource(session, name=resource_name, provider_type="Libvirt",
                       url=url)
         self.assertIsNotNone(self.compute_resource.search(resource_name))
         make_org(session, org_name=org_name, resources=[resource_name],
                  edit=True)
         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)
    def test_negative_create_libvirt_with_invalid_name(self):
        """Create a new libvirt Compute Resource with incorrect values
        only

        :id: 4d9be6b5-f9d4-402e-ad13-843335d83879

        :expectedresults: A libvirt Compute Resource is not created

        :CaseImportance: Critical
        """
        include_list = [' ']
        with Session(self) as session:
            for name in invalid_names_list() + include_list:
                with self.subTest(name):
                    make_resource(
                        session,
                        name=name,
                        provider_type=FOREMAN_PROVIDERS['libvirt'],
                        parameter_list=[
                            ['URL', self.current_libvirt_url, 'field']
                        ],
                    )
                    self.assertIsNotNone(
                        self.compute_resource.wait_until_element(
                            common_locators["name_haserror"]
                        )
                    )
Exemplo n.º 10
0
    def test_positive_update_libvirt_organization(self):
        """@Test: Update a libvirt Compute Resource organization

        @Feature: Compute Resource - Update

        @Assert: The libvirt Compute Resource is updated
        """
        name = gen_string('alpha')
        with Session(self.browser) as session:
            make_resource(
                session,
                name=name,
                provider_type=FOREMAN_PROVIDERS['libvirt'],
                parameter_list=[
                    ['URL', self.current_libvirt_url, 'field']],
                orgs=[entities.Organization().create().name],
                org_select=True
            )
            search = self.compute_resource.search(name)
            self.assertIsNotNone(search)
            self.compute_resource.update(
                name=name,
                orgs=[entities.Organization().create().name],
                org_select=True
            )
Exemplo n.º 11
0
    def test_negative_create_libvirt_with_invalid_name(self):
        """@Test: Create a new libvirt Compute Resource with incorrect values
        only

        @Feature: Compute Resource - Create

        @Assert: A libvirt Compute Resource is not created
        """
        include_list = [' ']
        with Session(self.browser) as session:
            for name in invalid_names_list() + include_list:
                with self.subTest(name):
                    make_resource(
                        session,
                        name=name,
                        provider_type=FOREMAN_PROVIDERS['libvirt'],
                        parameter_list=[
                            ['URL', self.current_libvirt_url, 'field']
                        ],
                    )
                    self.assertIsNotNone(
                        self.compute_resource.wait_until_element(
                            common_locators["name_haserror"]
                        )
                    )
Exemplo n.º 12
0
    def test_update_resource(self, testdata):
        """@Test: Update a libvirt Compute Resource's Organization

        @Feature: Compute Resource - Update

        @Assert: The libvirt Compute Resource is updated

        @BZ: 1123352

        """
        name = testdata['name']
        newname = testdata['newname']
        org_name = generate_string("alpha", 8)
        new_org = generate_string("alpha", 8)
        libvirt_url = "qemu+tcp://%s:16509/system"
        provider_type = FOREMAN_PROVIDERS['libvirt']
        url = (libvirt_url % conf.properties['main.server.hostname'])
        with Session(self.browser) as session:
            make_resource(session, name=name, orgs=[org_name],
                          provider_type=provider_type, url=url)
            search = self.compute_resource.search(name)
            self.assertIsNotNone(search)
            make_org(session, org_name=new_org)
            self.compute_resource.update(name, newname, [org_name], [new_org],
                                         libvirt_set_passwd=False)
            search = self.compute_resource.search(newname)
            self.assertIsNotNone(search)
Exemplo n.º 13
0
    def test_negative_create_vmware_with_invalid_name(self):
        """Create a new vmware compute resource with invalid names.

        :id: 19c206dc-5efc-4a7d-b04d-2aa04a22448c

        :setup: vmware hostname and credentials.

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

        :expectedresults: A vmware compute resource is not created

        :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'],
        ]
        with Session(self) as session:
            for name in invalid_names_list():
                with self.subTest(name):
                    make_resource(session,
                                  name=name,
                                  provider_type=FOREMAN_PROVIDERS['vmware'],
                                  parameter_list=parameter_list)
                    self.assertIsNotNone(
                        self.compute_resource.wait_until_element(
                            common_locators["name_haserror"]))
Exemplo n.º 14
0
    def test_positive_delete_ec2(self):
        """Delete An ec2 compute resource

        :id: fd1ba240-d47f-42c8-a1d1-146ab5fd2641

        :setup: ec2 hostname and credentials.

        :steps:

            1. Create a compute resource of type ec2.
            2. Provide a valid Access Key and Secret Key.
            3. Provide a valid name to ec2 compute resource.
            4. Test the connection using Load Regions and submit.
            5. Delete the created compute resource.

        :expectedresults: The compute resource is deleted

        :BZ: 1451626

        :CaseAutomation: Automated

        :CaseImportance: Critical
        """
        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.assertIsNotNone(self.compute_resource.search(name))
            self.compute_resource.delete(name, dropdown_present=True)
            self.assertIsNone(self.compute_resource.search(name))
Exemplo n.º 15
0
    def test_positive_rhev_vm_power_on(self):
        """The virtual machine in rhev cr should be powered on.

        @id: fb42e739-c35b-4c6f-a727-b99a4d695191

        @Assert: The virtual machine is switched on

        @CaseAutomation: Automated
        """
        parameter_list = [
            ['URL', self.rhev_url, 'field'],
            ['Username', self.rhev_username, 'field'],
            ['Password', self.rhev_password, 'field'],
            ['Datacenter', self.rhev_datacenter, 'special select'],
        ]
        name = gen_string('alpha')
        with Session(self.browser) as session:
            make_resource(
                session,
                name=name,
                provider_type=FOREMAN_PROVIDERS['rhev'],
                parameter_list=parameter_list
            )
            self.assertEqual(self.compute_resource.set_power_status(
                name, self.rhev_vm_name, True), u'On')
Exemplo n.º 16
0
    def test_negative_create_libvirt_with_invalid_name(self):
        """Create a new libvirt Compute Resource with incorrect values
        only

        :id: 4d9be6b5-f9d4-402e-ad13-843335d83879

        :expectedresults: A libvirt Compute Resource is not created

        :CaseImportance: Critical
        """
        include_list = [' ']
        with Session(self.browser) as session:
            for name in invalid_names_list() + include_list:
                with self.subTest(name):
                    make_resource(
                        session,
                        name=name,
                        provider_type=FOREMAN_PROVIDERS['libvirt'],
                        parameter_list=[[
                            'URL', self.current_libvirt_url, 'field'
                        ]],
                    )
                    self.assertIsNotNone(
                        self.compute_resource.wait_until_element(
                            common_locators["name_haserror"]))
Exemplo n.º 17
0
    def test_positive_retrieve_rhev_vm_list(self):
        """Retrieve the Virtual machine list from rhev compute resource

        @id: f8cef7fb-e14c-4d12-9862-0e448a59ca50

        @setup: rhev hostname and credentials.

        @steps:

        1. Select the created compute resource.
        2. Go to "Virtual Machines" tab.

        @CaseAutomation: Automated

        @Assert: The Virtual machines should be displayed
        """
        parameter_list = [
            ['URL', self.rhev_url, 'field'],
            ['Username', self.rhev_username, 'field'],
            ['Password', self.rhev_password, 'field'],
            ['Datacenter', self.rhev_datacenter, 'special select'],
        ]
        name = gen_string('alpha')
        with Session(self.browser) as session:
            make_resource(
                session,
                name=name,
                provider_type=FOREMAN_PROVIDERS['rhev'],
                parameter_list=parameter_list
            )
            self.assertIsNotNone(self.compute_resource.search(name))
            vms = self.compute_resource.list_vms(name)
            self.assertTrue(self.rhev_vm_name in vms)
Exemplo n.º 18
0
    def test_positive_retrieve_vmware_vm_list(self):
        """List the virtual machine list from vmware compute resource

        :id: 21ade57a-0caa-4144-9c46-c8e22f33414e

        :setup: vmware hostname and credentials.

        :steps:

            1. Select the created compute resource.
            2. Go to "Virtual Machines" tab.

        :expectedresults: The Virtual machines should be displayed

        :Caseautomation: Automated

        :CaseLevel: Integration
        """
        parameter_list = [
            ['VCenter/Server', self.vmware_url, 'field'],
            ['Username', self.vmware_username, 'field'],
            ['Password', self.vmware_password, 'field'],
            ['Datacenter', self.vmware_datacenter, 'special select'],
        ]
        name = gen_string('alpha')
        with Session(self) as session:
            make_resource(session,
                          name=name,
                          provider_type=FOREMAN_PROVIDERS['vmware'],
                          parameter_list=parameter_list)
            self.assertIsNotNone(self.compute_resource.search(name))
            vms = self.compute_resource.list_vms(name)
            self.assertIn(self.vmware_vm_name, vms)
Exemplo n.º 19
0
    def test_positive_create_ec2_with_name(self):
        """Create a new ec2 compute resource with valid name

        :id: 4c74d04a-a276-4d6a-b080-77b2b64942ef

        :setup: ec2 hostname and credentials.

        :steps:
            1. Create a compute resource of type ec2.
            2. Provide a valid Access Key and Secret Key.
            3. Provide a valid name to ec2 compute resource.
            4. Test the connection using Load Regions and submit.

        :expectedresults: An ec2 compute resource is created
            successfully.

        :CaseAutomation: Automated

        :CaseImportance: Critical
        """
        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.assertIsNotNone(self.compute_resource.search(name))
Exemplo n.º 20
0
    def test_positive_update_external(self):
        """Create a Docker-based Compute Resource using an external
        Docker-enabled system then edit its attributes.

        :id: 13d6c7ee-0c90-46cd-8661-73fa1a3c4ef3

        :expectedresults: Compute Resource can be created, listed and its
            attributes can be updated.

        :CaseImportance: Critical
        """
        comp_name = gen_string('alphanumeric')
        with Session(self) as session:
            make_resource(
                session,
                name=comp_name,
                provider_type=FOREMAN_PROVIDERS['docker'],
                parameter_list=[[
                    'URL',
                    settings.docker.external_url,
                    'field'
                ]],
            )
            self.compute_resource.update(
                name=comp_name,
                parameter_list=[['Username', gen_string('alpha'), 'field'],
                                ['Password', gen_string('alpha'), 'field']],
            )
            self.assertIsNotNone(self.compute_resource.wait_until_element(
                common_locators['notif.success']))
Exemplo n.º 21
0
    def test_positive_rhev_vm_power_on_off(self):
        """The virtual machine in rhev cr should be powered on and off.

        :id: fb42e739-c35b-4c6f-a727-b99a4d695191

        :expectedresults: The virtual machine is switched on and switched off

        :CaseAutomation: Automated
        """
        parameter_list = [
            ['URL', self.rhev_url, 'field'],
            ['Username', self.rhev_username, 'field'],
            ['Password', self.rhev_password, 'field'],
            ['Datacenter', self.rhev_datacenter, 'special select'],
        ]
        cr_name = gen_string('alpha')
        with Session(self) as session:
            make_resource(session,
                          name=cr_name,
                          provider_type=FOREMAN_PROVIDERS['rhev'],
                          parameter_list=parameter_list)
            if self.compute_resource.power_on_status(
                    cr_name, self.rhev_vm_name) == 'on':
                self.compute_resource.set_power_status(cr_name,
                                                       self.rhev_vm_name,
                                                       False)
            self.assertEqual(
                self.compute_resource.set_power_status(cr_name,
                                                       self.rhev_vm_name,
                                                       True), u'On')
            self.assertEqual(
                self.compute_resource.set_power_status(cr_name,
                                                       self.rhev_vm_name,
                                                       False), u'Off')
    def test_positive_retrieve_rhev_vm_list(self):
        """Retrieve the Virtual machine list from rhev compute resource

        @id: f8cef7fb-e14c-4d12-9862-0e448a59ca50

        @setup: rhev hostname and credentials.

        @steps:

        1. Select the created compute resource.
        2. Go to "Virtual Machines" tab.

        @CaseAutomation: Automated

        @Assert: The Virtual machines should be displayed
        """
        parameter_list = [
            ["URL", self.rhev_url, "field"],
            ["Username", self.rhev_username, "field"],
            ["Password", self.rhev_password, "field"],
            ["Datacenter", self.rhev_datacenter, "special select"],
        ]
        name = gen_string("alpha")
        with Session(self.browser) as session:
            make_resource(session, name=name, provider_type=FOREMAN_PROVIDERS["rhev"], parameter_list=parameter_list)
            self.assertIsNotNone(self.compute_resource.search(name))
            vms = self.compute_resource.list_vms(name)
            self.assertTrue(self.rhev_vm_name in vms)
    def test_positive_create_rhev_with_name(self):
        """Create a new rhev Compute Resource using different value
        types as a name

        @id: be735d8c-5644-4a42-9a08-2f9c6181a8c6

        @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 valid name to rhev Compute Resource.
        4. Test the connection using Load Datacenter and submit.

        @CaseAutomation: Automated

        @Assert: A rhev CR is created successfully with proper connection.
        """
        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.browser) as session:
            for name in valid_data_list():
                with self.subTest(name):
                    make_resource(
                        session, name=name, provider_type=FOREMAN_PROVIDERS["rhev"], parameter_list=parameter_list
                    )
                    self.assertIsNotNone(self.compute_resource.search(name))
    def test_positive_delete_rhev(self):
        """Delete a rhev Compute Resource

        @id: 4a8b18f0-a2af-491a-bcf7-64d59a0fbc01

        @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 valid name to rhev Compute Resource.
        4. Test the connection using Load Datacenter and submit.
        5. Delete the created compute resource.

        @CaseAutomation: Automated

        @Assert: The Compute Resource is deleted
        """
        parameter_list = [
            ["URL", self.rhev_url, "field"],
            ["Username", self.rhev_username, "field"],
            ["Password", self.rhev_password, "field"],
            ["Datacenter", self.rhev_datacenter, "special select"],
        ]
        name = gen_string("alpha")
        with Session(self.browser) as session:
            with self.subTest(name):
                make_resource(
                    session, name=name, provider_type=FOREMAN_PROVIDERS["rhev"], parameter_list=parameter_list
                )
                self.assertIsNotNone(self.compute_resource.search(name))
                self.compute_resource.delete(name)
    def test_positive_access_rhev_with_default_profile(self):
        """Associate default (3-Large) compute profile to rhev compute resource

        @id: 7049227e-f384-4aa1-8a01-228c3e7292a6

        @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. Select the created rhev CR.
        4. Click Compute Profile tab.
        5. Select (3-Large) and submit.

        @CaseAutomation: Automated

        @Assert: The Compute Resource created and opened successfully
        """
        parameter_list = [
            ["URL", self.rhev_url, "field"],
            ["Username", self.rhev_username, "field"],
            ["Password", self.rhev_password, "field"],
            ["Datacenter", self.rhev_datacenter, "special select"],
        ]
        name = gen_string("alpha")
        with Session(self.browser) as session:
            make_resource(session, name=name, provider_type=FOREMAN_PROVIDERS["rhev"], parameter_list=parameter_list)
            self.assertIsNotNone(self.compute_profile.select_resource("3-Large", name, "RHEV"))
    def test_positive_update_rhev_name(self):
        """Update a rhev Compute Resource name

        @id: 62d0c495-c87e-42dd-91aa-9b9b728f7dda

        @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 valid name to rhev Compute Resource.
        4. Test the connection using Load Datacenter and submit.
        5. Update the name of the created CR with valid string.

        @CaseAutomation: Automated

        @Assert: The rhev Compute Resource is updated
        """
        parameter_list = [
            ["URL", self.rhev_url, "field"],
            ["Username", self.rhev_username, "field"],
            ["Password", self.rhev_password, "field"],
            ["Datacenter", self.rhev_datacenter, "special select"],
        ]
        newname = gen_string("alpha")
        name = gen_string("alpha")
        with Session(self.browser) as session:
            with self.subTest(newname):
                make_resource(
                    session, name=name, provider_type=FOREMAN_PROVIDERS["rhev"], 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))
    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

        @Assert: A rhev Compute Resource is not created
        """
        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.browser) 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"]))
    def test_positive_retrieve_vmware_vm_list(self):
        """List the virtual machine list from vmware compute resource

        :id: 21ade57a-0caa-4144-9c46-c8e22f33414e

        :setup: vmware hostname and credentials.

        :steps:

            1. Select the created compute resource.
            2. Go to "Virtual Machines" tab.

        :expectedresults: The Virtual machines should be displayed

        :Caseautomation: Automated

        :CaseLevel: Integration
        """
        parameter_list = [
            ['VCenter/Server', self.vmware_url, 'field'],
            ['Username', self.vmware_username, 'field'],
            ['Password', self.vmware_password, 'field'],
            ['Datacenter', self.vmware_datacenter, 'special select'],
        ]
        name = gen_string('alpha')
        with Session(self) as session:
            make_resource(
                session,
                name=name,
                provider_type=FOREMAN_PROVIDERS['vmware'],
                parameter_list=parameter_list
            )
            self.assertIsNotNone(self.compute_resource.search(name))
            vms = self.compute_resource.list_vms(name)
            self.assertIn(self.vmware_vm_name, vms)
Exemplo n.º 29
0
    def test_positive_create_rhev_with_description(self):
        """Create rhev Compute Resource with description.

        @id: bd5e3066-395c-486e-bce8-b0a9bdd4e236

        @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 it with some valid description to rhev Compute Resource.
        4. Test the connection using Load Datacenter and submit.

        @CaseAutomation: Automated

        @Assert: A rhev Compute Resource is created successfully
        """
        parameter_list = [
            ['URL', self.rhev_url, 'field'],
            ['Username', self.rhev_username, 'field'],
            ['Password', self.rhev_password, 'field'],
            ['Datacenter', self.rhev_datacenter, 'special select'],
        ]
        name = gen_string('alpha')
        with Session(self.browser) as session:
            for description in valid_data_list():
                with self.subTest(description):
                    make_resource(
                        session,
                        name=name,
                        provider_type=FOREMAN_PROVIDERS['rhev'],
                        parameter_list=parameter_list
                    )
                    self.assertIsNotNone(self.compute_resource.search(name))
    def test_positive_create_rhev_with_description(self):
        """Create rhev Compute Resource with description.

        @id: bd5e3066-395c-486e-bce8-b0a9bdd4e236

        @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 it with some valid description to rhev Compute Resource.
        4. Test the connection using Load Datacenter and submit.

        @CaseAutomation: Automated

        @Assert: A rhev Compute Resource is created successfully
        """
        parameter_list = [
            ["URL", self.rhev_url, "field"],
            ["Username", self.rhev_username, "field"],
            ["Password", self.rhev_password, "field"],
            ["Datacenter", self.rhev_datacenter, "special select"],
        ]
        name = gen_string("alpha")
        with Session(self.browser) as session:
            for description in valid_data_list():
                with self.subTest(description):
                    make_resource(
                        session, name=name, provider_type=FOREMAN_PROVIDERS["rhev"], parameter_list=parameter_list
                    )
                    self.assertIsNotNone(self.compute_resource.search(name))
Exemplo n.º 31
0
    def test_positive_update_internal(self):
        """Create a Docker-based Compute Resource in the Satellite 6
        instance then edit its attributes.

        :id: 6a22e770-6a9a-48ab-94b6-e991e484812d

        :expectedresults: Compute Resource can be created, listed and its
            attributes can be updated.

        :CaseImportance: Critical
        """
        comp_name = gen_string('alphanumeric')
        with Session(self) as session:
            make_resource(
                session,
                name=comp_name,
                provider_type=FOREMAN_PROVIDERS['docker'],
                parameter_list=[[
                    'URL',
                    settings.docker.get_unix_socket_url(),
                    'field'
                ]],
            )
            self.compute_resource.update(
                name=comp_name,
                parameter_list=[['URL', gen_url(), 'field']],
            )
            self.assertIsNotNone(self.compute_resource.wait_until_element(
                common_locators['notif.success']))
Exemplo n.º 32
0
    def test_positive_update_internal(self):
        """Create a Docker-based Compute Resource in the Satellite 6
        instance then edit its attributes.

        :id: 6a22e770-6a9a-48ab-94b6-e991e484812d

        :expectedresults: Compute Resource can be created, listed and its
            attributes can be updated.

        :CaseImportance: Critical
        """
        comp_name = gen_string('alphanumeric')
        with Session(self) as session:
            make_resource(
                session,
                name=comp_name,
                provider_type=FOREMAN_PROVIDERS['docker'],
                parameter_list=[[
                    'URL',
                    settings.docker.get_unix_socket_url(), 'field'
                ]],
            )
            self.compute_resource.update(
                name=comp_name,
                parameter_list=[['URL', gen_url(), 'field']],
            )
            self.assertIsNotNone(
                self.compute_resource.wait_until_element(
                    common_locators['notif.success']))
    def test_positive_update_libvirt_organization(self):
        """Update a libvirt Compute Resource organization

        @Feature: Compute Resource - Update

        @Assert: The libvirt Compute Resource is updated
        """
        name = gen_string('alpha')
        with Session(self.browser) as session:
            make_resource(
                session,
                name=name,
                provider_type=FOREMAN_PROVIDERS['libvirt'],
                parameter_list=[
                    ['URL', self.current_libvirt_url, 'field']],
                orgs=[entities.Organization().create().name],
                org_select=True
            )
            search = self.compute_resource.search(name)
            self.assertIsNotNone(search)
            self.compute_resource.update(
                name=name,
                orgs=[entities.Organization().create().name],
                org_select=True
            )
Exemplo n.º 34
0
    def test_positive_update_external(self):
        """Create a Docker-based Compute Resource using an external
        Docker-enabled system then edit its attributes.

        :id: 13d6c7ee-0c90-46cd-8661-73fa1a3c4ef3

        :expectedresults: Compute Resource can be created, listed and its
            attributes can be updated.

        :CaseImportance: Critical
        """
        comp_name = gen_string('alphanumeric')
        with Session(self) as session:
            make_resource(
                session,
                name=comp_name,
                provider_type=FOREMAN_PROVIDERS['docker'],
                parameter_list=[['URL', settings.docker.external_url,
                                 'field']],
            )
            self.compute_resource.update(
                name=comp_name,
                parameter_list=[['Username',
                                 gen_string('alpha'), 'field'],
                                ['Password',
                                 gen_string('alpha'), 'field']],
            )
            self.assertIsNotNone(
                self.compute_resource.wait_until_element(
                    common_locators['notif.success']))
Exemplo n.º 35
0
    def test_positive_create_ec2_with_name(self):
        """Create a new ec2 compute resource with valid name

        :id: 4c74d04a-a276-4d6a-b080-77b2b64942ef

        :setup: ec2 hostname and credentials.

        :steps:
            1. Create a compute resource of type ec2.
            2. Provide a valid Access Key and Secret Key.
            3. Provide a valid name to ec2 compute resource.
            4. Test the connection using Load Regions and submit.

        :expectedresults: An ec2 compute resource is created
            successfully.

        :Caseautomation: Automated

        :CaseImportance: Critical
        """
        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.assertIsNotNone(self.compute_resource.search(name))
Exemplo n.º 36
0
    def test_add_computeresource_1(self, resource_name):
        """@test: Add compute resource using the organization
        name and computeresource name.

        @feature: Organizations associate compute resource.

        @assert: computeresource is added.

        """
        strategy, value = common_locators["entity_deselect"]
        org_name = generate_string("alpha", 8)
        libvirt_url = "qemu+tcp://%s:16509/system"
        url = (libvirt_url % conf.properties['main.server.hostname'])
        with Session(self.browser) as session:
            make_org(session, org_name=org_name)
            self.assertIsNotNone(self.org.search(org_name))
            make_resource(session, name=resource_name, orgs=[org_name],
                          provider_type="Libvirt", url=url)
            self.assertIsNotNone(self.compute_resource.search(resource_name))
            self.org.update(org_name, new_resources=[resource_name])
            self.org.search(org_name).click()
            session.nav.wait_until_element(
                tab_locators["context.tab_resources"]).click()
            element = session.nav.wait_until_element((strategy,
                                                      value % resource_name))
            self.assertIsNotNone(element)
Exemplo n.º 37
0
    def test_positive_create_vmware_with_name(self):
        """Create a new vmware compute resource using valid name.

        :id: 944ed0da-49d4-4c14-8884-9184d2aef126

        :setup: vmware hostname and credentials.

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

        :expectedresults: A vmware compute resource is created successfully.

        :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'],
        ]
        with Session(self) as session:
            for name in valid_data_list():
                with self.subTest(name):
                    make_resource(session,
                                  name=name,
                                  provider_type=FOREMAN_PROVIDERS['vmware'],
                                  parameter_list=parameter_list)
                    self.assertIsNotNone(self.compute_resource.search(name))
Exemplo n.º 38
0
    def test_positive_create_vmware_with_name(self):
        """Create a new vmware compute resource using valid name.

        :id: 944ed0da-49d4-4c14-8884-9184d2aef126

        :setup: vmware hostname and credentials.

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

        :expectedresults: A vmware compute resource is created successfully.

        :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'],
        ]
        with Session(self) as session:
            for name in valid_data_list():
                with self.subTest(name):
                    make_resource(
                        session,
                        name=name,
                        provider_type=FOREMAN_PROVIDERS['vmware'],
                        parameter_list=parameter_list
                    )
                    self.assertIsNotNone(self.compute_resource.search(name))
Exemplo n.º 39
0
    def test_positive_create_vmware_with_description(self):
        """Create vmware compute resource with valid description.

        :id: bdd879be-3467-41ca-9a67-d98f185ba892

        :setup: vmware hostname and credentials.

        :steps:
            1. Create a compute resource of type vmware.
            2. Provide a valid hostname, username and password.
            3. Provide a valid description to vmware compute resource.
            4. Test the connection using Load Datacenters and submit.

        :expectedresults: A vmware compute resource is created successfully

        :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'],
        ]
        name = gen_string('alpha')
        with Session(self) as session:
            for description in valid_data_list():
                with self.subTest(description):
                    make_resource(session,
                                  name=name,
                                  provider_type=FOREMAN_PROVIDERS['vmware'],
                                  parameter_list=parameter_list)
                    self.assertIsNotNone(self.compute_resource.search(name))
Exemplo n.º 40
0
    def test_update_libvirt_resource_different_name(self):
        """@Test: Update a libvirt Compute Resource name

        @Feature: Compute Resource - Update

        @Assert: The libvirt Compute Resource is updated

        """
        with Session(self.browser) as session:
            for newname in valid_data_list():
                with self.subTest(newname):
                    name = gen_string('alpha')
                    make_resource(
                        session,
                        name=name,
                        provider_type=FOREMAN_PROVIDERS['libvirt'],
                        parameter_list=[
                            ['URL', self.current_libvirt_url, 'field']
                        ],
                    )
                    search = self.compute_resource.search(name)
                    self.assertIsNotNone(search)
                    self.compute_resource.update(name=name, newname=newname)
                    search = self.compute_resource.search(newname)
                    self.assertIsNotNone(search)
Exemplo n.º 41
0
    def test_positive_access_rhev_with_default_profile(self):
        """Associate default (3-Large) compute profile to rhev compute resource

        @id: 7049227e-f384-4aa1-8a01-228c3e7292a6

        @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. Select the created rhev CR.
        4. Click Compute Profile tab.
        5. Select (3-Large) and submit.

        @CaseAutomation: Automated

        @Assert: The Compute Resource created and opened successfully
        """
        parameter_list = [
            ['URL', self.rhev_url, 'field'],
            ['Username', self.rhev_username, 'field'],
            ['Password', self.rhev_password, 'field'],
            ['Datacenter', self.rhev_datacenter, 'special select'],
        ]
        name = gen_string('alpha')
        with Session(self.browser) as session:
            make_resource(
                session,
                name=name,
                provider_type=FOREMAN_PROVIDERS['rhev'],
                parameter_list=parameter_list
            )
            self.assertIsNotNone(self.compute_profile.select_resource(
                '3-Large', name, 'RHEV'))
Exemplo n.º 42
0
    def test_update_external_docker_compute_resource(self):
        """@Test:@Test: Create a Docker-based Compute Resource using an
        external Docker-enabled system then edit its attributes.

        @Assert: Compute Resource can be created, listed and its
        attributes can be updated.

        @Feature: Docker

        """
        comp_name = gen_string('alphanumeric')
        with Session(self.browser) as session:
            make_resource(
                session,
                name=comp_name,
                provider_type=FOREMAN_PROVIDERS['docker'],
                parameter_list=[['URL', EXTERNAL_DOCKER_URL, 'field']],
            )
            self.compute_resource.update(
                name=comp_name,
                parameter_list=[['Username', gen_string('alpha'), 'field'],
                                ['Password', gen_string('alpha'), 'field']],
            )
            self.assertIsNotNone(self.compute_resource.wait_until_element(
                common_locators['notif.success']))
Exemplo n.º 43
0
    def test_positive_create_rhev_with_name(self):
        """Create a new rhev Compute Resource using different value
        types as a name

        @id: be735d8c-5644-4a42-9a08-2f9c6181a8c6

        @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 valid name to rhev Compute Resource.
        4. Test the connection using Load Datacenter and submit.

        @CaseAutomation: Automated

        @Assert: A rhev CR is created successfully with proper connection.
        """
        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.browser) as session:
            for name in valid_data_list():
                with self.subTest(name):
                    make_resource(
                        session,
                        name=name,
                        provider_type=FOREMAN_PROVIDERS['rhev'],
                        parameter_list=parameter_list
                    )
                    self.assertIsNotNone(self.compute_resource.search(name))
    def test_positive_update_libvirt_organization(self):
        """Update a libvirt Compute Resource organization

        :id: a1c3fd14-62e9-4e80-8ef7-bfa36420ce9b

        :expectedresults: The libvirt Compute Resource is updated

        :CaseImportance: Critical
        """
        name = gen_string('alpha')
        with Session(self) as session:
            make_resource(
                session,
                name=name,
                provider_type=FOREMAN_PROVIDERS['libvirt'],
                parameter_list=[
                    ['URL', self.current_libvirt_url, 'field']],
                orgs=[entities.Organization().create().name],
                org_select=True
            )
            self.assertIsNotNone(self.compute_resource.search(name))
            self.compute_resource.update(
                name=name,
                orgs=[entities.Organization().create().name],
                org_select=True
            )
Exemplo n.º 45
0
    def test_positive_rhev_vm_power_off(self):
        """The virtual machine in rhev cr should be powered Off.

        @id: e2996210-7f49-4de4-a298-4a142506ed48

        @Assert: The virtual machine is switched Off

        @CaseAutomation: Automated
        """
        parameter_list = [
            ['URL', self.rhev_url, 'field'],
            ['Username', self.rhev_username, 'field'],
            ['Password', self.rhev_password, 'field'],
            ['Datacenter', self.rhev_datacenter, 'special select'],
        ]
        name = gen_string('alpha')
        with Session(self.browser) as session:
            make_resource(
                session,
                name=name,
                provider_type=FOREMAN_PROVIDERS['rhev'],
                parameter_list=parameter_list
            )
            self.assertEqual(self.compute_resource.set_power_status(
                name, self.rhev_vm_name, False), u'Off')
Exemplo n.º 46
0
    def test_update_resource(self, testdata):
        """@Test: Update a libvirt Compute Resource's Organization

        @Feature: Compute Resource - Update

        @Assert: The libvirt Compute Resource is updated

        """
        name = testdata['name']
        newname = testdata['newname']
        org_name1 = entities.Organization(
            name=gen_string("alpha", 8)
        ).create_json()['name']
        org_name2 = entities.Organization(
            name=gen_string("alpha", 8)
        ).create_json()['name']
        libvirt_url = "qemu+tcp://%s:16509/system"
        provider_type = FOREMAN_PROVIDERS['libvirt']
        url = (libvirt_url % conf.properties['main.server.hostname'])
        with Session(self.browser) as session:
            make_resource(session, name=name, orgs=[org_name1],
                          provider_type=provider_type, url=url,
                          org_select=True)
            search = self.compute_resource.search(name)
            self.assertIsNotNone(search)
            self.compute_resource.update(name, newname,
                                         [org_name1], [org_name2],
                                         libvirt_set_passwd=False)
            search = self.compute_resource.search(newname)
            self.assertIsNotNone(search)
Exemplo n.º 47
0
    def test_positive_create_internal(self):
        """Create a Docker-based Compute Resource in the Satellite 6
        instance.

        :id: 78a65ed3-0dbf-413f-91cf-3a02f7ee12d1

        :expectedresults: Compute Resource can be created and listed.

        :CaseImportance: Critical
        """
        with Session(self) as session:
            for comp_name in valid_data_list():
                with self.subTest(comp_name):
                    make_resource(
                        session,
                        name=comp_name,
                        provider_type=FOREMAN_PROVIDERS['docker'],
                        parameter_list=[[
                            'URL',
                            settings.docker.get_unix_socket_url(),
                            'field'
                        ]],
                    )
                    self.assertIsNotNone(
                        self.compute_resource.search(comp_name))
Exemplo n.º 48
0
    def test_positive_access_ec2_with_default_profile(self):
        """Associate default (3-Large) compute profile to ec2 compute
        resource

        :id: 11577087-8c0c-4e87-aed0-4d1b147fd274

        :setup: ec2 hostname, credentials, and 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. Select (3-Large) 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.assertIsNotNone(
                self.compute_resource.select_profile(name,
                                                     COMPUTE_PROFILE_LARGE))
Exemplo n.º 49
0
    def test_positive_create_external(self):
        """Create a Docker-based Compute Resource using an external
        Docker-enabled system.

        :id: 73ca3ee1-4353-4399-90ba-56560407246e

        :expectedresults: Compute Resource can be created and listed.

        :CaseImportance: Critical
        """
        with Session(self) as session:
            for comp_name in valid_data_list():
                with self.subTest(comp_name):
                    make_resource(
                        session,
                        name=comp_name,
                        provider_type=FOREMAN_PROVIDERS['docker'],
                        parameter_list=[[
                            'URL',
                            settings.docker.external_url,
                            'field'
                        ]],
                    )
                    self.assertIsNotNone(
                        self.compute_resource.search(comp_name))
Exemplo n.º 50
0
    def test_positive_delete_vmware(self):
        """Delete a vmware compute resource

        :id: b38f2c9b-f4e3-41e3-8ee1-3b342025860c

        :setup: vmware hostname and credentials.

        :steps:
            1. Create 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. Delete the created compute resource.

        :expectedresults: The compute resource is deleted

        :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'],
        ]
        name = gen_string('alpha')
        with Session(self) as session:
            with self.subTest(name):
                make_resource(session,
                              name=name,
                              provider_type=FOREMAN_PROVIDERS['vmware'],
                              parameter_list=parameter_list)
                self.assertIsNotNone(self.compute_resource.search(name))
                self.compute_resource.delete(name, dropdown_present=True)
    def test_negative_create_libvirt_with_invalid_name(self):
        """Create a new libvirt Compute Resource with incorrect values
        only

        @Feature: Compute Resource - Create

        @Assert: A libvirt Compute Resource is not created
        """
        include_list = [' ']
        with Session(self.browser) as session:
            for name in invalid_names_list() + include_list:
                with self.subTest(name):
                    make_resource(
                        session,
                        name=name,
                        provider_type=FOREMAN_PROVIDERS['libvirt'],
                        parameter_list=[
                            ['URL', self.current_libvirt_url, 'field']
                        ],
                    )
                    self.assertIsNotNone(
                        self.compute_resource.wait_until_element(
                            common_locators["name_haserror"]
                        )
                    )
    def test_negative_add_image_rhev_with_invalid_name(self):
        """Add images to the rhev compute resource

        :id: 0054b389-1e2f-44d9-a306-0410fc0b9d99

        :setup: rhev hostname, credentials and images as templates in rhev.

        :steps:

            1. Create a compute resource of type rhev.
            2. Provide it with the valid hostname, username and password.
            3. Select the created rhev CR and click images tab.
            4. Select "New image", provide it invalid name and valid
               information.
            5. Select the desired template to create the image from and submit.

        :CaseAutomation: Automated

        :expectedresults: The image should not be added to the CR
        """
        parameter_list = [
            ['URL', self.rhev_url, 'field'],
            ['Username', self.rhev_username, 'field'],
            ['Password', self.rhev_password, 'field'],
            ['X509 Certification Authorities', self.rhev_cacert, 'field'],
            ['Datacenter', self.rhev_datacenter, 'special select'],
        ]
        with Session(self) as session:
            self.compute_resource.check_image_os(self.rhev_img_os)
            for img_name in invalid_names_list():
                with self.subTest(img_name):
                    # Note: create a new compute resource for each sub test as
                    # using the same uuid image.
                    # the images should not be created, but we need to have the
                    # sub tests isolated, and use the same scenario as positive
                    # test
                    cr_name = gen_string('alpha')
                    make_resource(session,
                                  name=cr_name,
                                  provider_type=FOREMAN_PROVIDERS['rhev'],
                                  parameter_list=parameter_list)
                    self.assertIsNotNone(self.compute_resource.search(cr_name))
                    parameter_list_img = [
                        ['Name', img_name],
                        ['Operatingsystem', self.rhev_img_os],
                        ['Architecture', self.rhev_img_arch],
                        ['Username', self.rhev_img_user],
                        ['Password', self.rhev_img_pass],
                        ['uuid', self.rhev_img_name],
                    ]
                    self.compute_resource.add_image(cr_name,
                                                    parameter_list_img)
                    self.assertIsNotNone(
                        self.compute_resource.wait_until_element(
                            common_locators["name_haserror"]))
                    self.assertNotIn(
                        img_name, self.compute_resource.list_images(cr_name))
    def test_positive_create_rhev_with_same_name(self):
        """Create a new rhev Compute Resource with existing name correction

        :id: b9499d65-ef70-48b7-854a-f4cf740fbf9c

        :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 valid name to rhev Compute Resource.
            4. Test the connection using Load Datacenter and submit.
            5. Create again a compute resource with same name.
            6. After error of name already taken,
               update with different name
            7. Click submit

        :CaseAutomation: Automated

        :expectedresults: A rhev CR is created successfully with proper
            connection.

        :CaseImportance: Critical

        :BZ: 1467664
        """
        name = gen_string('alpha')
        new_name = gen_string('alpha')
        parameter_list = [
            ['URL', self.rhev_url, 'field'],
            ['Username', self.rhev_username, 'field'],
            ['Password', self.rhev_password, 'field'],
            ['X509 Certification Authorities', self.rhev_cacert, 'field'],
            ['Datacenter', self.rhev_datacenter, 'special select'],
        ]
        with Session(self) as session:
            make_resource(session,
                          name=name,
                          provider_type=FOREMAN_PROVIDERS['rhev'],
                          parameter_list=parameter_list)
            self.assertIsNotNone(self.compute_resource.search(name))
            make_resource(session,
                          name=name,
                          provider_type=FOREMAN_PROVIDERS['rhev'],
                          parameter_list=parameter_list)
            self.compute_resource.assign_value(locators['resource.name'],
                                               new_name)
            self.compute_resource.click(common_locators['submit'])
            self.assertIsNone(
                self.compute_resource.wait_until_element(
                    common_locators["alert.error"],
                    timeout=2,
                ))
Exemplo n.º 54
0
    def test_positive_access_rhev_with_custom_profile(self):
        """Associate custom default (3-Large) compute profile to rhev compute resource

        :id: e7698154-62ff-492b-8e56-c5dc70f0c9df

        :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. Select the created rhev 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 = [
            ['URL', self.rhev_url, 'field'],
            ['Username', self.rhev_username, 'field'],
            ['Password', self.rhev_password, 'field'],
            ['Datacenter', self.rhev_datacenter, 'special select'],
        ]
        name = gen_string('alpha')
        with Session(self) as session:
            make_resource(session,
                          name=name,
                          provider_type=FOREMAN_PROVIDERS['rhev'],
                          parameter_list=parameter_list)
            self.compute_resource.set_profile_values(
                name,
                COMPUTE_PROFILE_LARGE,
                cluster=self.rhev_datacenter,
                cores=2,
                memory=1024,
                network_interfaces=[
                    dict(name='nic1', network=settings.vlan_networking.bridge),
                    dict(name='nic2', network=settings.vlan_networking.bridge),
                ],
                storage=[
                    dict(size='10',
                         storage_domain=self.rhev_storage_domain,
                         bootable=True,
                         preallocate_disk=True),
                    dict(size='20',
                         storage_domain=self.rhev_storage_domain,
                         bootable=False,
                         preallocate_disk=False)
                ])
Exemplo n.º 55
0
    def test_negative_add_image_vmware_with_invalid_name(self):
        """Add images to the vmware compute resource

        :id: 436324bf-7dcf-4197-b1ca-198492bf0356

        :setup:

            1. Valid vmware hostname, credentials.
            2. Add images as templates in vmware.

        :steps:

            1. Create a compute resource of type vmware.
            2. Provide valid hostname, username and password.
            3. Select the created vmware CR and click images tab.
            4. Select "New image" , provide invalid name and valid information.
            5. Select the desired template to create the image from and submit.

        :expectedresults: The image should not be added to the CR

        :Caseautomation: Automated

        :CaseLevel: Integration
        """
        self.compute_resource.check_image_os(self.vmware_img_os)
        parameter_list = [
            ['VCenter/Server', self.vmware_url, 'field'],
            ['Username', self.vmware_username, 'field'],
            ['Password', self.vmware_password, 'field'],
            ['Datacenter', self.vmware_datacenter, 'special select'],
        ]
        name = gen_string('alpha')
        with Session(self) as session:
            for img_name in invalid_names_list():
                with self.subTest(name):
                    make_resource(session,
                                  name=name,
                                  provider_type=FOREMAN_PROVIDERS['vmware'],
                                  parameter_list=parameter_list)
                parameter_list_img = [
                    ['Name', img_name],
                    ['Operatingsystem', self.vmware_img_os],
                    ['Architecture', self.vmware_img_arch],
                    ['Username', self.vmware_img_user],
                    ['Password', self.vmware_img_pass],
                    ['uuid', self.vmware_img_name],
                ]
                self.compute_resource.add_image(name, parameter_list_img)
                self.assertIsNotNone(
                    self.compute_resource.wait_until_element(
                        common_locators["name_haserror"]))
Exemplo n.º 56
0
    def test_positive_add_image_vmware_with_name(self):
        """Add images to the vmware compute resource

        :id: 4b749529-b98d-4a3e-a2d1-b9738c96c283

        :setup:
            1. Valid vmware hostname, credentials.
            2. Add images as templates in vmware.

        :steps:

            1. Create a compute resource of type vmware.
            2. Provide valid hostname, username and password.
            3. Select the created vmware CR and click images tab.
            4. Select "New image", provide valid name and information.
            5. Select the desired template to create image and submit.

        :expectedresults: The image is added to the CR successfully

        :Caseautomation: Automated

        :CaseLevel: Integration
        """
        self.compute_resource.check_image_os(self.vmware_img_os)
        parameter_list = [
            ['VCenter/Server', self.vmware_url, 'field'],
            ['Username', self.vmware_username, 'field'],
            ['Password', self.vmware_password, 'field'],
            ['Datacenter', self.vmware_datacenter, 'special select'],
        ]
        name = gen_string('alpha')
        with Session(self) as session:
            for img_name in valid_data_list():
                with self.subTest(name):
                    make_resource(session,
                                  name=name,
                                  provider_type=FOREMAN_PROVIDERS['vmware'],
                                  parameter_list=parameter_list)
                parameter_list_img = [
                    ['Name', img_name],
                    ['Operatingsystem', self.vmware_img_os],
                    ['Architecture', self.vmware_img_arch],
                    ['Username', self.vmware_img_user],
                    ['Password', self.vmware_img_pass],
                    ['uuid', self.vmware_img_name],
                ]
                self.compute_resource.add_image(name, parameter_list_img)
                self.assertIsNotNone(self.compute_resource.search(name))
                imgs = self.compute_resource.list_images(name)
                self.assertIn(img_name, imgs)
Exemplo n.º 57
0
    def test_positive_add_image_rhev_with_name(self):
        """Add images to the rhev compute resource

        :id: 6c7f4169-2e78-44d6-87af-434146093bcc

        :setup: rhev hostname, credentials and images as templates in rhev.

        :steps:

            1. Create a compute resource of type rhev.
            2. Provide it with the valid hostname, username and password.
            3. Select the created rhev CR and click images tab.
            4. Select "New image" , provide it valid name and information.
            5. Select the desired template to create image and submit.

        :CaseAutomation: Automated

        :expectedresults: The image is added to the CR successfully
         """
        self.compute_resource.check_image_os(self.rhev_img_os)
        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 img_name in valid_data_list():
                with self.subTest(img_name):
                    # Note: create a new compute resource for each sub test
                    # as using the same uuid image
                    cr_name = gen_string('alpha')
                    make_resource(session,
                                  name=cr_name,
                                  provider_type=FOREMAN_PROVIDERS['rhev'],
                                  parameter_list=parameter_list)
                    self.assertIsNotNone(self.compute_resource.search(cr_name))
                    parameter_list_img = [
                        ['Name', img_name],
                        ['Operatingsystem', self.rhev_img_os],
                        ['Architecture', self.rhev_img_arch],
                        ['Username', self.rhev_img_user],
                        ['Password', self.rhev_img_pass],
                        ['uuid', self.rhev_img_name],
                    ]
                    self.compute_resource.add_image(cr_name,
                                                    parameter_list_img)
                    self.assertIn(img_name,
                                  self.compute_resource.list_images(cr_name))
Exemplo n.º 58
0
    def test_negative_add_image_rhev_with_invalid_name(self):
        """Add images to the rhev compute resource

        :id: 0054b389-1e2f-44d9-a306-0410fc0b9d99

        :setup: rhev hostname, credentials and images as templates in rhev.

        :steps:

            1. Create a compute resource of type rhev.
            2. Provide it with the valid hostname, username and password.
            3. Select the created rhev CR and click images tab.
            4. Select "New image", provide it invalid name and valid
               information.
            5. Select the desired template to create the image from and submit.

        :CaseAutomation: Automated

        :expectedresults: The image should not be added to the CR
        """
        parameter_list = [
            ['URL', self.rhev_url, 'field'],
            ['Username', self.rhev_username, 'field'],
            ['Password', self.rhev_password, 'field'],
            ['Datacenter', self.rhev_datacenter, 'special select'],
        ]
        name = gen_string('alpha')
        with Session(self.browser) as session:
            for img_name in invalid_names_list():
                with self.subTest(name):
                    make_resource(
                        session,
                        name=name,
                        provider_type=FOREMAN_PROVIDERS['rhev'],
                        parameter_list=parameter_list
                    )
                parameter_list_img = [
                    ['Name', img_name],
                    ['Operatingsystem', self.rhev_img_os],
                    ['Architecture', self.rhev_img_arch],
                    ['Username', self.rhev_img_user],
                    ['Password', self.rhev_img_pass],
                    ['uuid', self.rhev_img_name],
                ]
                self.compute_resource.add_image(name, parameter_list_img)
                self.assertIsNotNone(
                    self.compute_resource.wait_until_element(
                        common_locators["name_haserror"]
                    ))
Exemplo n.º 59
0
    def test_positive_power_on_off_vmware_vms(self):
        """Power on and off the vmware virtual machine

        :id: 846318e9-8b95-46ea-b7bc-26689064f80c

        :setup:

            1. Valid vmware hostname, credentials.
            2. Virtual machine in vmware.

        :steps:

            1. Select the created compute resource.
            2. Go to "Virtual Machines" tab.
            3. Click "Power on" button associated with the vm.
            4. Go to "Virtual Machines" tab.
            5. Click "Power off" button associated with the vm.

        :expectedresults: The Virtual machine is switched on and switched off

        :Caseautomation: Automated

        :Caselevel: Integration
        """
        parameter_list = [
            ['VCenter/Server', self.vmware_url, 'field'],
            ['Username', self.vmware_username, 'field'],
            ['Password', self.vmware_password, 'field'],
            ['Datacenter', self.vmware_datacenter, 'special select'],
        ]
        cr_name = gen_string('alpha')
        with Session(self) as session:
            make_resource(session,
                          name=cr_name,
                          provider_type=FOREMAN_PROVIDERS['vmware'],
                          parameter_list=parameter_list)
            if self.compute_resource.power_on_status(
                    cr_name, self.vmware_vm_name) == 'on':
                self.compute_resource.set_power_status(cr_name,
                                                       self.vmware_vm_name,
                                                       False)
            self.assertEqual(
                self.compute_resource.set_power_status(cr_name,
                                                       self.vmware_vm_name,
                                                       True), u'On')
            self.assertEqual(
                self.compute_resource.set_power_status(cr_name,
                                                       self.vmware_vm_name,
                                                       False), u'Off')