X-Git-Url: https://gerrit.onap.org/r/gitweb?p=integration%2Fcsit.git;a=blobdiff_plain;f=tests%2Fvnfsdk-refrepo%2Fcsar_validation_tests.robot;h=3ae5925caf2f7337a4febdf00ff0a5652b1d6c7b;hp=afe4301a18baf8d5a056e2f92cc5532381a42b1a;hb=e8725131014daf39725e37d518c5b9766d86ee46;hpb=64b0fe188d39c4e971cf57dcfc502c5f331c2a83 diff --git a/tests/vnfsdk-refrepo/csar_validation_tests.robot b/tests/vnfsdk-refrepo/csar_validation_tests.robot index afe4301a..3ae5925c 100644 --- a/tests/vnfsdk-refrepo/csar_validation_tests.robot +++ b/tests/vnfsdk-refrepo/csar_validation_tests.robot @@ -5,14 +5,15 @@ Resource ./resources/vnfsdk_keywords.robot Perform vnf refrepo healthcheck [Documentation] Check if vnf refrepo is up and running + Create Session refrepo ${base_url} ${response}= Get Request refrepo /PackageResource/healthcheck Should Be Equal As Strings ${response.status_code} 200 Validate correct, no security CSAR [Documentation] Valid CSAR with no security should PASS validation and should return no error - ${response}= Run curl -s --location --request POST '${base_url}/vtp/executions' --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' --form 'file=@${csarpath}/${csar_valid_no_security}' --form 'executions=${execute_no_security_csar_validation}' - ${response}= String.Replace String ${response} \\n ${SPACE} + + ${response}= Validate CSAR usign Post request ${csar_valid_no_security} ${execute_no_security_csar_validation} # Removing strings that are causing errors during evaluation, # those strings are dependent on validation response and may need to be changed if vnf refrepo response changes ${response}= Remove String ${response} \\\\ \\u003c \\u003e \\" @@ -22,3 +23,25 @@ Validate correct, no security CSAR Should Be Equal As Strings ${resault["errors"]} [] Should Be Equal As Strings ${resault["passed"]} True END + + +Validate CSAR and use get method to receive outcome + [Documentation] Validate CSAR with invalid PM_Dictionary (r130206), then use get method with validation id to receive valdiation outcome + + ${response}= Validate CSAR usign Post request ${csar_invalid_pm_dictionary} ${execute_invalid_pm_dictionary_validation} + # Removing strings that are causing errors during evaluation, + # those strings are dependent on validation response and may need to be changed if vnf refrepo response changes + ${response}= Remove String ${response} \\\\ \\u003c \\u003e \\" + ${json_response}= evaluate json.loads('''${response}''') json + + ${get_response}= Get validation result using GET request ${json_response[0]["executionId"]} + # Removing strings that are causing errors during evaluation, + # those strings are dependent on validation response and may need to be changed if vnf refrepo response changes + ${get_response}= Remove String ${get_response} \\\\ \\u0027 + ${json_get_response}= evaluate json.loads('''${get_response}''') json + Should Be Equal As Strings ${json_get_response[0]["status"]} failed + ${errors_number}= Get Length ${json_get_response[0]["results"]} + Should Be Equal As Strings ${errors_number} 4 + FOR ${error} IN @{json_get_response[0]["results"]} + Should Contain ${error["code"]} R130206 + END