aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBartosz Gardziejewski <bartosz.gardziejewski@nokia.com>2020-10-08 13:04:24 +0200
committerBartosz Gardziejewski <bartosz.gardziejewski@nokia.com>2020-10-08 13:04:46 +0200
commit3a55c90031f44e5637a61104a874508fa28dd4c9 (patch)
tree8ef3ee2b061c884f3e48f5a6cece9c3ad9547ff4 /tests
parente8725131014daf39725e37d518c5b9766d86ee46 (diff)
Update CSIT tests for vnfsdk CSAR validation.
Signed-off-by: Bartosz Gardziejewski <bartosz.gardziejewski@nokia.com> Change-Id: I226a205ccaeb06e92aa6f7327e01224304b07d34 Issue-ID: VNFSDK-697
Diffstat (limited to 'tests')
-rw-r--r--tests/vnfsdk-refrepo/csar_validation_tests.robot27
-rw-r--r--tests/vnfsdk-refrepo/resources/vnfsdk_properties.robot4
2 files changed, 26 insertions, 5 deletions
diff --git a/tests/vnfsdk-refrepo/csar_validation_tests.robot b/tests/vnfsdk-refrepo/csar_validation_tests.robot
index 3ae5925c..9994d567 100644
--- a/tests/vnfsdk-refrepo/csar_validation_tests.robot
+++ b/tests/vnfsdk-refrepo/csar_validation_tests.robot
@@ -25,10 +25,10 @@ Validate correct, no security CSAR
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
+Validate CSAR using rule r130206 and use get method to receive outcome
+ [Documentation] Validate CSAR with invalid PM_Dictionary (r130206) using rule 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}
+ ${response}= Validate CSAR usign Post request ${csar_invalid_pm_dictionary} ${execute_invalid_pm_dictionary_r130206_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 \\"
@@ -45,3 +45,24 @@ Validate CSAR and use get method to receive outcome
FOR ${error} IN @{json_get_response[0]["results"]}
Should Contain ${error["code"]} R130206
END
+
+Validate CSAR using all rule and use get method to receive outcome
+ [Documentation] Validate CSAR with invalid PM_Dictionary (r130206) using all rules, 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 \\u003c \\u003e \\"
+ ${json_get_response}= evaluate json.loads('''${get_response}''') json
+ Should Be Equal As Strings ${json_response[0]["results"]["criteria"]} FAILED
+ FOR ${resault} IN @{json_response[0]["results"]["results"]}
+ Should Be Equal As Strings ${resault["warnings"]} []
+ Run keyword if "${resault["vnfreqName"]}" == "r130206"
+ ... Should Be Equal As Strings ${resault["passed"]} False
+ END
diff --git a/tests/vnfsdk-refrepo/resources/vnfsdk_properties.robot b/tests/vnfsdk-refrepo/resources/vnfsdk_properties.robot
index 8390b93a..e46eba6f 100644
--- a/tests/vnfsdk-refrepo/resources/vnfsdk_properties.robot
+++ b/tests/vnfsdk-refrepo/resources/vnfsdk_properties.robot
@@ -6,7 +6,7 @@ ${csarpath}= ${SCRIPTS}/../tests/vnfsdk-refrepo/csar
${csar_valid_no_security}= valid_no_security.csar
${execute_no_security_csar_validation}= [{"scenario": "onap-dublin","testSuiteName": "validation","testCaseName": "csar-validate","parameters": {"csar": "file://${csar_valid_no_security}","pnf":"true"}}]
-
${csar_invalid_pm_dictionary}= invalid_pm_dictionary.csar
-${execute_invalid_pm_dictionary_validation}= [{"scenario": "onap-dublin","testSuiteName": "validation","testCaseName": "csar-validate-r130206","parameters": {"csar": "file://${csar_invalid_pm_dictionary}","pnf":"true"}}]
+${execute_invalid_pm_dictionary_r130206_validation}= [{"scenario": "onap-dublin","testSuiteName": "validation","testCaseName": "csar-validate-r130206","parameters": {"csar": "file://${csar_invalid_pm_dictionary}","pnf":"true"}}]
+${execute_invalid_pm_dictionary_validation}= [{"scenario": "onap-dublin","testSuiteName": "validation","testCaseName": "csar-validate","parameters": {"csar": "file://${csar_invalid_pm_dictionary}","pnf":"true"}}]