[Return] ${stdout}
+Get Ns List
+ ${rc} ${stdout}= Run and Return RC and Output osm ns-list 2>&1
+ Log ${stdout}
+ Should Be Equal As Integers ${rc} ${success_return_code}
+ [Return] ${stdout}
+
+
Get Ns Vnf List
[Arguments] ${ns_id}
Get Auth Token
[Tags] auth_token
Get Hostname
- Create Session osmhit ${HOST}
+ Create Session osmhit ${HOST} disable_warnings=1
&{headers} Create Dictionary Content-Type=application/json Accept=application/json
&{data} Create Dictionary username=${osm_user} password=${osm_password} project-id=${osm_project}
${resp}= Post On Session osmhit ${auth_token_uri} json=${data} headers=${headers}
[Arguments] ${JsonInput} ${key}
${json_path}= Read Directory
${json_obj}= Load JSON From File ${json_path}/${JsonInput}
- ${updated_json_obj} JSONLibrary.Update Value To Json ${json_obj} $..${key} ${created_vim_account_id}
+ ${updated_json_obj}= JSONLibrary.Update Value To Json ${json_obj} $..${key} ${created_vim_account_id}
Set Suite Variable ${updated_json_obj}
Get Api Request
*** Keywords ***
+Get Vnf List
+ ${rc} ${stdout}= Run and Return RC and Output osm vnf-list 2>&1
+ Log ${stdout}
+ Should Be Equal As Integers ${rc} ${success_return_code}
+ [Return] ${stdout}
+
+
Get VNF VIM ID
[Arguments] ${vnf_id}
-{\r
- "data":[\r
- {\r
- "vnfdId":"hackfest_basic_metrics-vnf",\r
- "vnfInstanceName":"sol003-instance",\r
- "vnfInstanceDescription":"Test vnfm instance description",\r
- "vimAccountId":"8dc2f11d-e08a-4ec7-920c-6b8a88bff1e5",\r
- "additionalParams":{\r
- "virtual-link-desc":[\r
- {\r
- "id":"mgmtnet",\r
- "mgmt-network":true\r
- }\r
- ],\r
- "constituent-cpd-id":"vnf-cp0-ext",\r
- "virtual-link-profile-id":"mgmtnet"\r
- }\r
- },\r
- {\r
- "vnfName":"sol003-instance",\r
- "vnfDescription":"vnf package",\r
- "vnfId":"70b47595-fafa-4f63-904b-fc3ada60eebb",\r
- "vimAccountId":"8dc2f11d-e08a-4ec7-920c-6b8a88bff1e5"\r
- },\r
- {\r
- "type":"SCALE_OUT",\r
- "aspectId":"vdu_autoscale",\r
- "numberOfSteps":"1",\r
- "additionalParams":{\r
- "member-vnf-index":"1"\r
- }\r
- },\r
- {\r
- "terminationType":"GRACEFUL",\r
- "gracefulTerminationTimeout":"5"\r
- }\r
- ]\r
-}\r
+{
+ "data":[
+ {
+ "vnfdId":"hackfest_basic_metrics-vnf",
+ "vnfInstanceName":"sol003-instance",
+ "vnfInstanceDescription":"Test vnfm instance description",
+ "vimAccountId":"8dc2f11d-e08a-4ec7-920c-6b8a88bff1e5",
+ "additionalParams":{
+ "virtual-link-desc":[
+ {
+ "id":"mgmtnet",
+ "mgmt-network":true
+ }
+ ],
+ "constituent-cpd-id":"vnf-cp0-ext",
+ "virtual-link-profile-id":"mgmtnet"
+ }
+ },
+ {
+ "vnfName":"sol003-instance",
+ "vnfDescription":"vnf package",
+ "vnfId":"70b47595-fafa-4f63-904b-fc3ada60eebb",
+ "vimAccountId":"8dc2f11d-e08a-4ec7-920c-6b8a88bff1e5"
+ },
+ {
+ "type":"SCALE_OUT",
+ "aspectId":"vdu_autoscale",
+ "numberOfSteps":"1",
+ "additionalParams":{
+ "member-vnf-index":"1"
+ }
+ },
+ {
+ "terminationType":"GRACEFUL",
+ "gracefulTerminationTimeout":"5"
+ }
+ ]
+}
Resource %{ROBOT_DEVOPS_FOLDER}/lib/sol003_common_lib.robot
Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot
+Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot
+Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnf_lib.robot
Resource %{ROBOT_DEVOPS_FOLDER}/lib/vim_lib.robot
Force Tags sol003_01 cluster_sol003 daily
*** Test Cases ***
Create VNF package from JSON file descriptor
[Documentation] Test case to create a VNF Identifier
+ Get VNFDs List
${id}= Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}'
Set Suite Variable ${vnfid} ${id}
${created_vim_account_id}= Get VIM Target ID %{VIM_TARGET}
${json_path}= Read Directory
${json_obj}= Load JSON From File ${json_path}/sol003_01-vnf-lifecycle-management.json
${json_obj}= Get Variable Value ${json_obj['data'][0]}
- ${updated_json_obj} JSONLibrary.Update Value To Json ${json_obj} $..vimAccountId ${created_vim_account_id}
- ${updated_json_obj} JSONLibrary.Update Value To Json ${updated_json_obj} $..additionalParams.virtual-link-desc[0][id] %{VIM_MGMT_NET}
- ${updated_json_obj} JSONLibrary.Update Value To Json ${updated_json_obj} $..additionalParams.virtual-link-profile-id %{VIM_MGMT_NET}
+ ${updated_json_obj}= JSONLibrary.Update Value To Json ${json_obj} $..vimAccountId ${created_vim_account_id}
+ Log ${updated_json_obj}
+ ${updated_json_obj}= JSONLibrary.Update Value To Json ${updated_json_obj} $..additionalParams.virtual-link-desc[0][id] %{VIM_MGMT_NET}
+ Log ${updated_json_obj}
+ ${updated_json_obj}= JSONLibrary.Update Value To Json ${updated_json_obj} $..additionalParams.virtual-link-profile-id %{VIM_MGMT_NET}
+ Log ${updated_json_obj}
Set Test Variable ${updated_json_obj}
Post API Request ${vnf_instance_uri}
Pass Execution If ${request_response.status_code} in ${success_status_code_list} Query VNF Instance completed
${id}= Get Value From Json ${request_response.json()} $..id
Set Suite Variable ${createid} ${id[0]}
+ Get VNFDs List
Instantiate VNF
[Documentation] Test case to Instantiate a VNF
+ Get Ns List
+ Get Vnf List
Get Auth Token
${json_path}= Read Directory
${json_obj}= Load JSON From File ${json_path}/sol003_01-vnf-lifecycle-management.json
${json_obj}= Get Variable Value ${json_obj['data'][1]}
- ${updated_json_obj} JSONLibrary.Update Value To Json ${json_obj} $..vimAccountId ${created_vim_account_id}
- ${updated_json_obj} JSONLibrary.Update Value To Json ${json_obj} $..vnfId ${createid}
+ ${updated_json_obj}= JSONLibrary.Update Value To Json ${json_obj} $..vimAccountId ${created_vim_account_id}
+ ${updated_json_obj}= JSONLibrary.Update Value To Json ${updated_json_obj} $..vnfId ${createid}
Set Test Variable ${updated_json_obj}
Post API Request ${vnf_instantiate_uri}/${createid}/instantiate
Pass Execution If ${request_response.status_code} in ${success_status_code_list} Instantiate VNF Instance completed
${id}= Get Value From Json ${request_response.json()} $..id
Set Suite Variable ${instantiateid} ${id[0]}
Sleep 12s
+ Get Ns List
+ Get Vnf List
Query VNF Instances
[Documentation] Test case to query VNF Instance