aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plans/vfc-nfvo-catalog/sanity-check/testplan.txt2
-rw-r--r--tests/vfc/nfvo-catalog/jsons/ns_packages.json3
-rw-r--r--tests/vfc/nfvo-catalog/jsons/vnf_packages.json7
-rw-r--r--tests/vfc/nfvo-catalog/test.robot77
4 files changed, 87 insertions, 2 deletions
diff --git a/plans/vfc-nfvo-catalog/sanity-check/testplan.txt b/plans/vfc-nfvo-catalog/sanity-check/testplan.txt
index 65cadf99..31512437 100644
--- a/plans/vfc-nfvo-catalog/sanity-check/testplan.txt
+++ b/plans/vfc-nfvo-catalog/sanity-check/testplan.txt
@@ -1,5 +1,5 @@
# Test suites are relative paths under [integration/csit.git]/tests/.
-# Place the suites in run order.
+# Place the suites in run order.
vfc/nfvo-catalog/test.robot
vfc/nfvo-catalog/Subscriptions.robot
vfc/nfvo-catalog/IndividualSubscription.robot
diff --git a/tests/vfc/nfvo-catalog/jsons/ns_packages.json b/tests/vfc/nfvo-catalog/jsons/ns_packages.json
new file mode 100644
index 00000000..20a78322
--- /dev/null
+++ b/tests/vfc/nfvo-catalog/jsons/ns_packages.json
@@ -0,0 +1,3 @@
+{
+ "csarId": "2"
+}
diff --git a/tests/vfc/nfvo-catalog/jsons/vnf_packages.json b/tests/vfc/nfvo-catalog/jsons/vnf_packages.json
new file mode 100644
index 00000000..a87d7d02
--- /dev/null
+++ b/tests/vfc/nfvo-catalog/jsons/vnf_packages.json
@@ -0,0 +1,7 @@
+{
+ "csarId": "1",
+ "vimIds": [
+ "1"
+ ],
+ "labVimId": "7"
+} \ No newline at end of file
diff --git a/tests/vfc/nfvo-catalog/test.robot b/tests/vfc/nfvo-catalog/test.robot
index 1390e9fb..7e6759fe 100644
--- a/tests/vfc/nfvo-catalog/test.robot
+++ b/tests/vfc/nfvo-catalog/test.robot
@@ -12,6 +12,17 @@ ${cataloghealthcheck_url} /api/catalog/v1/health_check
${vnfpkgmhealthcheck_url} /api/vnfpkgm/v1/health_check
${nsdhealthcheck_url} /api/nsd/v1/health_check
${parserhealthcheck_url} /api/parser/v1/health_check
+${service_packages_url} /api/parser/v1/service_packages
+${vnfpackages_url} /api/catalog/v1/vnfpackages
+${nspackages_url} /api/catalog/v1/nspackages
+${jobs_url} /api/catalog/v1/jobs
+
+#json files
+${ns_packages_json} ${SCRIPTS}/../tests/vfc/nfvo-catalog/jsons/ns_packages.json
+${vnfpackages_catalog_json} ${SCRIPTS}/../tests/vfc/nfvo-catalog/jsons/vnf_packages.json
+
+#global variables
+${jobId}
*** Test Cases ***
Check Health Catalog
@@ -34,6 +45,53 @@ Check Health Parser
[Documentation] check health for Parser by MSB
Check Health ${parserhealthcheck_url}
+Check distribute catalog NS pacakages
+ Log Check distribute catalog NS pacakages
+ [Documentation] check distribute catalog NS pacakages
+ Check distribute package ${ns_packages_json} ${nspackages_url}
+
+Check query catalog all NS package
+ Log Query catalog all NS package
+ [Documentation] check query catalog all NS package
+ Check query all packages ${nspackages_url}
+
+Check query all Service package
+ Log Query all Service packages
+ [Documentation] check query Service packages by MSB
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json
+ Check query all packages ${service_packages_url}
+
+Check distribute VNF package
+ Log Check distribute VNF packagee
+ [Documentation] check distribute VNF package
+ ${json_value}= json_from_file ${vnfpackages_catalog_json}
+ ${json_string}= string_from_json ${json_value}
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json
+ Create Session web_session http://${CATALOG_IP}:${catalog_port} headers=${headers}
+ Set Request Body ${json_string}
+ ${resp}= Post Request web_session ${vnfpackages_url} ${json_string}
+ Should Be Equal As Strings 202 ${resp.status_code}
+ ${response_json} json.loads ${resp.content}
+ ${jobId}= Convert To String ${response_json['jobId']}
+ Set Global Variable ${jobId}
+
+Check query job status
+ Log Check query job status
+ [Documentation] check query job status
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json
+ Create Session web_session http://${CATALOG_IP}:${catalog_port} headers=${headers}
+ ${resp}= Get Request web_session ${jobs_url}/${jobId}
+ Should Be Equal As Strings 200 ${resp.status_code}
+
+Check query all VNF package
+ Log Query all VNF packages
+ [Documentation] check query VNF packages
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json
+ Create Session web_session http://${CATALOG_IP}:${catalog_port} headers=${headers}
+ ${resp}= Get Request web_session ${vnfpackages_url}
+ Should Be Equal As Strings 200 ${resp.status_code}
+ ${response_json} json.loads ${resp.content}
+
*** Keywords ***
Check Health
[Arguments] ${url}
@@ -41,5 +99,22 @@ Check Health
Create Session web_session http://${CATALOG_IP}:${catalog_port} headers=${headers}
${resp}= Get Request web_session ${url}
Should Be Equal As Strings 200 ${resp.status_code}
- ${response_json} json.loads ${resp.content}
+ ${response_json} json.loads ${resp.content}
Should Be Equal As Strings active ${response_json['status']}
+
+Check distribute package
+ [Arguments] ${json_file} ${url}
+ ${json_value}= json_from_file ${json_file}
+ ${json_string}= string_from_json ${json_value}
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json
+ Create Session web_session http://${CATALOG_IP}:${catalog_port} headers=${headers}
+ Set Request Body ${json_string}
+ ${resp}= Post Request web_session ${url} ${json_string}
+ Should Be Equal As Strings 202 ${resp.status_code}
+
+Check query all packages
+ [Arguments] ${url}
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json
+ Create Session web_session http://${CATALOG_IP}:${catalog_port} headers=${headers}
+ ${resp}= Get Request web_session ${url}
+ Should Be Equal As Strings 200 ${resp.status_code} \ No newline at end of file