def test_query_condition_attributes(self, conditions, soft_assert):
        """Tests access to condition attributes.

        Metadata:
            test_flag: rest
        """
        query_resource_attributes(conditions[0], soft_assert=soft_assert)
    def test_query_policy_attributes(self, policies, soft_assert):
        """Tests access to policy attributes.

        Metadata:
            test_flag: rest
        """
        query_resource_attributes(policies[0], soft_assert=soft_assert)
    def test_query_request_attributes(self, requests_pending, soft_assert):
        """Tests access to attributes of automation request using /api/requests.

        Metadata:
            test_flag: rest
        """
        query_resource_attributes(requests_pending[0], soft_assert=soft_assert)
    def test_query_role_attributes(self, roles, soft_assert):
        """Tests access to role attributes.

        Metadata:
            test_flag: rest
        """
        query_resource_attributes(roles[0], soft_assert=soft_assert)
    def test_query_request_attributes(self, requests_pending, soft_assert):
        """Tests access to attributes of automation request using /api/requests.

        Metadata:
            test_flag: rest
        """
        query_resource_attributes(requests_pending[0], soft_assert=soft_assert)
    def test_query_condition_attributes(self, conditions, soft_assert):
        """Tests access to condition attributes.

        Metadata:
            test_flag: rest
        """
        query_resource_attributes(conditions[0], soft_assert=soft_assert)
    def test_query_policy_attributes(self, policies, soft_assert):
        """Tests access to policy attributes.

        Metadata:
            test_flag: rest
        """
        query_resource_attributes(policies[0], soft_assert=soft_assert)
Exemple #8
0
def test_provision_attributes(appliance, provider, small_template,
                              soft_assert):
    """Tests that it's possible to display additional attributes in /api/provision_requests/:id.

    Metadata:
        test_flag: rest, provision

    Bugzilla:
        1592326

    Polarion:
        assignee: pvala
        casecomponent: Provisioning
        caseimportance: high
        initialEstimate: 1/4h
    """
    provision_data = get_provision_data(appliance.rest_api,
                                        provider,
                                        small_template.name,
                                        auto_approve=False)
    provision_request, = appliance.rest_api.collections.provision_requests.action.create(
        **provision_data)
    assert_response(appliance)
    # workaround for BZ1437689 to make sure the vm is not provisioned
    provision_request.action.deny(reason='denied')
    query_resource_attributes(provision_request, soft_assert=soft_assert)
    def test_query_group_attributes(self, groups, soft_assert):
        """Tests access to group attributes.

        Metadata:
            test_flag: rest
        """
        query_resource_attributes(groups[0], soft_assert=soft_assert)
    def test_query_user_attributes(self, users, soft_assert):
        """Tests access to user attributes.

        Metadata:
            test_flag: rest
        """
        query_resource_attributes(users[0], soft_assert=soft_assert)
    def test_query_arbitration_rule_attributes(self, arbitration_rules, soft_assert):
        """Tests access to arbitration rule attributes.

        Metadata:
            test_flag: rest
        """
        query_resource_attributes(arbitration_rules[0], soft_assert=soft_assert)
Exemple #12
0
    def test_query_arbitration_rule_attributes(self, arbitration_rules, soft_assert):
        """Tests access to arbitration rule attributes.

        Metadata:
            test_flag: rest
        """
        query_resource_attributes(arbitration_rules[0], soft_assert=soft_assert)
    def test_query_tenant_attributes(self, tenants, soft_assert):
        """Tests access to tenant attributes.

        Metadata:
            test_flag: rest
        """
        query_resource_attributes(tenants[0], soft_assert=soft_assert)
    def test_query_authentications_attributes(self, authentications, soft_assert):
        """Tests access to authentication attributes.

        Metadata:
            test_flag: rest
        """
        query_resource_attributes(authentications[0], soft_assert=soft_assert)
    def test_query_authentications_attributes(self, authentications,
                                              soft_assert):
        """Tests access to authentication attributes.

        Metadata:
            test_flag: rest
        """
        query_resource_attributes(authentications[0], soft_assert=soft_assert)
    def test_query_notification_attributes(self, appliance, generate_notifications, soft_assert):
        """Tests access to notification attributes.

        Metadata:
            test_flag: rest
        """
        collection = appliance.rest_api.collections.notifications
        collection.reload()
        query_resource_attributes(collection[-1], soft_assert=soft_assert)
    def test_query_event_attributes(self, appliance, gen_events, soft_assert):
        """Tests access to event attributes.

        Metadata:
            test_flag: rest
        """
        collection = appliance.rest_api.collections.event_streams
        collection.reload()
        query_resource_attributes(collection[-1], soft_assert=soft_assert)
Exemple #18
0
    def test_query_notification_attributes(self, appliance, generate_notifications, soft_assert):
        """Tests access to notification attributes.

        Metadata:
            test_flag: rest
        """
        collection = appliance.rest_api.collections.notifications
        collection.reload()
        query_resource_attributes(collection[-1], soft_assert=soft_assert)
    def test_query_event_attributes(self, appliance, gen_events, soft_assert):
        """Tests access to event attributes.

        Metadata:
            test_flag: rest
        """
        collection = appliance.rest_api.collections.event_streams
        collection.reload()
        query_resource_attributes(collection[-1], soft_assert=soft_assert)
    def test_query_request_attributes(self, requests_pending, soft_assert):
        """Tests access to attributes of automation request using /api/automation_requests.

        Metadata:
            test_flag: rest

        Polarion:
            assignee: pvala
            initialEstimate: 1/4h
        """
        query_resource_attributes(requests_pending[0], soft_assert=soft_assert)
Exemple #21
0
    def test_query_condition_attributes(self, conditions, soft_assert):
        """Tests access to condition attributes.

        Metadata:
            test_flag: rest

        Polarion:
            assignee: pvala
            initialEstimate: 1/4h
        """
        query_resource_attributes(conditions[0], soft_assert=soft_assert)
Exemple #22
0
    def test_query_authentications_attributes(self, authentications, soft_assert):
        """Tests access to authentication attributes.

        Metadata:
            test_flag: rest

        Polarion:
            assignee: pvala
            initialEstimate: None
        """
        query_resource_attributes(authentications[0], soft_assert=soft_assert)
Exemple #23
0
    def test_query_arbitration_setting_attributes(self, arbitration_settings, soft_assert):
        """Tests access to arbitration setting attributes.

        Metadata:
            test_flag: rest

        Polarion:
            assignee: None
            initialEstimate: None
        """
        query_resource_attributes(arbitration_settings[0], soft_assert=soft_assert)
Exemple #24
0
    def test_query_request_attributes(self, requests_pending, soft_assert):
        """Tests access to attributes of automation request using /api/requests.

        Metadata:
            test_flag: rest

        Polarion:
            assignee: pvala
            initialEstimate: None
        """
        query_resource_attributes(requests_pending[0], soft_assert=soft_assert)
Exemple #25
0
    def test_query_user_attributes(self, users, soft_assert):
        """Tests access to user attributes.

        Metadata:
            test_flag: rest

        Polarion:
            assignee: pvala
            initialEstimate: 1/4h
        """
        query_resource_attributes(users[0], soft_assert=soft_assert)
Exemple #26
0
    def test_query_policy_attributes(self, policies, soft_assert):
        """Tests access to policy attributes.

        Metadata:
            test_flag: rest

        Polarion:
            assignee: pvala
            initialEstimate: 1/4h
        """
        query_resource_attributes(policies[0], soft_assert=soft_assert)
    def test_query_condition_attributes(self, conditions, soft_assert):
        """Tests access to condition attributes.

        Metadata:
            test_flag: rest

        Polarion:
            assignee: pvala
            casecomponent: Control
            caseimportance: medium
            initialEstimate: 1/4h
        """
        query_resource_attributes(conditions[0], soft_assert=soft_assert)
Exemple #28
0
    def test_query_user_attributes(self, users, soft_assert):
        """Tests access to user attributes.

        Metadata:
            test_flag: rest

        Polarion:
            assignee: pvala
            casecomponent: Configuration
            caseimportance: low
            initialEstimate: 1/4h
        """
        query_resource_attributes(users[0], soft_assert=soft_assert)
    def test_query_authentications_attributes(self, authentications, soft_assert):
        """Tests access to authentication attributes.

        Metadata:
            test_flag: rest

        Polarion:
            assignee: pvala
            casecomponent: Auth
            caseimportance: medium
            initialEstimate: 1/4h
        """
        query_resource_attributes(authentications[0], soft_assert=soft_assert)
Exemple #30
0
    def test_query_tenant_attributes(self, tenants, soft_assert):
        """Tests access to tenant attributes.

        Metadata:
            test_flag: rest

        Polarion:
            assignee: pvala
            casecomponent: Rest
            caseimportance: medium
            initialEstimate: 1/4h
        """
        query_resource_attributes(tenants[0], soft_assert=soft_assert)
Exemple #31
0
    def test_query_group_attributes(self, groups, soft_assert):
        """Tests access to group attributes.

        Metadata:
            test_flag: rest

        Polarion:
            assignee: pvala
            casecomponent: Rest
            caseimportance: low
            initialEstimate: 1/4h
        """
        query_resource_attributes(groups[0], soft_assert=soft_assert)
    def test_query_policy_attributes(self, policies, soft_assert):
        """Tests access to policy attributes.

        Metadata:
            test_flag: rest

        Polarion:
            assignee: pvala
            casecomponent: Rest
            caseimportance: low
            initialEstimate: 1/4h
        """
        query_resource_attributes(policies[0], soft_assert=soft_assert)
Exemple #33
0
    def test_query_event_attributes(self, appliance, gen_events, soft_assert):
        """Tests access to event attributes.

        Metadata:
            test_flag: rest

        Polarion:
            assignee: pvala
            initialEstimate: 1/4h
        """
        collection = appliance.rest_api.collections.event_streams
        collection.reload()
        query_resource_attributes(collection[-1], soft_assert=soft_assert)
    def test_query_condition_attributes(self, conditions, soft_assert):
        """Tests access to condition attributes.

        Metadata:
            test_flag: rest

        Polarion:
            assignee: pvala
            casecomponent: Control
            caseimportance: medium
            initialEstimate: 1/4h
        """
        query_resource_attributes(conditions[0], soft_assert=soft_assert)
Exemple #35
0
    def test_query_notification_attributes(self, appliance, generate_notifications, soft_assert):
        """Tests access to notification attributes.

        Metadata:
            test_flag: rest

        Polarion:
            assignee: pvala
            initialEstimate: 1/4h
        """
        collection = appliance.rest_api.collections.notifications
        collection.reload()
        query_resource_attributes(collection[-1], soft_assert=soft_assert)
    def test_query_tenant_attributes(self, tenants, soft_assert):
        """Tests access to tenant attributes.

        Metadata:
            test_flag: rest

        Polarion:
            assignee: pvala
            casecomponent: Rest
            caseimportance: medium
            initialEstimate: 1/4h
        """
        query_resource_attributes(tenants[0], soft_assert=soft_assert)
    def test_query_request_attributes(self, requests_pending, soft_assert):
        """Tests access to attributes of automation request using /api/requests.

        Metadata:
            test_flag: rest

        Polarion:
            assignee: pvala
            casecomponent: Automate
            caseimportance: medium
            initialEstimate: 1/6h
        """
        query_resource_attributes(requests_pending[0], soft_assert=soft_assert)
    def test_query_authentications_attributes(self, authentications, soft_assert):
        """Tests access to authentication attributes.

        Metadata:
            test_flag: rest

        Polarion:
            assignee: pvala
            casecomponent: Rest
            caseimportance: medium
            initialEstimate: 1/4h
        """
        query_resource_attributes(authentications[0], soft_assert=soft_assert)
    def test_query_request_attributes(self, requests_pending, soft_assert):
        """Tests access to attributes of automation request using /api/requests.

        Metadata:
            test_flag: rest

        Polarion:
            assignee: pvala
            casecomponent: Rest
            caseimportance: medium
            initialEstimate: 1/6h
        """
        query_resource_attributes(requests_pending[0], soft_assert=soft_assert)
    def test_query_policy_attributes(self, policies, soft_assert):
        """Tests access to policy attributes.

        Metadata:
            test_flag: rest

        Polarion:
            assignee: pvala
            casecomponent: Control
            caseimportance: low
            initialEstimate: 1/4h
        """
        query_resource_attributes(policies[0], soft_assert=soft_assert)
def test_provision_attributes(appliance, provider, small_template, soft_assert):
    """Tests that it's possible to display additional attributes in /api/provision_requests/:id.

    Metadata:
        test_flag: rest, provision
    """
    provision_data = get_provision_data(
        appliance.rest_api, provider, small_template.name, auto_approve=False)
    provision_request, = appliance.rest_api.collections.provision_requests.action.create(
        **provision_data)
    assert_response(appliance)
    # workaround for BZ1437689 to make sure the vm is not provisioned
    provision_request.action.deny(reason='denied')
    query_resource_attributes(provision_request, soft_assert=soft_assert)
Exemple #42
0
    def test_query_notification_attributes(self, appliance, generate_notifications, soft_assert):
        """Tests access to notification attributes.

        Metadata:
            test_flag: rest

        Polarion:
            assignee: pvala
            casecomponent: Rest
            caseimportance: medium
            initialEstimate: 1/4h
        """
        collection = appliance.rest_api.collections.notifications
        collection.reload()
        query_resource_attributes(collection[-1], soft_assert=soft_assert)
def test_query_provider_attributes(provider, provider_rest, soft_assert):
    """Tests access to attributes of /api/providers.

    Metadata:
        test_flag: rest
    """
    outcome = query_resource_attributes(provider_rest)
    for failure in outcome.failed:
        if provider.one_of(InfraProvider):
            # once BZ1545240 is fixed other failure than internal server
            # error is expected
            if failure.name == 'cloud_tenants' and BZ(
                    1545240, forced_streams=['5.8', '5.9', 'upstream']).blocks:
                continue
            if failure.name == 'flavors' and BZ(
                    1545240, forced_streams=['5.9', 'upstream']).blocks:
                continue
        if provider.one_of(RHEVMProvider):
            # once BZ1546112 is fixed other failure than internal server
            # error is expected
            if failure.name in ('cloud_networks', 'cloud_subnets', 'security_groups') and BZ(
                    1546112, forced_streams=['5.9', 'upstream']).blocks:
                continue
        soft_assert(False, '{0} "{1}": status: {2}, error: `{3}`'.format(
            failure.type, failure.name, failure.response.status_code, failure.error))
def test_query_template_attributes(request, appliance, provider, soft_assert):
    """Tests access to template attributes.

    Metadata:
        test_flag: rest

    Bugzilla:
        1546995

    Polarion:
        assignee: pvala
        casecomponent: Rest
        caseimportance: high
        initialEstimate: 1/4h
    """
    templates = appliance.rest_api.collections.templates.all
    if templates:
        template_rest = templates[0]
    else:
        vm_rest = vm(request, provider, appliance)
        template_rest = template(request, appliance, provider, vm_rest)

    outcome = query_resource_attributes(template_rest)
    for failure in outcome.failed:
        # BZ1546995
        soft_assert(False, '{0} "{1}": status: {2}, error: `{3}`'.format(
            failure.type, failure.name, failure.response.status_code, failure.error))
Exemple #45
0
def test_query_template_attributes(request, appliance, provider, soft_assert):
    """Tests access to template attributes.

    Metadata:
        test_flag: rest

    Polarion:
        assignee: pvala
        initialEstimate: 1/4h
    """
    templates = appliance.rest_api.collections.templates.all
    if templates:
        template_rest = templates[0]
    else:
        vm_rest = vm(request, provider, appliance)
        template_rest = template(request, appliance, provider, vm_rest)

    outcome = query_resource_attributes(template_rest)
    for failure in outcome.failed:
        if failure.type == 'attribute' and failure.name == 'policy_events' and BZ(
                1546995, forced_streams=['5.8', '5.9', 'upstream']).blocks:
            continue
        soft_assert(
            False, '{0} "{1}": status: {2}, error: `{3}`'.format(
                failure.type, failure.name, failure.response.status_code,
                failure.error))
Exemple #46
0
def test_query_template_attributes(request, appliance, provider, soft_assert):
    """Tests access to template attributes.

    Metadata:
        test_flag: rest

    Bugzilla:
        1546995

    Polarion:
        assignee: pvala
        casecomponent: Services
        caseimportance: high
        initialEstimate: 1/4h
    """
    templates = appliance.rest_api.collections.templates.all
    if templates:
        template_rest = templates[0]
    else:
        vm_rest = vm(request, provider, appliance)
        template_rest = template(request, appliance, provider, vm_rest)

    outcome = query_resource_attributes(template_rest)
    for failure in outcome.failed:
        # BZ1546995
        soft_assert(
            False, '{} "{}": status: {}, error: `{}`'.format(
                failure.type, failure.name, failure.response.status_code,
                failure.error))
def test_query_provider_attributes(provider, provider_rest, soft_assert):
    """Tests access to attributes of /api/providers.

    Metadata:
        test_flag: rest
    """
    outcome = query_resource_attributes(provider_rest)
    for failure in outcome.failed:
        if provider.one_of(InfraProvider):
            # once BZ1545240 is fixed other failure than internal server
            # error is expected
            if failure.name == 'cloud_tenants' and BZ(
                    1612905, forced_streams=['5.8', '5.9', 'upstream']).blocks:
                continue
            if failure.name == 'flavors' and BZ(
                    1612905, forced_streams=['5.9', 'upstream']).blocks:
                continue
        if provider.one_of(RHEVMProvider):
            # once BZ1546112 is fixed other failure than internal server
            # error is expected
            if failure.name in ('cloud_networks', 'cloud_subnets', 'security_groups') and BZ(
                    1546112, forced_streams=['5.9', 'upstream']).blocks:
                continue
        soft_assert(False, '{0} "{1}": status: {2}, error: `{3}`'.format(
            failure.type, failure.name, failure.response.status_code, failure.error))
def test_query_template_attributes(request, appliance, provider, soft_assert):
    """Tests access to template attributes.

    Metadata:
        test_flag: rest

    Polarion:
        assignee: pvala
        casecomponent: Rest
        caseimportance: high
        initialEstimate: 1/4h
    """
    templates = appliance.rest_api.collections.templates.all
    if templates:
        template_rest = templates[0]
    else:
        vm_rest = vm(request, provider, appliance)
        template_rest = template(request, appliance, provider, vm_rest)

    outcome = query_resource_attributes(template_rest)
    for failure in outcome.failed:
        if failure.type == 'attribute' and failure.name == 'policy_events' and BZ(
                1546995, forced_streams=['5.8', '5.9', 'upstream']).blocks:
            continue
        soft_assert(False, '{0} "{1}": status: {2}, error: `{3}`'.format(
            failure.type, failure.name, failure.response.status_code, failure.error))
    def test_query_attributes(self, buttons_groups, soft_assert):
        """Tests access to custom button/group attributes.

        Metadata:
            test_flag: rest

        Polarion:
            assignee: ndhandre
            initialEstimate: 1/4h
            caseimportance: low
            caseposneg: positive
            testtype: functional
            startsin: 5.9
            casecomponent: Rest
            tags: custom_button
        """
        response, _ = buttons_groups
        query_resource_attributes(response[0], soft_assert=soft_assert)
def test_provision_attributes(appliance, provider, small_template, soft_assert):
    """Tests that it's possible to display additional attributes in /api/provision_requests/:id.

    Metadata:
        test_flag: rest, provision

    Bugzilla:
        1592326

    Polarion:
        assignee: pvala
        casecomponent: Rest
        caseimportance: high
        initialEstimate: 1/4h
    """
    provision_data = get_provision_data(
        appliance.rest_api, provider, small_template.name, auto_approve=False)
    provision_request, = appliance.rest_api.collections.provision_requests.action.create(
        **provision_data)
    assert_response(appliance)
    # workaround for BZ1437689 to make sure the vm is not provisioned
    provision_request.action.deny(reason='denied')
    query_resource_attributes(provision_request, soft_assert=soft_assert)
    def test_query_picture_attributes(self, appliance, soft_assert):
        """Tests access to picture attributes.

        Metadata:
            test_flag: rest
        """
        picture = self.create_picture(appliance)
        outcome = query_resource_attributes(picture)

        bad_attrs = ('href_slug', 'region_description', 'region_number', 'image_href')
        for failure in outcome.failed:
            if failure.name in bad_attrs and BZ(1547852, forced_streams=['5.9']).blocks:
                continue
            soft_assert(False, '{0} "{1}": status: {2}, error: `{3}`'.format(
                failure.type, failure.name, failure.response.status_code, failure.error))
def test_query_vm_attributes(vm, soft_assert):
    """Tests access to VM attributes using /api/vms.

    Metadata:
        test_flag: rest
    """
    outcome = query_resource_attributes(vm)
    for failure in outcome.failed:
        if failure.type == 'attribute' and failure.name == 'policy_events' and BZ(
                1546995, forced_streams=['5.8', '5.9', 'upstream']).blocks:
            continue
        # this one is expected because additional arguments are needed
        if failure.type == 'subcollection' and failure.name == 'metric_rollups':
            continue
        soft_assert(False, '{0} "{1}": status: {2}, error: `{3}`'.format(
            failure.type, failure.name, failure.response.status_code, failure.error))
def test_query_vm_attributes(vm, soft_assert):
    """Tests access to VM attributes using /api/vms.

    Metadata:
        test_flag: rest

    Polarion:
        assignee: pvala
        casecomponent: Rest
        caseimportance: high
        initialEstimate: 1/4h
    """
    outcome = query_resource_attributes(vm)
    for failure in outcome.failed:
        # BZ 1546995
        soft_assert(False, '{0} "{1}": status: {2}, error: `{3}`'.format(
            failure.type, failure.name, failure.response.status_code, failure.error))
Exemple #54
0
    def test_query_picture_attributes(self, appliance, soft_assert):
        """Tests access to picture attributes.

        Metadata:
            test_flag: rest

        Polarion:
            assignee: pvala
            casecomponent: Rest
            caseimportance: medium
            initialEstimate: 1/4h
        """
        picture = self.create_picture(appliance)
        outcome = query_resource_attributes(picture)

        # BZ 1547852, some attrs were not working
        # bad_attrs = ('href_slug', 'region_description', 'region_number', 'image_href')
        for failure in outcome.failed:
            soft_assert(False, '{0} "{1}": status: {2}, error: `{3}`'.format(
                failure.type, failure.name, failure.response.status_code, failure.error))
def test_query_provider_attributes(provider, provider_rest, soft_assert):
    """Tests access to attributes of /api/providers.

    Metadata:
        test_flag: rest

    Bugzilla:
        1612905
        1546112

    Polarion:
        assignee: pvala
        casecomponent: Rest
        caseimportance: medium
        initialEstimate: 1/30h
    """
    outcome = query_resource_attributes(provider_rest)
    for failure in outcome.failed:
        # once BZ1546112 is fixed other failure than internal server error is expected
        soft_assert(False, '{0} "{1}": status: {2}, error: `{3}`'.format(
            failure.type, failure.name, failure.response.status_code, failure.error))