def test_ctr_positive_tool_inspect(module_headers, module_tool_client): """Perform testing for inspect end point of custom threat response python module ID: 3ce73f46-7db9-4ae7-a69d-fd791c943d28 Steps: 1. Send request sha256 hash to inspect end point of threat response server using direct POST call 2. Send same request using custom python module 3. Compare results Expectedresults: Inspect requests which are sent directly and sent using custom tool return same responses Importance: Critical """ request_content = gen_sha256(gen_string()) direct_response = inspect(payload={'content': request_content}, **{'headers': module_headers}) tool_response = module_tool_client.inspect.inspect( {'content': request_content}) assert direct_response[0]['value'] == tool_response[0]['value'] assert direct_response[0]['type'] == tool_response[0]['type'] assert tool_response[0]['value'] == request_content assert tool_response[0]['type'] == 'sha256'
def test_ctr_positive_smoke_inspect(module_headers): """Perform testing for inspect end point of threat response application server ID: aaf14b29-9f5a-41aa-805e-73398ed2b112 Steps: 1. Send request with domain name to inspect end point Expectedresults: POST action reached end point and returned correct data Importance: High """ request_content = 'cisco.com' response = inspect(payload={'content': request_content}, **{'headers': module_headers}) assert response[0]['value'] == request_content assert response[0]['type'] == 'domain'
def test_ctr_positive_timeout_support(module_headers): """Perform testing for inspect end point of threat response application server ID: CCTRI-eeb97060-f393-46d3-b281-602f7624e91e Steps: 1. Send request with domain name and timeout to inspect end point Expectedresults: It is possible to use timeout as part of POST request to have delay and return correct data Importance: High """ response = inspect(payload={'content': DOMAIN}, **{ 'headers': module_headers, 'timeout': 5 }) assert response[0]['value'] == DOMAIN assert response[0]['type'] == 'domain'