Пример #1
0
    def test_positive_remove_compresource_by_name(self):
        """Remove a compute resource from organization by its name

        @id: 1b1313a8-8326-4b33-8113-17c5cf0d4ffb

        @Assert: Compute resource is removed from the org

        @CaseLevel: Integration
        """
        org = make_org()
        compute_res = make_compute_resource({
            'provider': FOREMAN_PROVIDERS['libvirt'],
            'url': u'qemu+ssh://root@{0}/system'.format(
                settings.compute_resources.libvirt_hostname
            )
        })
        Org.add_compute_resource({
            'compute-resource': compute_res['name'],
            'name': org['name'],
        })
        Org.remove_compute_resource({
            'compute-resource': compute_res['name'],
            'name': org['name'],
        })
        org = Org.info({'name': org['name']})
        self.assertNotIn(compute_res['name'], org['compute-resources'])
Пример #2
0
    def test_positive_remove_compresource_by_name(self):
        """Remove a compute resource from organization by its name

        @id: 1b1313a8-8326-4b33-8113-17c5cf0d4ffb

        @Assert: Compute resource is removed from the org

        @CaseLevel: Integration
        """
        org = make_org()
        compute_res = make_compute_resource({
            'provider': FOREMAN_PROVIDERS['libvirt'],
            'url': u'qemu+ssh://root@{0}/system'.format(
                settings.compute_resources.libvirt_hostname
            )
        })
        Org.add_compute_resource({
            'compute-resource': compute_res['name'],
            'name': org['name'],
        })
        Org.remove_compute_resource({
            'compute-resource': compute_res['name'],
            'name': org['name'],
        })
        org = Org.info({'name': org['name']})
        self.assertNotIn(compute_res['name'], org['compute-resources'])
Пример #3
0
    def test_positive_remove_compresource_by_id(self):
        """Remove a compute resource from organization by its ID

        @id: 415c14ab-f879-4ed8-9ba7-8af4ada2e277

        @Assert: Compute resource is removed from the org

        @CaseLevel: Integration
        """
        org = make_org()
        compute_res = make_compute_resource({
            'provider': FOREMAN_PROVIDERS['libvirt'],
            'url': u'qemu+ssh://root@{0}/system'.format(
                settings.compute_resources.libvirt_hostname
            )
        })
        Org.add_compute_resource({
            'compute-resource-id': compute_res['id'],
            'id': org['id'],
        })
        Org.remove_compute_resource({
            'compute-resource-id': compute_res['id'],
            'id': org['id'],
        })
        org = Org.info({'id': org['id']})
        self.assertNotIn(compute_res['name'], org['compute-resources'])
Пример #4
0
    def test_positive_remove_compresource_by_id(self):
        """Remove a compute resource from organization by its ID

        @id: 415c14ab-f879-4ed8-9ba7-8af4ada2e277

        @Assert: Compute resource is removed from the org

        @CaseLevel: Integration
        """
        org = make_org()
        compute_res = make_compute_resource({
            'provider': FOREMAN_PROVIDERS['libvirt'],
            'url': u'qemu+ssh://root@{0}/system'.format(
                settings.compute_resources.libvirt_hostname
            )
        })
        Org.add_compute_resource({
            'compute-resource-id': compute_res['id'],
            'id': org['id'],
        })
        Org.remove_compute_resource({
            'compute-resource-id': compute_res['id'],
            'id': org['id'],
        })
        org = Org.info({'id': org['id']})
        self.assertNotIn(compute_res['name'], org['compute-resources'])
Пример #5
0
    def test_positive_add_and_remove_compresources(self):
        """Add and remove a compute resource from organization

        :id: 415c14ab-f879-4ed8-9ba7-8af4ada2e277

        :expectedresults: Compute resource are handled as expected

        :bz: 1395229

        :steps:
            1. Add and remove compute resource by id
            2. Add and remove compute resource by name

        :CaseLevel: Integration
        """
        org = make_org()
        compute_res_a = make_compute_resource({
            'provider': FOREMAN_PROVIDERS['libvirt'],
            'url': u'qemu+ssh://root@{0}/system'.format(
                settings.compute_resources.libvirt_hostname
            )
        })
        compute_res_b = make_compute_resource({
            'provider': FOREMAN_PROVIDERS['libvirt'],
            'url': u'qemu+ssh://root@{0}/system'.format(
                settings.compute_resources.libvirt_hostname
            )
        })
        Org.add_compute_resource({
            'compute-resource-id': compute_res_a['id'],
            'id': org['id'],
        })
        Org.add_compute_resource({
            'compute-resource': compute_res_b['name'],
            'name': org['name'],
        })
        org_info = Org.info({'id': org['id']})
        self.assertEqual(len(org_info['compute-resources']), 2,
                         "Failed to add compute resources")
        Org.remove_compute_resource({
            'compute-resource-id': compute_res_a['id'],
            'id': org['id'],
        })
        Org.remove_compute_resource({
            'compute-resource': compute_res_b['name'],
            'name': org['name'],
        })
        org_info = Org.info({'id': org['id']})
        self.assertNotIn(
            compute_res_a['name'],
            org_info['compute-resources'],
            "Failed to remove cr by id"
        )
        self.assertNotIn(
            compute_res_b['name'],
            org_info['compute-resources'],
            "Failed to remove cr by name"
        )
Пример #6
0
    def test_positive_add_and_remove_compresources(self):
        """Add and remove a compute resource from organization

        :id: 415c14ab-f879-4ed8-9ba7-8af4ada2e277

        :expectedresults: Compute resource are handled as expected

        :bz: 1395229

        :steps:
            1. Add and remove compute resource by id
            2. Add and remove compute resource by name

        :CaseLevel: Integration
        """
        org = make_org()
        compute_res_a = make_compute_resource({
            'provider': FOREMAN_PROVIDERS['libvirt'],
            'url': u'qemu+ssh://root@{0}/system'.format(
                settings.compute_resources.libvirt_hostname
            )
        })
        compute_res_b = make_compute_resource({
            'provider': FOREMAN_PROVIDERS['libvirt'],
            'url': u'qemu+ssh://root@{0}/system'.format(
                settings.compute_resources.libvirt_hostname
            )
        })
        Org.add_compute_resource({
            'compute-resource-id': compute_res_a['id'],
            'id': org['id'],
        })
        Org.add_compute_resource({
            'compute-resource': compute_res_b['name'],
            'name': org['name'],
        })
        org_info = Org.info({'id': org['id']})
        self.assertEqual(len(org_info['compute-resources']), 2,
                         "Failed to add compute resources")
        Org.remove_compute_resource({
            'compute-resource-id': compute_res_a['id'],
            'id': org['id'],
        })
        Org.remove_compute_resource({
            'compute-resource': compute_res_b['name'],
            'name': org['name'],
        })
        org_info = Org.info({'id': org['id']})
        self.assertNotIn(
            compute_res_a['name'],
            org_info['compute-resources'],
            "Failed to remove cr by id"
        )
        self.assertNotIn(
            compute_res_b['name'],
            org_info['compute-resources'],
            "Failed to remove cr by name"
        )
Пример #7
0
def test_positive_add_and_remove_compute_resources(module_org):
    """Add and remove a compute resource from organization

    :id: 415c14ab-f879-4ed8-9ba7-8af4ada2e277

    :expectedresults: Compute resource are handled as expected

    :BZ: 1395229

    :steps:
        1. Add and remove compute resource by id
        2. Add and remove compute resource by name

    :CaseLevel: Integration
    """
    compute_resources = [
        make_compute_resource(
            {
                'provider':
                FOREMAN_PROVIDERS['libvirt'],
                'url':
                f'qemu+ssh://root@{settings.compute_resources.libvirt_hostname}/system',
            }, ) for _ in range(0, 2)
    ]
    Org.add_compute_resource({
        'compute-resource-id': compute_resources[0]['id'],
        'id': module_org.id
    })
    Org.add_compute_resource({
        'compute-resource': compute_resources[1]['name'],
        'name': module_org.name
    })
    org_info = Org.info({'id': module_org.id})
    assert len(
        org_info['compute-resources']) == 2, "Failed to add compute resources"
    Org.remove_compute_resource({
        'compute-resource-id':
        compute_resources[0]['id'],
        'id':
        module_org.id
    })
    Org.remove_compute_resource({
        'compute-resource':
        compute_resources[1]['name'],
        'name':
        module_org.name
    })
    org_info = Org.info({'id': module_org.id})
    assert (compute_resources[0]['name'] not in org_info['compute-resources']
            ), "Failed to remove compute resource by id"
    assert (compute_resources[1]['name'] not in org_info['compute-resources']
            ), "Failed to remove compute resource by name"
Пример #8
0
    def test_positive_remove_compresource_by_name(self):
        """Remove a compute resource from organization by its name

        @Feature: Organization

        @Assert: Compute resource is removed from the org
        """
        org = make_org()
        compute_res = make_compute_resource({
            'provider': FOREMAN_PROVIDERS['libvirt'],
            'url': "qemu+tcp://%s:16509/system" % settings.server.hostname
        })
        Org.add_compute_resource({
            'compute-resource': compute_res['name'],
            'name': org['name'],
        })
        Org.remove_compute_resource({
            'compute-resource': compute_res['name'],
            'name': org['name'],
        })
        org = Org.info({'name': org['name']})
        self.assertNotIn(compute_res['name'], org['compute-resources'])
Пример #9
0
    def test_positive_remove_compresource_by_name(self):
        """Remove a compute resource from organization by its name

        @Feature: Organization

        @Assert: Compute resource is removed from the org
        """
        org = make_org()
        compute_res = make_compute_resource({
            'provider': FOREMAN_PROVIDERS['libvirt'],
            'url': "qemu+tcp://%s:16509/system" % settings.server.hostname
        })
        Org.add_compute_resource({
            'compute-resource': compute_res['name'],
            'name': org['name'],
        })
        Org.remove_compute_resource({
            'compute-resource': compute_res['name'],
            'name': org['name'],
        })
        org = Org.info({'name': org['name']})
        self.assertNotIn(compute_res['name'], org['compute-resources'])