aboutsummaryrefslogtreecommitdiffstats
path: root/tests/vfc
diff options
context:
space:
mode:
authorzhaoliping123 <zhaoliping@chinamobile.com>2019-10-25 11:22:39 +0800
committerzhaoliping123 <zhaoliping@chinamobile.com>2019-10-25 14:40:41 +0800
commit39b397e2ed0c1e38ac88cbbdab29f085f6cacf2e (patch)
tree06f5fc93ded0460551a0a112cfc5384c2def0ac3 /tests/vfc
parentdc56b9e2843722d7aa6eab649e26e5372e592c80 (diff)
Add some test cases for VF-C catalog to CSIT
Issue-ID: VFC-1534 Change-Id: I19fc6a441e50c60bdc8d2af51640ff72ebc058c6 Signed-off-by: zhaoliping123 <zhaoliping@chinamobile.com>
Diffstat (limited to 'tests/vfc')
-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
3 files changed, 86 insertions, 1 deletions
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