blob: afe4301a18baf8d5a056e2f92cc5532381a42b1a [file] [log] [blame]
Bartosz Gardziejewski03591ab2020-09-29 13:50:12 +02001*** Settings ***
Bartosz Gardziejewski64b0fe12020-10-06 08:12:12 +02002Resource ./resources/vnfsdk_keywords.robot
Bartosz Gardziejewski03591ab2020-09-29 13:50:12 +02003
4*** Test Cases ***
Bartosz Gardziejewski64b0fe12020-10-06 08:12:12 +02005
Bartosz Gardziejewski03591ab2020-09-29 13:50:12 +02006Perform vnf refrepo healthcheck
7 [Documentation] Check if vnf refrepo is up and running
8 Create Session refrepo ${base_url}
9 ${response}= Get Request refrepo /PackageResource/healthcheck
10 Should Be Equal As Strings ${response.status_code} 200
Bartosz Gardziejewski64b0fe12020-10-06 08:12:12 +020011
12Validate correct, no security CSAR
13 [Documentation] Valid CSAR with no security should PASS validation and should return no error
14 ${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}'
15 ${response}= String.Replace String ${response} \\n ${SPACE}
16 # Removing strings that are causing errors during evaluation,
17 # those strings are dependent on validation response and may need to be changed if vnf refrepo response changes
18 ${response}= Remove String ${response} \\\\ \\u003c \\u003e \\"
19 ${json_response}= evaluate json.loads('''${response}''') json
20 Should Be Equal As Strings ${json_response[0]["results"]["criteria"]} PASS
21 FOR ${resault} IN @{json_response[0]["results"]["results"]}
22 Should Be Equal As Strings ${resault["errors"]} []
23 Should Be Equal As Strings ${resault["passed"]} True
24 END