def automation_requests_pending(rest_api, vm):
    requests_data = _automation_requests_data(vm, approve=False)
    response = rest_api.collections.automation_requests.action.create(*requests_data)
    assert rest_api.response.status_code == 200
    for resource in response:
        assert resource.request_state == "pending"
    return response
 def _gen_automation_requests(output):
     api = MiqApi(entry_point, auth, verify_ssl=False)
     requests_data = _automation_requests_data(
         'nonexistent_vm', requests_collection=True, approve=False)
     api.collections.requests.action.create(*requests_data[:2])
     result = (api.response.status_code, api.response.json())
     output.put(result)
예제 #3
0
 def _gen_automation_requests(output):
     api = MiqApi(entry_point, auth, verify_ssl=False)
     requests_data = _automation_requests_data(
         'nonexistent_vm', requests_collection=True, approve=False)
     api.collections.requests.action.create(*requests_data[:2])
     result = (api.response.status_code, api.response.json())
     output.put(result)
예제 #4
0
def request_task(appliance, vm):
    requests = appliance.rest_api.collections.automation_requests.action.create(
        _automation_requests_data(vm)[0]
    )
    assert_response(appliance.rest_api)
    wait_for_requests(requests)
    return requests[0].request_tasks.all[0]
def gen_pending_requests(collection, rest_api, vm, requests=False):
    requests_data = _automation_requests_data(vm, approve=False, requests_collection=requests)
    response = collection.action.create(*requests_data[:2])
    assert_response(rest_api)
    assert len(response) == 2
    for resource in response:
        assert resource.request_state == 'pending'
    return response
예제 #6
0
def gen_pending_requests(collection, rest_api, vm, requests=False):
    requests_data = _automation_requests_data(vm, approve=False, requests_collection=requests)
    response = collection.action.create(*requests_data[:2])
    assert rest_api.response.status_code == 200
    assert len(response) == 2
    for resource in response:
        assert resource.request_state == 'pending'
    return response
예제 #7
0
    def test_multiple_automation_requests(self, collection, appliance, vm):
        """
        Bugzilla:
            1723830

        Polarion:
            assignee: ghubale
            initialEstimate: 1/30h
            casecomponent: Automate
        """
        requests_data = _automation_requests_data(vm, approve=False, num=100)
        response = collection.action.create(*requests_data)
        create_pending_requests(collection, appliance.rest_api, response)
        deny_requests(collection, appliance.rest_api, response, from_detail=False)
 def automation_requests_data(self, vm):
     return _automation_requests_data(vm, requests_collection=True)
 def automation_requests_data(self, vm):
     return _automation_requests_data(vm)
 def automation_requests_data(self, vm):
     return _automation_requests_data(vm, requests_collection=True)
 def automation_requests_data(self, vm):
     return _automation_requests_data(vm)