X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=tests%2Fvnfsdk-refrepo%2Fcsar_validation_tests.robot;fp=tests%2Fvnfsdk-refrepo%2Fcsar_validation_tests.robot;h=afe4301a18baf8d5a056e2f92cc5532381a42b1a;hb=64b0fe188d39c4e971cf57dcfc502c5f331c2a83;hp=88075c6fc47a14d2255ebff2f272cfa3accafec6;hpb=322b8e8df0ecf9deabba4cea7edf24e14ce4c5b5;p=integration%2Fcsit.git diff --git a/tests/vnfsdk-refrepo/csar_validation_tests.robot b/tests/vnfsdk-refrepo/csar_validation_tests.robot index 88075c6f..afe4301a 100644 --- a/tests/vnfsdk-refrepo/csar_validation_tests.robot +++ b/tests/vnfsdk-refrepo/csar_validation_tests.robot @@ -1,18 +1,24 @@ *** Settings *** -Library OperatingSystem -Library Process -Library String -Library Collections -Library RequestsLibrary -Library json - - -*** Variables *** -${base_url}= http://${REFREPO_IP}:8702/onapapi/vnfsdk-marketplace/v1 +Resource ./resources/vnfsdk_keywords.robot *** Test Cases *** + 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} + # 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 + Should Be Equal As Strings ${json_response[0]["results"]["criteria"]} PASS + FOR ${resault} IN @{json_response[0]["results"]["results"]} + Should Be Equal As Strings ${resault["errors"]} [] + Should Be Equal As Strings ${resault["passed"]} True + END