*** Settings ***
Documentation [SOL003-01] Sol003 Api testing
-Suite Teardown Run Keyword And Ignore Error Suite Cleanup
-Force Tags sol003_01 cluster_sol003 daily
+
Library OperatingSystem
Library String
Library Collections
Library yaml
Library JsonValidator
Library JSONLibrary
+
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
+
+Suite Teardown Run Keyword And Ignore Error Suite Cleanup
+
+
*** Variables ***
${vnfd_pkg} hackfest_basic_metrics_vnf
${vnfd_name} hackfest_basic_metrics-vnf
+
*** 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
Delete VNFD ${vnfd_name}
+
*** Keywords ***
Suite Cleanup
[Documentation] Test Suit Cleanup: Deleting Descriptor
Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name}
+