From: garciadeblas Date: Thu, 23 Jun 2022 11:33:26 +0000 (+0200) Subject: Reformat Robot files to follow best practices X-Git-Tag: v12.0.0rc1~4 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F39%2F12239%2F1;p=osm%2Ftests.git Reformat Robot files to follow best practices Best practices in Robot files consist in using three spaces as separator and not using tabs. This change updates all files and includes the checking of the format as part of `devops-stages/stage-test.sh`. In addition, it checks that files have no CRLF terminators. Change-Id: Ie71c2dd92585eba3baf98df0be54f05828819ad8 Signed-off-by: garciadeblas --- diff --git a/devops-stages/stage-test.sh b/devops-stages/stage-test.sh index abc03e2..00c8981 100755 --- a/devops-stages/stage-test.sh +++ b/devops-stages/stage-test.sh @@ -11,14 +11,72 @@ # implied. # See the License for the specific language governing permissions and # limitations under the License. + # python3 -m rflint testsuites + +check_tabs () { + folder="$1" + tabs="y" + ! grep -r " " ${folder} && tabs="" + [ -n "${tabs}" ] && \ + echo "There are tabs in ${folder}" && \ + echo "Please replace by spaces" && \ + exit 1 +} + +check_two_spaces () { + folder="$1" + two_spaces="y" + ! grep -r "[^ ] [^ ]" ${folder} && two_spaces="" + [ -n "${two_spaces}" ] && \ + echo "Some files in ${folder} are using two spaces to separate params" && \ + echo "Use this command to change it:" && \ + echo " sed -i 's/\([^ ]\) \([^ ]\)/\\\1 \\\2/g' " && \ + exit 1 +} + +check_four_spaces () { + folder="$1" + four_spaces="y" + ! grep -r "[^# \.] " ${folder} && four_spaces="" + [ -n "${four_spaces}" ] && \ + echo "Some files in ${folder} are using four spaces or more to separate params" && \ + echo "You can try this command to change it:" && \ + echo " sed -i 's/\([^# \.]\) */\\\1 /g' " && \ + exit 1 +} + +check_crlf_terminators () { + folder="$1" + crlf_terminators="y" + ! (find ${folder} -not -type d -exec file "{}" ";" | grep CRLF) && crlf_terminators="" + [ -n "${crlf_terminators}" ] && \ + echo "Some files in ${folder} have CRLF at the end of some lines" && \ + echo "Use this command to change it:" && \ + echo " dos2unix " && \ + exit 1 +} + echo "Checking tabs in robot files. No tabs should be present" -tabs_in_testsuite="y" -tabs_in_lib="y" -! grep -ri " " robot-systest/testsuite && tabs_in_testsuite="" -! grep -ri " " robot-systest/lib && tabs_in_lib="" -[ -n "${tabs_in_testsuite}" ] && echo "There are tabs in robot-systest/testsuite" && exit 1 -[ -n "${tabs_in_lib}" ] && echo "There are tabs in robot-systest/lib" && exit 1 -echo "No tabs are present in robot files" +check_tabs robot-systest/testsuite +check_tabs robot-systest/lib +echo "No tabs are present in robot files. Correct!" + +echo "Checking param separation in robot files. Three spaces is the recommendation, instead of two" +check_two_spaces robot-systest/testsuite +check_two_spaces robot-systest/lib +echo "No presence of two spaces to separate params in robot files. Correct!" + +echo "Checking param separation in robot files. Three spaces is the recommendation, instead of four or more" +check_four_spaces robot-systest/testsuite +check_four_spaces robot-systest/lib +echo "Only three spaces must be used between params in robot files. Correct!" + +echo "Checking CRLF terminators in robot files. No CRLF should be found" +check_crlf_terminators robot-systest/testsuite +check_crlf_terminators robot-systest/lib +echo "No presence of CRLF terminators in robot files. Correct!" + +echo "SUCCESS" exit 0 diff --git a/robot-systest/lib/connectivity_lib.robot b/robot-systest/lib/connectivity_lib.robot index 3db20b8..fed1b23 100644 --- a/robot-systest/lib/connectivity_lib.robot +++ b/robot-systest/lib/connectivity_lib.robot @@ -23,13 +23,13 @@ Test Ping Host ... Execution example: ... Ping Test \${host} - [Arguments] ${host} + [Arguments] ${host} ${rc} ${stdout}= Run and Return RC and Output ping -c 2 -W 1 ${host} log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} Test Connectivity - [Arguments] ${host} + [Arguments] ${host} WAIT UNTIL KEYWORD SUCCEEDS ${connectivity_max_wait_time} ${connectivity_pol_time} Test Ping Host ${host} diff --git a/robot-systest/lib/juju_lib.robot b/robot-systest/lib/juju_lib.robot index 94db455..62f557e 100644 --- a/robot-systest/lib/juju_lib.robot +++ b/robot-systest/lib/juju_lib.robot @@ -21,7 +21,7 @@ Get Scale Number Should Not Be Empty ${application_name} ${model_name} ${stdout}= Execute Remote Command Check Rc Return Output ${host} ${username} ${password} ${privatekey} juju show-status ${application_name} --format yaml -m ${model_name} | grep scale | awk -F ': ' '{print $2}' log ${stdout} - [Return] ${stdout} + [Return] ${stdout} Get Model Name [Arguments] ${host} ${username} ${password} ${privatekey} ${ns_id} ${kdu_name} @@ -31,4 +31,4 @@ Get Model Name log ${stdout} ${model_name}= Set Variable ${kdu_name}-${ns_id} Should Be Equal As Strings ${model_name} ${stdout} - [Return] ${stdout} + [Return] ${stdout} diff --git a/robot-systest/lib/k8scluster_lib.robot b/robot-systest/lib/k8scluster_lib.robot index 429abda..54b4225 100644 --- a/robot-systest/lib/k8scluster_lib.robot +++ b/robot-systest/lib/k8scluster_lib.robot @@ -25,27 +25,27 @@ Create K8s Cluster ${rc} ${stdout}= Run and Return RC and Output osm k8scluster-add --creds ${k8scluster_creds} --version ${k8scluster_version} --vim ${k8scluster_vim} --k8s-nets '{"net1": "${k8scluster_net}"}' ${k8scluster_name} --description "Robot cluster" log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - WAIT UNTIL KEYWORD SUCCEEDS ${k8scluster_launch_max_wait_time} ${k8scluster_launch_pol_time} Check For K8s Cluster To Be Ready ${k8scluster_name} - Check For K8s Cluster To Be Enabled ${k8scluster_name} - [Return] ${stdout} + WAIT UNTIL KEYWORD SUCCEEDS ${k8scluster_launch_max_wait_time} ${k8scluster_launch_pol_time} Check For K8s Cluster To Be Ready ${k8scluster_name} + Check For K8s Cluster To Be Enabled ${k8scluster_name} + [Return] ${stdout} Delete K8s Cluster [Arguments] ${k8scluster_name} ${rc} ${stdout}= Run and Return RC and Output osm k8scluster-delete ${k8scluster_name} Should Be Equal As Integers ${rc} ${success_return_code} - WAIT UNTIL KEYWORD SUCCEEDS ${k8scluster_delete_max_wait_time} ${k8scluster_delete_pol_time} Check For K8s Cluster To Be Deleted ${k8scluster_name} + WAIT UNTIL KEYWORD SUCCEEDS ${k8scluster_delete_max_wait_time} ${k8scluster_delete_pol_time} Check For K8s Cluster To Be Deleted ${k8scluster_name} Get K8s Cluster ${rc} ${stdout}= Run and Return RC and Output osm k8scluster-list Should Be Equal As Integers ${rc} ${success_return_code} log ${stdout} - [Return] ${stdout} + [Return] ${stdout} Check for K8s Cluster [Arguments] ${k8scluster_name} ${rc} ${stdout}= Run and Return RC and Output osm k8scluster-list --filter name="${k8scluster_name}" Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + [Return] ${stdout} Check For K8s Cluster To Be Deleted [Arguments] ${k8scluster_name} diff --git a/robot-systest/lib/ns_lib.robot b/robot-systest/lib/ns_lib.robot index 98d514d..d65f93c 100644 --- a/robot-systest/lib/ns_lib.robot +++ b/robot-systest/lib/ns_lib.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation Library to deploy and delete NS, and run operations on them. +Documentation Library to deploy and delete NS, and run operations on them. Library DateTime @@ -43,7 +43,7 @@ Create Network Service WAIT UNTIL KEYWORD SUCCEEDS ${ns_launch_max_wait_time} ${ns_launch_pol_time} Check For NS Instance To Configured ${ns_name} Check For NS Instance For Failure ${ns_name} - [Return] ${ns_id} + [Return] ${ns_id} Instantiate Network Service @@ -52,7 +52,7 @@ Instantiate Network Service ${rc} ${stdout}= Run and Return RC and Output osm ns-create --ns_name ${ns_name} --nsd_name ${nsd} --vim_account ${vim_name} ${ns_extra_args} log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + [Return] ${stdout} Update Network Service @@ -61,7 +61,7 @@ Update Network Service ${rc} ${stdout}= Run and Return RC and Output osm ns-update ${ns_id} --updatetype ${update_type} --config ${ns_update_config} --timeout ${ns_update_timeout} --wait log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + [Return] ${stdout} Get Vnf Management Ip Address @@ -72,7 +72,7 @@ Get Vnf Management Ip Address ${rc} ${stdout}= Run and Return RC and Output osm vnf-list --filter member-vnf-index-ref=${vnf_member_index} | grep ${ns_id} | awk '{print $14}' 2>&1 log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + [Return] ${stdout} Get Vnf Id @@ -83,7 +83,7 @@ Get Vnf Id ${rc} ${stdout}= Run and Return RC and Output osm vnf-list --filter member-vnf-index-ref=${vnf_member_index} | grep ${ns_id} | awk '{print $2}' 2>&1 log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + [Return] ${stdout} Get Ns Id @@ -103,23 +103,23 @@ Get Ns Vnf List Should Not Be Empty ${ns_id} @{vnf_list_string}= Run and Return RC and Output osm vnf-list | grep ${ns_id} | awk '{print $2}' 2>&1 # Returns a String of vnf_id and needs to be converted into a list - @{vnf_list} = Split String ${vnf_list_string}[1] - Log List ${vnf_list} - [Return] @{vnf_list} + @{vnf_list} = Split String ${vnf_list_string}[1] + Log List ${vnf_list} + [Return] @{vnf_list} Get Ns Ip List [Arguments] @{vnf_list} should not be empty @{vnf_list} - @{temp_list}= Create List + @{temp_list}= Create List FOR ${vnf_id} IN @{vnf_list} log ${vnf_id} @{vnf_ip_list} Get Vnf Ip List ${vnf_id} - @{temp_list}= Combine Lists ${temp_list} ${vnf_ip_list} + @{temp_list}= Combine Lists ${temp_list} ${vnf_ip_list} END should not be empty ${temp_list} - [return] @{temp_list} + [return] @{temp_list} Get Vnf Ip List @@ -129,14 +129,14 @@ Get Vnf Ip List @{vnf_ip_list_string}= run and return rc and output osm vnf-list --filter id=${vnf_id} | grep -o '[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}' | sort -t: -u -k1,1 2>&1 # returns a string of ip addresses and needs to be converted into a list should not be empty ${vnf_ip_list_string}[1] - @{vnf_ip_list} = split string ${vnf_ip_list_string}[1] - log list ${vnf_ip_list} + @{vnf_ip_list} = split string ${vnf_ip_list_string}[1] + log list ${vnf_ip_list} should not be empty ${vnf_ip_list} - [return] @{vnf_ip_list} + [return] @{vnf_ip_list} Check For Ns Instance To Configured - [arguments] ${ns_name} + [arguments] ${ns_name} ${rc} ${stdout}= Run and Return RC and Output openstack server list log ${stdout} @@ -146,7 +146,7 @@ Check For Ns Instance To Configured Should Contain Any ${stdout} READY BROKEN Check For NS Instance For Failure - [Arguments] ${ns_name} + [Arguments] ${ns_name} ${rc} ${stdout}= Run and Return RC and Output openstack server list log ${stdout} @@ -156,7 +156,7 @@ Check For NS Instance For Failure Should Not Contain ${stdout} BROKEN Check For NS Instance To Be Deleted - [Arguments] ${ns} + [Arguments] ${ns} ${rc} ${stdout}= Run and Return RC and Output openstack server list log ${stdout} @@ -174,84 +174,84 @@ Delete NS Log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - WAIT UNTIL KEYWORD SUCCEEDS ${ns_delete_max_wait_time} ${ns_delete_pol_time} Check For NS Instance To Be Deleted ${ns} + WAIT UNTIL KEYWORD SUCCEEDS ${ns_delete_max_wait_time} ${ns_delete_pol_time} Check For NS Instance To Be Deleted ${ns} Execute NS Action - [Documentation] Execute an action over the desired NS. - ... Parameters are given to this function in key=value format (one argument per key/value pair). - ... Return the ID of the operation associated to the executed action. - ... Examples of execution: - ... \${ns_op_id}= Execute NS Action \${ns_name} \${ns_action} \${vnf_member_index} - ... \${ns_op_id}= Execute NS Action \${ns_name} \${ns_action} \${vnf_member_index} \${param1}=\${value1} \${param2}=\${value2} - - [Arguments] ${ns_name} ${ns_action} ${vnf_member_index} @{action_params} - - ${params}= Set Variable ${EMPTY} - FOR ${param} IN @{action_params} - ${match} ${param_name} ${param_value} = Should Match Regexp ${param} (.+)=(.+) msg=Syntax error in parameters - ${params}= Catenate SEPARATOR= ${params} "${param_name}":"${param_value}", + [Documentation] Execute an action over the desired NS. + ... Parameters are given to this function in key=value format (one argument per key/value pair). + ... Return the ID of the operation associated to the executed action. + ... Examples of execution: + ... \${ns_op_id}= Execute NS Action \${ns_name} \${ns_action} \${vnf_member_index} + ... \${ns_op_id}= Execute NS Action \${ns_name} \${ns_action} \${vnf_member_index} \${param1}=\${value1} \${param2}=\${value2} + + [Arguments] ${ns_name} ${ns_action} ${vnf_member_index} @{action_params} + + ${params}= Set Variable ${EMPTY} + FOR ${param} IN @{action_params} + ${match} ${param_name} ${param_value} = Should Match Regexp ${param} (.+)=(.+) msg=Syntax error in parameters + ${params}= Catenate SEPARATOR= ${params} "${param_name}":"${param_value}", END - ${osm_ns_action_command}= Set Variable osm ns-action --action_name ${ns_action} --vnf_name ${vnf_member_index} - ${osm_ns_action_command}= Run Keyword If '${params}'!='${EMPTY}' Catenate ${osm_ns_action_command} --params '{${params}}' - ... ELSE Set Variable ${osm_ns_action_command} - ${osm_ns_action_command}= Catenate ${osm_ns_action_command} ${ns_name} - ${rc} ${stdout}= Run and Return RC and Output ${osm_ns_action_command} - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False - Wait Until Keyword Succeeds ${ns_action_max_wait_time} ${ns_action_pol_time} Check For NS Operation Ended ${stdout} - Check For NS Operation Completed ${stdout} - [Return] ${stdout} + ${osm_ns_action_command}= Set Variable osm ns-action --action_name ${ns_action} --vnf_name ${vnf_member_index} + ${osm_ns_action_command}= Run Keyword If '${params}'!='${EMPTY}' Catenate ${osm_ns_action_command} --params '{${params}}' + ... ELSE Set Variable ${osm_ns_action_command} + ${osm_ns_action_command}= Catenate ${osm_ns_action_command} ${ns_name} + ${rc} ${stdout}= Run and Return RC and Output ${osm_ns_action_command} + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + Wait Until Keyword Succeeds ${ns_action_max_wait_time} ${ns_action_pol_time} Check For NS Operation Ended ${stdout} + Check For NS Operation Completed ${stdout} + [Return] ${stdout} Execute NS K8s Action - [Documentation] Execute an action over the desired K8s NS. - ... Parameters are given to this function in key=value format (one argument per key/value pair). - ... Return the ID of the operation associated to the executed action. - ... Examples of execution: - ... \${ns_op_id}= Execute NS Action \${ns_name} \${ns_action} \${vnf_member_index} - ... \${ns_op_id}= Execute NS Action \${ns_name} \${ns_action} \${vnf_member_index} \${param1}=\${value1} \${param2}=\${value2} - - [Arguments] ${ns_name} ${ns_action} ${vnf_member_index} ${kdu_name} @{action_params} - - ${params}= Set Variable ${EMPTY} - FOR ${param} IN @{action_params} - ${match} ${param_name} ${param_value} = Should Match Regexp ${param} (.+)=(.+) msg=Syntax error in parameters - ${params}= Catenate SEPARATOR= ${params} "${param_name}":"${param_value}", + [Documentation] Execute an action over the desired K8s NS. + ... Parameters are given to this function in key=value format (one argument per key/value pair). + ... Return the ID of the operation associated to the executed action. + ... Examples of execution: + ... \${ns_op_id}= Execute NS Action \${ns_name} \${ns_action} \${vnf_member_index} + ... \${ns_op_id}= Execute NS Action \${ns_name} \${ns_action} \${vnf_member_index} \${param1}=\${value1} \${param2}=\${value2} + + [Arguments] ${ns_name} ${ns_action} ${vnf_member_index} ${kdu_name} @{action_params} + + ${params}= Set Variable ${EMPTY} + FOR ${param} IN @{action_params} + ${match} ${param_name} ${param_value} = Should Match Regexp ${param} (.+)=(.+) msg=Syntax error in parameters + ${params}= Catenate SEPARATOR= ${params} "${param_name}":"${param_value}", END - ${osm_ns_action_command}= Set Variable osm ns-action --action_name ${ns_action} --vnf_name ${vnf_member_index} --kdu_name ${kdu_name} - ${osm_ns_action_command}= Run Keyword If '${params}'!='${EMPTY}' Catenate ${osm_ns_action_command} --params '{${params}}' - ... ELSE Set Variable ${osm_ns_action_command} - ${osm_ns_action_command}= Catenate ${osm_ns_action_command} ${ns_name} - ${rc} ${stdout}= Run and Return RC and Output ${osm_ns_action_command} - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False - Wait Until Keyword Succeeds ${ns_action_max_wait_time} ${ns_action_pol_time} Check For NS Operation Ended ${stdout} - Check For NS Operation Completed ${stdout} - [Return] ${stdout} + ${osm_ns_action_command}= Set Variable osm ns-action --action_name ${ns_action} --vnf_name ${vnf_member_index} --kdu_name ${kdu_name} + ${osm_ns_action_command}= Run Keyword If '${params}'!='${EMPTY}' Catenate ${osm_ns_action_command} --params '{${params}}' + ... ELSE Set Variable ${osm_ns_action_command} + ${osm_ns_action_command}= Catenate ${osm_ns_action_command} ${ns_name} + ${rc} ${stdout}= Run and Return RC and Output ${osm_ns_action_command} + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + Wait Until Keyword Succeeds ${ns_action_max_wait_time} ${ns_action_pol_time} Check For NS Operation Ended ${stdout} + Check For NS Operation Completed ${stdout} + [Return] ${stdout} Execute Manual VNF Scale - [Documentation] Execute a manual VNF Scale action. - ... The parameter 'scale_type' must be SCALE_IN or SCALE_OUT. - ... Return the ID of the operation associated to the executed scale action. + [Documentation] Execute a manual VNF Scale action. + ... The parameter 'scale_type' must be SCALE_IN or SCALE_OUT. + ... Return the ID of the operation associated to the executed scale action. [Arguments] ${ns_name} ${vnf_member_index} ${scaling_group} ${scale_type} ${vnf_scale_max_wait_time}=2min ${vnf_scale_max_wait_time}= Convert Time ${vnf_scale_max_wait_time} result_format=number ${vnf_scale_max_wait_time}= Evaluate ${vnf_scale_max_wait_time} * ${vim_timeout_multiplier} - Should Contain Any ${scale_type} SCALE_IN SCALE_OUT msg=Unknown scale type: ${scale_type} values=False - ${osm_vnf_scale_command}= Set Variable osm vnf-scale --scaling-group ${scaling_group} - ${osm_vnf_scale_command}= Run Keyword If '${scale_type}'=='SCALE_IN' Catenate ${osm_vnf_scale_command} --scale-in - ... ELSE Catenate ${osm_vnf_scale_command} --scale-out - ${osm_vnf_scale_command}= Catenate ${osm_vnf_scale_command} ${ns_name} ${vnf_member_index} - ${rc} ${stdout}= Run and Return RC and Output ${osm_vnf_scale_command} - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False - Wait Until Keyword Succeeds ${vnf_scale_max_wait_time} ${vnf_scale_pol_time} Check For NS Operation Ended ${stdout} - Check For NS Operation Completed ${stdout} - [Return] ${stdout} + Should Contain Any ${scale_type} SCALE_IN SCALE_OUT msg=Unknown scale type: ${scale_type} values=False + ${osm_vnf_scale_command}= Set Variable osm vnf-scale --scaling-group ${scaling_group} + ${osm_vnf_scale_command}= Run Keyword If '${scale_type}'=='SCALE_IN' Catenate ${osm_vnf_scale_command} --scale-in + ... ELSE Catenate ${osm_vnf_scale_command} --scale-out + ${osm_vnf_scale_command}= Catenate ${osm_vnf_scale_command} ${ns_name} ${vnf_member_index} + ${rc} ${stdout}= Run and Return RC and Output ${osm_vnf_scale_command} + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + Wait Until Keyword Succeeds ${vnf_scale_max_wait_time} ${vnf_scale_pol_time} Check For NS Operation Ended ${stdout} + Check For NS Operation Completed ${stdout} + [Return] ${stdout} Heal Network Service - [Documentation] Execute healing operation over one NS. - ... Return the ID of the operation associated to the executed healing action. + [Documentation] Execute healing operation over one NS. + ... Return the ID of the operation associated to the executed healing action. [Arguments] ${ns_name} ${params} ${healing_max_wait_time}=10m @@ -259,106 +259,106 @@ Heal Network Service Should Not Be Empty ${params} ${healing_max_wait_time}= Convert Time ${healing_max_wait_time} result_format=number ${healing_max_wait_time}= Evaluate ${healing_max_wait_time} * ${vim_timeout_multiplier} - ${rc} ${stdout}= Run and Return RC and Output osm ns-heal ${ns_name} ${params} - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False - Wait Until Keyword Succeeds ${healing_max_wait_time} ${healing_pol_time} Check For NS Operation Ended ${stdout} - Check For NS Operation Completed ${stdout} - [Return] ${stdout} + ${rc} ${stdout}= Run and Return RC and Output osm ns-heal ${ns_name} ${params} + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + Wait Until Keyword Succeeds ${healing_max_wait_time} ${healing_pol_time} Check For NS Operation Ended ${stdout} + Check For NS Operation Completed ${stdout} + [Return] ${stdout} Get Operations List - [Arguments] ${ns_name} + [Arguments] ${ns_name} Should Not Be Empty ${ns_name} - ${rc} ${stdout}= Run and Return RC and Output osm ns-op-list ${ns_name} - log ${stdout} - log ${rc} - Should Be Equal As Integers ${rc} ${success_return_code} + ${rc} ${stdout}= Run and Return RC and Output osm ns-op-list ${ns_name} + log ${stdout} + log ${rc} + Should Be Equal As Integers ${rc} ${success_return_code} Check For NS Operation Completed - [Documentation] Check wheter the status of the desired operation is "COMPLETED" or not. + [Documentation] Check wheter the status of the desired operation is "COMPLETED" or not. - [Arguments] ${ns_operation_id} + [Arguments] ${ns_operation_id} Should Not Be Empty ${ns_operation_id} - ${rc} ${stdout}= Run and Return RC and Output osm ns-op-show ${ns_operation_id} --literal | yq .operationState | tr -d \\" - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - Should Contain ${stdout} COMPLETED msg=The ns-action with id ${ns_operation_id} was not completed values=False + ${rc} ${stdout}= Run and Return RC and Output osm ns-op-show ${ns_operation_id} --literal | yq .operationState | tr -d \\" + log ${stdout} + Should Be Equal As Integers ${rc} ${success_return_code} + Should Contain ${stdout} COMPLETED msg=The ns-action with id ${ns_operation_id} was not completed values=False Check For NS Operation Failed - [Documentation] Check wheter the status of the desired operation is "FAILED" or not. + [Documentation] Check wheter the status of the desired operation is "FAILED" or not. - [Arguments] ${ns_operation_id} + [Arguments] ${ns_operation_id} Should Not Be Empty ${ns_operation_id} - ${rc} ${stdout}= Run and Return RC and Output osm ns-op-show ${ns_operation_id} --literal | yq .operationState | tr -d \\" - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - Should Contain ${stdout} FAILED msg=Timeout waiting for ns-action with id ${ns_operation_id} values=False + ${rc} ${stdout}= Run and Return RC and Output osm ns-op-show ${ns_operation_id} --literal | yq .operationState | tr -d \\" + log ${stdout} + Should Be Equal As Integers ${rc} ${success_return_code} + Should Contain ${stdout} FAILED msg=Timeout waiting for ns-action with id ${ns_operation_id} values=False Check For NS Operation Ended - [Documentation] Check wheter the status of the desired operation is "FAILED" or "COMPLETED". + [Documentation] Check wheter the status of the desired operation is "FAILED" or "COMPLETED". - [Arguments] ${ns_operation_id} + [Arguments] ${ns_operation_id} Should Not Be Empty ${ns_operation_id} - ${rc} ${stdout}= Run and Return RC and Output osm ns-op-show ${ns_operation_id} --literal | yq .operationState | tr -d \\" - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - Should Contain Any ${stdout} FAILED COMPLETED msg=Timeout waiting for ns-action with id ${ns_operation_id} values=False + ${rc} ${stdout}= Run and Return RC and Output osm ns-op-show ${ns_operation_id} --literal | yq .operationState | tr -d \\" + log ${stdout} + Should Be Equal As Integers ${rc} ${success_return_code} + Should Contain Any ${stdout} FAILED COMPLETED msg=Timeout waiting for ns-action with id ${ns_operation_id} values=False Get Ns Vnfr Ids - [Documentation] Return a list with the IDs of the VNF records of a NS instance. + [Documentation] Return a list with the IDs of the VNF records of a NS instance. - [Arguments] ${ns_id} + [Arguments] ${ns_id} Should Not Be Empty ${ns_id} - ${rc} ${stdout}= Run and Return RC and Output osm vnf-list | grep ${ns_id} | awk '{print $2}' 2>&1 - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False - @{vdur} = Split String ${stdout} - [Return] @{vdur} + ${rc} ${stdout}= Run and Return RC and Output osm vnf-list | grep ${ns_id} | awk '{print $2}' 2>&1 + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + @{vdur} = Split String ${stdout} + [Return] @{vdur} Get Vnf Vdur Names - [Documentation] Return a list with the names of the VDU records of a VNF instance. + [Documentation] Return a list with the names of the VDU records of a VNF instance. - [Arguments] ${vnf_id} + [Arguments] ${vnf_id} Should Not Be Empty ${vnf_id} - ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq .vdur[].name | tr -d \\" - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False - @{vdur} = Split String ${stdout} - [Return] @{vdur} + ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq .vdur[].name | tr -d \\" + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + @{vdur} = Split String ${stdout} + [Return] @{vdur} Get Vnf Kdu Replica Count - [Documentation] Return the number of KDU replicas (empty if none) of a VNF instance. + [Documentation] Return the number of KDU replicas (empty if none) of a VNF instance. [Arguments] ${vnf_id} ${kdu_name} Should Not Be Empty ${vnf_id} Should Not Be Empty ${kdu_name} - ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --kdu ${kdu_name} | yq .config.replicaCount | tr -d \\" - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False - ${return} = Set Variable If '${stdout}' == 'null' ${EMPTY} ${stdout} - [Return] ${return} + ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --kdu ${kdu_name} | yq .config.replicaCount | tr -d \\" + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + ${return} = Set Variable If '${stdout}' == 'null' ${EMPTY} ${stdout} + [Return] ${return} Get Application Names - [Documentation] Return the list of the application of a VNF instance. + [Documentation] Return the list of the application of a VNF instance. [Arguments] ${ns_name} Should Not Be Empty ${ns_name} - ${rc} ${stdout}= Run and Return RC and Output osm ns-show ${ns_name} --literal | yq ._admin.deployed.VCA[].application | tr -d \\" - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False - @{app_names} = Split String ${stdout} - [Return] ${app_names} + ${rc} ${stdout}= Run and Return RC and Output osm ns-show ${ns_name} --literal | yq ._admin.deployed.VCA[].application | tr -d \\" + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + @{app_names} = Split String ${stdout} + [Return] ${app_names} Get VDU Affinity Group Name @@ -377,7 +377,7 @@ Get VDU Affinity Group Name Get Operations By Type [Documentation] Keyword to get the operation by type - [Arguments] ${ns_id} ${type} + [Arguments] ${ns_id} ${type} Should Not Be Empty ${ns_id} Should Not Be Empty ${type} diff --git a/robot-systest/lib/nsd_lib.robot b/robot-systest/lib/nsd_lib.robot index 884ba6d..cb84d72 100644 --- a/robot-systest/lib/nsd_lib.robot +++ b/robot-systest/lib/nsd_lib.robot @@ -45,10 +45,10 @@ Create NSD ${rc} ${stdout}= Run and Return RC and Output osm nspkg-create ${nsd_pkg} log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - ${lines}= Get Line Count ${stdout} - ${last}= Evaluate ${lines} - 1 - ${id}= Get Line ${stdout} ${last} - [Return] ${id} + ${lines}= Get Line Count ${stdout} + ${last}= Evaluate ${lines} - 1 + ${id}= Get Line ${stdout} ${last} + [Return] ${id} Delete NSD diff --git a/robot-systest/lib/nsi_lib.robot b/robot-systest/lib/nsi_lib.robot index 005d536..5bdd17b 100644 --- a/robot-systest/lib/nsi_lib.robot +++ b/robot-systest/lib/nsi_lib.robot @@ -13,7 +13,7 @@ # limitations under the License. *** Settings *** -Library Collections +Library Collections *** Variables *** @@ -49,7 +49,7 @@ Create Network Slice WAIT UNTIL KEYWORD SUCCEEDS ${slice_launch_max_wait_time} ${slice_launch_pol_time} Check For Network Slice Instance To Configured ${slice_name} Check For Network Slice Instance For Failure ${slice_name} - [Return] ${nsi_id} + [Return] ${nsi_id} Instantiate Network Slice @@ -67,7 +67,7 @@ Instantiate Network Slice ${rc} ${stdout}= Run and Return RC and Output osm nsi-create --nsi_name ${slice_name} --nst_name ${nst} --vim_account ${vim_name} ${sshkeys_attr} ${slice_extra_args} log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + [Return] ${stdout} Get Slice Ns List @@ -82,9 +82,9 @@ Get Slice Ns List Should Not Be Empty ${slice_name} @{ns_list_string}= Run and Return RC and Output osm ns-list | grep ${slice_name} | awk '{print $4}' 2>&1 # Returns a String of ns_id and needs to be converted into a list - @{ns_list} = Split String ${ns_list_string}[1] - Log List ${ns_list} - [Return] @{ns_list} + @{ns_list} = Split String ${ns_list_string}[1] + Log List ${ns_list} + [Return] @{ns_list} Get Slice Ns List Except One @@ -102,9 +102,9 @@ Get Slice Ns List Except One @{ns_list_string}= Run and Return RC and Output osm ns-list | grep ${slice_name} | awk '!/${exception_ns}/' | awk '{print $4}' 2>&1 # Returns a String of ns_id and needs to be converted into a list - @{ns_list} = Split String ${ns_list_string}[1] - Log List ${ns_list} - [Return] @{ns_list} + @{ns_list} = Split String ${ns_list_string}[1] + Log List ${ns_list} + [Return] @{ns_list} Get Slice Ns Count @@ -120,7 +120,7 @@ Get Slice Ns Count ${rc} ${stdout}= Run and Return RC and Output osm ns-list | grep ${slice_name} | wc -l 2>&1 log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + [Return] ${stdout} Get Slice Vnf Ip Addresses @@ -133,16 +133,16 @@ Get Slice Vnf Ip Addresses [Arguments] ${slice_name} # Get all the ns_id in the slice - @{slice_ns_list} Get Slice Ns List ${slice_name} + @{slice_ns_list} Get Slice Ns List ${slice_name} log many @{slice_ns_list} - @{temp_list}= Create List + @{temp_list}= Create List # For each ns_id in the list, get all the vnf_id and their IP addresses FOR ${ns_id} IN @{slice_ns_list} log ${ns_id} @{vnf_id_list} Get Ns Vnf List ${ns_id} # For each vnf_id in the list, get all its IP addresses @{ns_ip_list} Get Ns Ip List @{vnf_id_list} - @{temp_list}= Combine Lists ${temp_list} ${ns_ip_list} + @{temp_list}= Combine Lists ${temp_list} ${ns_ip_list} END Log List ${temp_list} [Return] @{temp_list} @@ -155,7 +155,7 @@ Check For Network Slice Instance To Configured ... Execution example: ... Check For Network Slice Instance To Configured \${slice_name} - [Arguments] ${slice_name} + [Arguments] ${slice_name} ${rc} ${stdout}= Run and Return RC and Output osm nsi-list --filter name="${slice_name}" log ${stdout} @@ -170,7 +170,7 @@ Check For Network Slice Instance For Failure ... Execution example: ... Check For Network Slice Instance For Failure \${slice_name} - [Arguments] ${slice_name} + [Arguments] ${slice_name} ${rc} ${stdout}= Run and Return RC and Output osm nsi-list --filter name="${slice_name}" log ${stdout} @@ -186,7 +186,7 @@ Delete NSI ... Execution example: ... Delete NST \${slice_name} - [Arguments] ${slice_name} ${slice_delete_max_wait_time}=4min + [Arguments] ${slice_name} ${slice_delete_max_wait_time}=4min ${rc} ${stdout}= Run and Return RC and Output osm nsi-delete ${slice_name} log ${stdout} @@ -194,7 +194,7 @@ Delete NSI ${slice_delete_max_wait_time}= Convert Time ${slice_delete_max_wait_time} result_format=number ${slice_delete_max_wait_time}= Evaluate ${slice_delete_max_wait_time} * ${vim_timeout_multiplier} - WAIT UNTIL KEYWORD SUCCEEDS ${slice_delete_max_wait_time} ${slice_delete_pol_time} Check For Network Slice Instance To Be Deleted ${slice_name} + WAIT UNTIL KEYWORD SUCCEEDS ${slice_delete_max_wait_time} ${slice_delete_pol_time} Check For Network Slice Instance To Be Deleted ${slice_name} Check For Network Slice Instance To Be Deleted @@ -204,7 +204,7 @@ Check For Network Slice Instance To Be Deleted ... Execution example: ... Check For Network Slice Instance \${slice_name} - [Arguments] ${slice_name} + [Arguments] ${slice_name} ${rc} ${stdout}= Run and Return RC and Output osm nsi-list | awk '{print $2}' | grep ${slice_name} Should Not Be Equal As Strings ${stdout} ${slice_name} diff --git a/robot-systest/lib/nst_lib.robot b/robot-systest/lib/nst_lib.robot index 60d874a..c775bf9 100644 --- a/robot-systest/lib/nst_lib.robot +++ b/robot-systest/lib/nst_lib.robot @@ -33,7 +33,7 @@ Create NST ${rc} ${stdout}= Run and Return RC and Output osm netslice-template-create ${nst} log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + [Return] ${stdout} Delete NST diff --git a/robot-systest/lib/openstack_lib.robot b/robot-systest/lib/openstack_lib.robot index c335963..ff02b29 100644 --- a/robot-systest/lib/openstack_lib.robot +++ b/robot-systest/lib/openstack_lib.robot @@ -22,7 +22,7 @@ Get Server Flavor ID ${rc} ${stdout}= Run and Return RC and Output openstack server show ${server_id} | grep flavor | awk 'NR>1{print $1}' RS='(' FS=')' log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + [Return] ${stdout} Get Flavor Properties @@ -32,43 +32,43 @@ Get Flavor Properties ${rc} ${stdout}= Run and Return RC and Output openstack flavor show ${flavor_id} | grep properties | awk -F '|' '{print $3}' log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + [Return] ${stdout} Check NS Servers In VIM - [Documentation] Check if the number of servers in Openstack by filtering by NS name is as expected. + [Documentation] Check if the number of servers in Openstack by filtering by NS name is as expected. [Arguments] ${ns_name} ${number} Should Not Be Empty ${ns_name} ${rc} ${stdout}= Run and Return RC and Output openstack server list | grep ${ns_name} | awk '{print $4}' log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - @{servers} = Split String ${stdout} - ${n_servers}= Get Length ${servers} + @{servers} = Split String ${stdout} + ${n_servers}= Get Length ${servers} Should Be Equal As Integers ${number} ${n_servers} Get Project Quota - [Documentation] Get a field (ram, cores, ports, etc.) from quota in current project. + [Documentation] Get a field (ram, cores, ports, etc.) from quota in current project. [Arguments] ${field} Should Not Be Empty ${field} ${rc} ${stdout}= Run and Return RC and Output openstack quota show -c ${field} -f value log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + [Return] ${stdout} Get Server Property - [Documentation] Get a field (flavor, image, volumes_attached, etc.) from a server. - [Arguments] ${server_id} ${field} + [Documentation] Get a field (flavor, image, volumes_attached, etc.) from a server. + [Arguments] ${server_id} ${field} Should Not Be Empty ${server_id} Should Not Be Empty ${field} ${rc} ${stdout}= Run and Return RC and Output openstack server show ${server_id} -c ${field} -f value log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + [Return] ${stdout} Check VM In Server Group @@ -84,43 +84,43 @@ Check VM In Server Group Check If Volume Exists - [Documentation] Checks if a volume id exists - [Arguments] ${volume_id} + [Documentation] Checks if a volume id exists + [Arguments] ${volume_id} Should Not Be Empty ${volume_id} ${rc} ${stdout}= Run and Return RC and Output openstack volume list | grep ${volume_id} | wc -l log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + [Return] ${stdout} Delete Volume - [Documentation] Delete a volume by its identifier - [Arguments] ${volume_id} + [Documentation] Delete a volume by its identifier + [Arguments] ${volume_id} Should Not Be Empty ${volume_id} ${rc} ${stdout}= Run and Return RC and Output openstack volume delete ${volume_id} log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + [Return] ${stdout} Stop Server - [Documentation] Stop a server - [Arguments] ${server_id} + [Documentation] Stop a server + [Arguments] ${server_id} Should Not Be Empty ${server_id} ${rc} ${stdout}= Run and Return RC and Output openstack server stop ${server_id} log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + [Return] ${stdout} Halt Server - [Documentation] Reset a server - [Arguments] ${server_id} + [Documentation] Reset a server + [Arguments] ${server_id} Should Not Be Empty ${server_id} ${rc} ${stdout}= Run and Return RC and Output openstack server set --state error ${server_id} log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + [Return] ${stdout} diff --git a/robot-systest/lib/package_lib.robot b/robot-systest/lib/package_lib.robot index 7b3cad2..dd6be27 100644 --- a/robot-systest/lib/package_lib.robot +++ b/robot-systest/lib/package_lib.robot @@ -45,7 +45,7 @@ Upload Package ${rc} ${stdout}= Run and Return RC and Output osm upload-package ${pkg}.tar.gz log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + [Return] ${stdout} Delete Package diff --git a/robot-systest/lib/packages_lib.robot b/robot-systest/lib/packages_lib.robot index e37a590..c53cc4d 100644 --- a/robot-systest/lib/packages_lib.robot +++ b/robot-systest/lib/packages_lib.robot @@ -31,9 +31,9 @@ Package Build ${rc} ${stdout}= Run and Return RC and Output osm package-build ${pkg_folder} ${skip_charm} Should Be Equal As Integers ${rc} ${success_return_code} Should Contain ${stdout} Package created - ${package}= Get Line ${stdout} -1 + ${package}= Get Line ${stdout} -1 - [Return] ${package} + [Return] ${package} Package Validate [Documentation] Validate descriptors given a base directory @@ -42,7 +42,7 @@ Package Validate ${rc} ${stdout}= Run and Return RC and Output osm package-validate ${pkg_folder} | awk -F\| '$2 !~ /-/ && $4 ~ /OK|ERROR/ {print $4}' Should Be Equal As Integers ${rc} ${success_return_code} Should Contain ${stdout} 'OK' - ${package}= Get Line ${stdout} -1 + ${package}= Get Line ${stdout} -1 - [Return] ${package} + [Return] ${package} diff --git a/robot-systest/lib/project_lib.robot b/robot-systest/lib/project_lib.robot index ae4f5cc..f44ddac 100644 --- a/robot-systest/lib/project_lib.robot +++ b/robot-systest/lib/project_lib.robot @@ -22,7 +22,7 @@ Create Project ${rc} ${stdout}= Run and Return RC and Output osm project-create ${project_name} Log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + [Return] ${stdout} Create Project With Quotas @@ -33,7 +33,7 @@ Create Project With Quotas ${rc} ${stdout}= Run and Return RC and Output osm project-create ${project_name} --quotas ${project_quotas} Log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + [Return] ${stdout} Get Project Quotas @@ -44,7 +44,7 @@ Get Project Quotas ${rc} ${stdout}= Run and Return RC and Output osm project-show ${project_name} | grep '${quotas_name}' | awk -F ',|: ' '{print $2}' | awk '{print $1}' Log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + [Return] ${stdout} Update Project Quotas @@ -68,7 +68,7 @@ Update Project Name Check If User Is Assigned To Project - [Arguments] ${user_name} ${project_name} + [Arguments] ${user_name} ${project_name} Should Not Be Empty ${user_name} Should Not Be Empty ${project_name} @@ -78,7 +78,7 @@ Check If User Is Assigned To Project Create VNFD In Project - [Documentation] Onboards a VNFD package into an OSM project. + [Documentation] Onboards a VNFD package into an OSM project. ... Extra parameters (such as 'override') are given to this function in name=value format. These parameters will be appended to the 'osm vnfpkg-create' command with the next syntax: --param_name=param_value [Arguments] ${project_name} ${vnfd_pkg} ${project_user} ${user_password} @{optional_parameters} @@ -88,16 +88,16 @@ Create VNFD In Project Should Not Be Empty ${project_user} Should Not Be Empty ${user_password} - ${osm_pkg_create_command}= Set Variable osm --project ${project_name} --user ${project_user} --password ${user_password} vnfpkg-create ${vnfd_pkg} - FOR ${param} IN @{optional_parameters} - ${match} ${param_name} ${param_value} = Should Match Regexp ${param} (.+)=(.+) msg=Syntax error in optional parameters - ${osm_pkg_create_command}= Catenate ${osm_pkg_create_command} --${param_name}=${param_value} + ${osm_pkg_create_command}= Set Variable osm --project ${project_name} --user ${project_user} --password ${user_password} vnfpkg-create ${vnfd_pkg} + FOR ${param} IN @{optional_parameters} + ${match} ${param_name} ${param_value} = Should Match Regexp ${param} (.+)=(.+) msg=Syntax error in optional parameters + ${osm_pkg_create_command}= Catenate ${osm_pkg_create_command} --${param_name}=${param_value} END ${rc} ${stdout}= Run and Return RC and Output ${osm_pkg_create_command} Log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + [Return] ${stdout} Delete VNFD In Project @@ -113,7 +113,7 @@ Delete VNFD In Project Remove User From Project - [Arguments] ${user_name} ${project_name} + [Arguments] ${user_name} ${project_name} Should Not Be Empty ${user_name} Should Not Be Empty ${project_name} @@ -123,7 +123,7 @@ Remove User From Project Delete Project - [Arguments] ${project_name} + [Arguments] ${project_name} ${rc} ${stdout}= Run and Return RC and Output osm project-delete ${project_name} Log ${stdout} diff --git a/robot-systest/lib/prometheus_lib.robot b/robot-systest/lib/prometheus_lib.robot index e133c2a..c76b560 100644 --- a/robot-systest/lib/prometheus_lib.robot +++ b/robot-systest/lib/prometheus_lib.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation Library to obtain metrics from Prometheus. +Documentation Library to obtain metrics from Prometheus. Library String Library Collections @@ -19,42 +19,42 @@ Library RequestsLibrary *** Variables *** -${timeout} 30 -${max_retries} 1 +${timeout} 30 +${max_retries} 1 *** Keywords *** Get Metric - [Documentation] Get the instant value of a metric from Prometheus using multiple filter parameters. + [Documentation] Get the instant value of a metric from Prometheus using multiple filter parameters. ... The filter parameters are given to this function in key=value format (one argument per key/value pair). ... Fails if the metric is not found or has multiple values. ... Examples of execution: - ... \${metric}= Get Metric \${prometheus_ip} \${prometheus_port} \${metric} - ... \${metric}= Get Metric \${prometheus_ip} \${prometheus_port} \${metric} \${param1}=\${value1} \${param2}=\${value2} + ... \${metric}= Get Metric \${prometheus_ip} \${prometheus_port} \${metric} + ... \${metric}= Get Metric \${prometheus_ip} \${prometheus_port} \${metric} \${param1}=\${value1} \${param2}=\${value2} - [Arguments] ${prometheus_ip} ${prometheus_port} ${metric} @{filter_parameters} + [Arguments] ${prometheus_ip} ${prometheus_port} ${metric} @{filter_parameters} - ${filter}= Set Variable ${EMPTY} - FOR ${param} IN @{filter_parameters} - ${match} ${param_name} ${param_value} = Should Match Regexp ${param} (.+)=(.+) msg=Syntax error in filter parameters - ${filter}= Catenate SEPARATOR= ${filter} ${param_name}="${param_value}", + ${filter}= Set Variable ${EMPTY} + FOR ${param} IN @{filter_parameters} + ${match} ${param_name} ${param_value} = Should Match Regexp ${param} (.+)=(.+) msg=Syntax error in filter parameters + ${filter}= Catenate SEPARATOR= ${filter} ${param_name}="${param_value}", END - ${resp}= Execute Prometheus Instant Query ${prometheus_host} ${prometheus_port} query=${metric}{${filter}} - ${result_list}= Convert To List ${resp["data"]["result"]} - ${results}= Get Length ${result_list} - Should Not Be Equal As Numbers 0 ${results} msg=Metric ${metric} not found values=false - Should Be Equal As Integers 1 ${results} msg=Metric ${metric} with multiple values values=false - [Return] ${result_list[0]["value"][1]} + ${resp}= Execute Prometheus Instant Query ${prometheus_host} ${prometheus_port} query=${metric}{${filter}} + ${result_list}= Convert To List ${resp["data"]["result"]} + ${results}= Get Length ${result_list} + Should Not Be Equal As Numbers 0 ${results} msg=Metric ${metric} not found values=false + Should Be Equal As Integers 1 ${results} msg=Metric ${metric} with multiple values values=false + [Return] ${result_list[0]["value"][1]} Execute Prometheus Instant Query - [Documentation] Execute a Prometheus Instant Query using HTTP API. + [Documentation] Execute a Prometheus Instant Query using HTTP API. ... Return an inline json with the result of the query. ... The requested URL is the next: http://\${prometheus_ip}:\${prometheus_port}/api/v1/query?\${querystring} - [Arguments] ${prometheus_ip} ${prometheus_port} ${querystring} + [Arguments] ${prometheus_ip} ${prometheus_port} ${querystring} - Create Session prometheus http://${prometheus_ip}:${prometheus_port} timeout=${timeout} max_retries=${max_retries} - ${resp}= GET On Session prometheus /api/v1/query?${querystring} timeout=${timeout} - Status Should Be 200 ${resp} - [Return] ${resp.json()} + Create Session prometheus http://${prometheus_ip}:${prometheus_port} timeout=${timeout} max_retries=${max_retries} + ${resp}= GET On Session prometheus /api/v1/query?${querystring} timeout=${timeout} + Status Should Be 200 ${resp} + [Return] ${resp.json()} diff --git a/robot-systest/lib/role_lib.robot b/robot-systest/lib/role_lib.robot index 8f873fa..e3241a6 100644 --- a/robot-systest/lib/role_lib.robot +++ b/robot-systest/lib/role_lib.robot @@ -22,29 +22,29 @@ Create Role ${rc} ${stdout}= Run and Return RC and Output osm role-create ${role_name} Log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + [Return] ${stdout} Update Role - [Documentation] Updates a role in OSM. + [Documentation] Updates a role in OSM. ... The extra parameters (like '--add') are given to this function in name=value format. These parameters will be appended to the 'osm role-update' command with the next syntax: --param_name=param_value ... Example of execution: - ... Update Role \${role_name} add='vims: true' + ... Update Role \${role_name} add='vims: true' - [Arguments] ${role_name} @{optional_parameters} + [Arguments] ${role_name} @{optional_parameters} - ${osm_update_command}= Set Variable osm role-update ${role_name} - FOR ${param} IN @{optional_parameters} - ${match} ${param_name} ${param_value} = Should Match Regexp ${param} (.+)=(.+) msg=Syntax error in optional parameters - ${osm_update_command}= Catenate ${osm_update_command} --${param_name}=${param_value} + ${osm_update_command}= Set Variable osm role-update ${role_name} + FOR ${param} IN @{optional_parameters} + ${match} ${param_name} ${param_value} = Should Match Regexp ${param} (.+)=(.+) msg=Syntax error in optional parameters + ${osm_update_command}= Catenate ${osm_update_command} --${param_name}=${param_value} END - ${rc} ${stdout}= Run and Return RC and Output ${osm_update_command} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} + ${rc} ${stdout}= Run and Return RC and Output ${osm_update_command} + log ${stdout} + Should Be Equal As Integers ${rc} ${success_return_code} Check If Role Exists - [Arguments] ${role_name} + [Arguments] ${role_name} Should Not Be Empty ${role_name} ${rc} ${stdout}= Run And Return RC And Output osm role-list | awk 'NR>3 {print $2}' | grep "${role_name}" @@ -53,7 +53,7 @@ Check If Role Exists Check If User Has Role - [Arguments] ${user_name} ${role_name} ${project_name} + [Arguments] ${user_name} ${role_name} ${project_name} Should Not Be Empty ${user_name} Should Not Be Empty ${role_name} @@ -64,7 +64,7 @@ Check If User Has Role Delete Role - [Arguments] ${role_name} + [Arguments] ${role_name} ${rc} ${stdout}= Run and Return RC and Output osm role-delete ${role_name} Log ${stdout} diff --git a/robot-systest/lib/sdnc_lib.robot b/robot-systest/lib/sdnc_lib.robot index 6c16b43..0b4508b 100644 --- a/robot-systest/lib/sdnc_lib.robot +++ b/robot-systest/lib/sdnc_lib.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation Library to manage SDNCs. +Documentation Library to manage SDNCs. Library String Library Collections @@ -30,72 +30,72 @@ ${sdnc_status_pol_time} 1min *** Keywords *** Create SDNC - [Documentation] Creates an SDNC in OSM. + [Documentation] Creates an SDNC in OSM. ... The optional parameters (such as 'switch_dpid' or 'ip-address') are given to this function in name=value format. These parameters will be appended to the 'osm sdnc-create' command with the next syntax: --param_name=param_value ... Returns the ID of the created SDNC Target. ... Example of execution: - ... \${sdnc_id}= Create SDNC \${sdnc_name} \${sdnc_user} \${sdnc_password} \${sdnc_url} \${sdnc_type} switch_dpid='{...}' + ... \${sdnc_id}= Create SDNC \${sdnc_name} \${sdnc_user} \${sdnc_password} \${sdnc_url} \${sdnc_type} switch_dpid='{...}' - [Arguments] ${sdnc_name} ${sdnc_user} ${sdnc_password} ${sdnc_url} ${sdnc_type} @{optional_parameters} + [Arguments] ${sdnc_name} ${sdnc_user} ${sdnc_password} ${sdnc_url} ${sdnc_type} @{optional_parameters} - ${osm_sdnc_create_command}= Set Variable osm sdnc-create --name ${sdnc_name} --user ${sdnc_user} --password ${sdnc_password} --url ${sdnc_url} --type ${sdnc_type} - FOR ${param} IN @{optional_parameters} - ${match} ${param_name} ${param_value} = Should Match Regexp ${param} (.+)=(.+) msg=Syntax error in optional parameters - ${osm_sdnc_create_command}= Catenate ${osm_sdnc_create_command} --${param_name}=${param_value} + ${osm_sdnc_create_command}= Set Variable osm sdnc-create --name ${sdnc_name} --user ${sdnc_user} --password ${sdnc_password} --url ${sdnc_url} --type ${sdnc_type} + FOR ${param} IN @{optional_parameters} + ${match} ${param_name} ${param_value} = Should Match Regexp ${param} (.+)=(.+) msg=Syntax error in optional parameters + ${osm_sdnc_create_command}= Catenate ${osm_sdnc_create_command} --${param_name}=${param_value} END - ${rc} ${stdout}= Run and Return RC and Output ${osm_sdnc_create_command} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + ${rc} ${stdout}= Run and Return RC and Output ${osm_sdnc_create_command} + log ${stdout} + Should Be Equal As Integers ${rc} ${success_return_code} + [Return] ${stdout} Check for SDNC To Be Deleted - [Arguments] ${sdnc_name} + [Arguments] ${sdnc_name} - ${rc} ${stdout}= Run and Return RC and Output osm sdnc-list | awk '{print $2}' | grep ${sdnc_name} + ${rc} ${stdout}= Run and Return RC and Output osm sdnc-list | awk '{print $2}' | grep ${sdnc_name} Should Not Be Equal As Strings ${stdout} ${sdnc_name} Delete SDNC [Arguments] ${sdnc_name} - ${rc} ${stdout}= Run Keyword And Continue On Failure Run and Return RC and Output osm sdnc-delete ${sdnc_name} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False - Wait Until Keyword Succeeds ${delete_max_wait_time} ${delete_pol_time} Check for SDNC To Be Deleted ${sdnc_name} + ${rc} ${stdout}= Run Keyword And Continue On Failure Run and Return RC and Output osm sdnc-delete ${sdnc_name} + log ${stdout} + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + Wait Until Keyword Succeeds ${delete_max_wait_time} ${delete_pol_time} Check for SDNC To Be Deleted ${sdnc_name} Get SDNC List - ${rc} ${stdout}= Run and Return RC and Output osm sdnc-list - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} + ${rc} ${stdout}= Run and Return RC and Output osm sdnc-list + log ${stdout} + Should Be Equal As Integers ${rc} ${success_return_code} Check for SDNC - [Arguments] ${sdnc_id} + [Arguments] ${sdnc_id} - ${rc} ${stdout}= Run and Return RC and Output osm sdnc-show ${sdnc_id} | grep -io ENABLED - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} + ${rc} ${stdout}= Run and Return RC and Output osm sdnc-show ${sdnc_id} | grep -io ENABLED + log ${stdout} + Should Be Equal As Integers ${rc} ${success_return_code} Check for SDNC Status - [Arguments] ${sdnc_id} ${prometheus_host} ${prometheus_port} + [Arguments] ${sdnc_id} ${prometheus_host} ${prometheus_port} - Wait Until Keyword Succeeds ${sdnc_status_max_wait_time} ${sdnc_status_pol_time} Check If SDNC Is Available ${sdnc_id} ${prometheus_host} ${prometheus_port} + Wait Until Keyword Succeeds ${sdnc_status_max_wait_time} ${sdnc_status_pol_time} Check If SDNC Is Available ${sdnc_id} ${prometheus_host} ${prometheus_port} Get SDNC ID - [Arguments] ${sdnc_name} + [Arguments] ${sdnc_name} - ${rc} ${stdout}= Run and Return RC and Output osm sdnc-list | grep " ${sdnc_name} " | awk '{print $4}' - Should Be Equal As Integers ${rc} ${success_return_code} - Should Not Be Equal As Strings ${stdout} ${EMPTY} msg=SDNC '${sdnc_name}' not found values=false - [Return] ${stdout} + ${rc} ${stdout}= Run and Return RC and Output osm sdnc-list | grep " ${sdnc_name} " | awk '{print $4}' + Should Be Equal As Integers ${rc} ${success_return_code} + Should Not Be Equal As Strings ${stdout} ${EMPTY} msg=SDNC '${sdnc_name}' not found values=false + [Return] ${stdout} Check If SDNC Is Available - [Arguments] ${sdnc_id} ${prometheus_host} ${prometheus_port} + [Arguments] ${sdnc_id} ${prometheus_host} ${prometheus_port} - ${metric}= Get Metric ${prometheus_host} ${prometheus_port} osm_sdnc_status sdnc_id=${sdnc_id} - Should Be Equal As Integers ${metric} 1 msg=SDNC '${sdnc_id}' is not active values=false + ${metric}= Get Metric ${prometheus_host} ${prometheus_port} osm_sdnc_status sdnc_id=${sdnc_id} + Should Be Equal As Integers ${metric} 1 msg=SDNC '${sdnc_id}' is not active values=false diff --git a/robot-systest/lib/sol003_common_lib.robot b/robot-systest/lib/sol003_common_lib.robot index c0e7323..6617e91 100644 --- a/robot-systest/lib/sol003_common_lib.robot +++ b/robot-systest/lib/sol003_common_lib.robot @@ -11,92 +11,92 @@ # limitations under the License *** Settings *** -Documentation Library with sol003 keywords and variables . +Documentation Library with sol003 keywords and variables . -Library RequestsLibrary -Library JsonValidator -Library yaml -Library JSONLibrary -Library String -Library OperatingSystem -Resource %{ROBOT_DEVOPS_FOLDER}/lib/vim_lib.robot +Library RequestsLibrary +Library JsonValidator +Library yaml +Library JSONLibrary +Library String +Library OperatingSystem +Resource %{ROBOT_DEVOPS_FOLDER}/lib/vim_lib.robot *** Variables *** -@{success_status_code_list} 200 201 202 204 -${descriptor_content_type_gzip} application/gzip -${auth_token_uri} /osm/admin/v1/tokens -${HOST} ${EMPTY} -${vnf_instance_uri} /osm/vnflcm/v1/vnf_instances -${vnf_instantiate_uri} /osm/vnflcm/v1/vnf_instances -${vnf_instance_lcm_ops} /osm/vnflcm/v1/vnf_lcm_op_occs +@{success_status_code_list} 200 201 202 204 +${descriptor_content_type_gzip} application/gzip +${auth_token_uri} /osm/admin/v1/tokens +${HOST} ${EMPTY} +${vnf_instance_uri} /osm/vnflcm/v1/vnf_instances +${vnf_instantiate_uri} /osm/vnflcm/v1/vnf_instances +${vnf_instance_lcm_ops} /osm/vnflcm/v1/vnf_lcm_op_occs *** Keywords *** Get Auth Token - [Tags] auth_token + [Tags] auth_token Get Hostname - Create Session osmhit ${HOST} + Create Session osmhit ${HOST} &{headers} Create Dictionary Content-Type=application/json Accept=application/json - &{data} Create Dictionary username=admin password=admin project-id=admin - ${resp}= Post On Session osmhit ${auth_token_uri} json=${data} headers=${headers} - log ${resp} - Pass Execution If ${resp.status_code} in ${success_status_code_list} Get Auth Token completed - Set Suite Variable ${token_status_code} ${resp.status_code} - ${access_token}= Get Value From Json ${resp.json()} $..id - Set Test Variable ${access_token} ${access_token[0]} - Set Test Variable ${token_response} ${resp} - sleep 2s + &{data} Create Dictionary username=admin password=admin project-id=admin + ${resp}= Post On Session osmhit ${auth_token_uri} json=${data} headers=${headers} + log ${resp} + Pass Execution If ${resp.status_code} in ${success_status_code_list} Get Auth Token completed + Set Suite Variable ${token_status_code} ${resp.status_code} + ${access_token}= Get Value From Json ${resp.json()} $..id + Set Test Variable ${access_token} ${access_token[0]} + Set Test Variable ${token_response} ${resp} + sleep 2s Set Dockerized Host - [Arguments] ${env_host} - Set Suite Variable ${HOST} https://${env_host} + [Arguments] ${env_host} + Set Suite Variable ${HOST} https://${env_host} Set Standalone Host - [Arguments] ${env_host} - Set Suite Variable ${HOST} https://${env_host}:9999 + [Arguments] ${env_host} + Set Suite Variable ${HOST} https://${env_host}:9999 Read Directory - [Documentation] To Read Current Direct ory - ${Directory}= Replace String ${CURDIR} lib resources/ - ${json_path}= Set Variable ${Directory} - [Return] ${JsonPath} + [Documentation] To Read Current Direct ory + ${Directory}= Replace String ${CURDIR} lib resources/ + ${json_path}= Set Variable ${Directory} + [Return] ${JsonPath} Post Api Request [Arguments] ${PostApi} - [Documentation] Keword to Post API Request - Create Session APISession ${HOST} - &{headers} Create Dictionary Content-Type=application/json Accept=application/json Authorization=Bearer ${access_token} - ${request_response}= Post On Session APISession ${PostApi} json=${updated_json_obj} headers=${headers} - Set Suite Variable ${request_response} - ${response_statuscode} Convert To String ${request_response.status_code} - Set Suite Variable ${response_statuscode} + [Documentation] Keword to Post API Request + Create Session APISession ${HOST} + &{headers} Create Dictionary Content-Type=application/json Accept=application/json Authorization=Bearer ${access_token} + ${request_response}= Post On Session APISession ${PostApi} json=${updated_json_obj} headers=${headers} + Set Suite Variable ${request_response} + ${response_statuscode} Convert To String ${request_response.status_code} + Set Suite Variable ${response_statuscode} Get HostName - [Documentation] Keyword to get the default osm Hostname - ${nbi_host}= Get Environment Variable OSM_HOSTNAME - ${passed}= Run Keyword And Return Status Should Contain ${nbi_host} : - Run Keyword If ${passed} Set Dockerized Host ${nbi_host} - ... ELSE Set Standalone Host ${nbi_host} + [Documentation] Keyword to get the default osm Hostname + ${nbi_host}= Get Environment Variable OSM_HOSTNAME + ${passed}= Run Keyword And Return Status Should Contain ${nbi_host} : + Run Keyword If ${passed} Set Dockerized Host ${nbi_host} + ... ELSE Set Standalone Host ${nbi_host} Get ID - [Arguments] ${Key} - Pass Execution If ${request_response.status_code} in ${success_status_code_list} Get Auth Token completed - ${id}= Get Value From Json ${request_response.json()} $..${Key} - Set Suite Variable ${value} ${id[0]} - [Return] ${value} + [Arguments] ${Key} + Pass Execution If ${request_response.status_code} in ${success_status_code_list} Get Auth Token completed + ${id}= Get Value From Json ${request_response.json()} $..${Key} + Set Suite Variable ${value} ${id[0]} + [Return] ${value} Update Json Value - [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} - Set Suite Variable ${updated_json_obj} + [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} + Set Suite Variable ${updated_json_obj} Get Api Request - [Arguments] ${uri} - [Documentation] Keyword to Get API Request - Create Session Session ${HOST} - &{headers} Create Dictionary Content-Type=application/json Accept=application/json Authorization=Bearer ${access_token} - ${request_response}= Get On Session Session ${uri} headers=${Headers} - Set Suite Variable ${request_response} - ${response_statuscode} Convert To String ${request_response.status_code} - Set Suite Variable ${response_statuscode} + [Arguments] ${uri} + [Documentation] Keyword to Get API Request + Create Session Session ${HOST} + &{headers} Create Dictionary Content-Type=application/json Accept=application/json Authorization=Bearer ${access_token} + ${request_response}= Get On Session Session ${uri} headers=${Headers} + Set Suite Variable ${request_response} + ${response_statuscode} Convert To String ${request_response.status_code} + Set Suite Variable ${response_statuscode} diff --git a/robot-systest/lib/ssh_lib.robot b/robot-systest/lib/ssh_lib.robot index 216cd59..8be049e 100644 --- a/robot-systest/lib/ssh_lib.robot +++ b/robot-systest/lib/ssh_lib.robot @@ -14,7 +14,7 @@ Test SSH Connection [Arguments] ${host} ${username} ${password} ${privatekey} - Open Connection ${host} + Open Connection ${host} Run Keyword If '${password}'!='${EMPTY}' Login ${username} ${password} ... ELSE Login With Public Key ${username} ${privatekey} Execute Command hostname @@ -24,8 +24,8 @@ Check If remote File Exists [Arguments] ${host} ${username} ${password} ${privatekey} ${file} Open Connection ${host} - Run Keyword If '${password}'!='${EMPTY}' Login ${username} ${password} - ... ELSE Login With Public Key ${username} ${privatekey} + Run Keyword If '${password}'!='${EMPTY}' Login ${username} ${password} + ... ELSE Login With Public Key ${username} ${privatekey} ${rc}= Execute Command ls ${file} >& /dev/null return_stdout=False return_rc=True Close All Connections Should Be Equal As Integers ${rc} 0 @@ -34,32 +34,32 @@ Check If Remote Folder Exists [Arguments] ${host} ${username} ${password} ${privatekey} ${folder} Open Connection ${host} - Run Keyword If '${password}'!='${EMPTY}' Login ${username} ${password} - ... ELSE Login With Public Key ${username} ${privatekey} + Run Keyword If '${password}'!='${EMPTY}' Login ${username} ${password} + ... ELSE Login With Public Key ${username} ${privatekey} ${output}= Execute Command ls -d ${folder} Close All Connections Should Be Equal As Strings ${output} ${folder} Get Remote File Content - [Arguments] ${host} ${username} ${password} ${privatekey} ${file} + [Arguments] ${host} ${username} ${password} ${privatekey} ${file} - Open Connection ${host} - Run Keyword If '${password}'!='${EMPTY}' Login ${username} ${password} - ... ELSE Login With Public Key ${username} ${privatekey} + Open Connection ${host} + Run Keyword If '${password}'!='${EMPTY}' Login ${username} ${password} + ... ELSE Login With Public Key ${username} ${privatekey} ${output}= Execute Command cat ${file} Close All Connections [Return] ${output} Ping Many - [Arguments] ${host} ${username} ${password} ${privatekey} @{ip_list} + [Arguments] ${host} ${username} ${password} ${privatekey} @{ip_list} - Open Connection ${host} - Run Keyword If '${password}'!='${EMPTY}' Login ${username} ${password} - ... ELSE Login With Public Key ${username} ${privatekey} + Open Connection ${host} + Run Keyword If '${password}'!='${EMPTY}' Login ${username} ${password} + ... ELSE Login With Public Key ${username} ${privatekey} FOR ${ip} IN @{ip_list} - ${result}= Execute Command ping -c 5 -W 1 ${ip} > /dev/null && echo OK shell=True - Log ${result} - Should Contain ${result} OK + ${result}= Execute Command ping -c 5 -W 1 ${ip} > /dev/null && echo OK shell=True + Log ${result} + Should Contain ${result} OK END Close All Connections @@ -68,8 +68,8 @@ Execute Remote Command Check Rc Return Output [Arguments] ${host} ${username} ${password} ${privatekey} ${command} Open Connection ${host} - Run Keyword If '${password}'!='${EMPTY}' Login ${username} ${password} - ... ELSE Login With Public Key ${username} ${privatekey} + Run Keyword If '${password}'!='${EMPTY}' Login ${username} ${password} + ... ELSE Login With Public Key ${username} ${privatekey} ${stdout} ${rc}= Execute Command ${command} return_rc=True return_stdout=True log ${rc} log ${stdout} diff --git a/robot-systest/lib/user_lib.robot b/robot-systest/lib/user_lib.robot index 8047c33..b786a9f 100644 --- a/robot-systest/lib/user_lib.robot +++ b/robot-systest/lib/user_lib.robot @@ -23,7 +23,7 @@ Create User ${rc} ${stdout}= Run and Return RC and Output osm user-create ${user_name} --password ${user_password} Log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + [Return] ${stdout} Update User Role @@ -38,7 +38,7 @@ Update User Role Check If User Exists - [Arguments] ${user_name} + [Arguments] ${user_name} Should Not Be Empty ${user_name} ${rc} ${stdout}= Run And Return RC And Output osm user-list | awk 'NR>3 {print $2}' | grep "${user_name}" @@ -47,7 +47,7 @@ Check If User Exists Delete User - [Arguments] ${user_name} + [Arguments] ${user_name} ${rc} ${stdout}= Run and Return RC and Output osm user-delete ${user_name} Log ${stdout} diff --git a/robot-systest/lib/vim_lib.robot b/robot-systest/lib/vim_lib.robot index 8e622c9..8fd7e51 100644 --- a/robot-systest/lib/vim_lib.robot +++ b/robot-systest/lib/vim_lib.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation Library to manage VIM Targets. +Documentation Library to manage VIM Targets. Library String Library Collections @@ -32,92 +32,92 @@ ${vim_opstate_pol_time} 10sec *** Keywords *** Create VIM Target - [Documentation] Create a VIM Target in OSM. + [Documentation] Create a VIM Target in OSM. ... The optional parameters (such as 'config' or 'sdn_controller') are given to this function in name=value format. These parameters will be appended to the 'osm vim-create' command with the next syntax: --param_name=param_value ... Return the ID of the created VIM Target. ... Example of execution: - ... \${vim_account_id}= Create VIM Target \${vim_name} \${vim_user} \${vim_password} \${vim_auth_url} \${vim_tenant} \${vim_account_type} config='{...}' + ... \${vim_account_id}= Create VIM Target \${vim_name} \${vim_user} \${vim_password} \${vim_auth_url} \${vim_tenant} \${vim_account_type} config='{...}' - [Arguments] ${vim_name} ${vim_user} ${vim_password} ${vim_auth_url} ${vim_tenant} ${vim_account_type} @{optional_parameters} + [Arguments] ${vim_name} ${vim_user} ${vim_password} ${vim_auth_url} ${vim_tenant} ${vim_account_type} @{optional_parameters} - ${osm_vim_create_command}= Set Variable osm vim-create --name ${vim_name} --user ${vim_user} --password ${vim_password} --auth_url ${vim_auth_url} --tenant ${vim_tenant} --account_type ${vim_account_type} - FOR ${param} IN @{optional_parameters} - ${match} ${param_name} ${param_value} = Should Match Regexp ${param} (.+)=(.+) msg=Syntax error in optional parameters - ${osm_vim_create_command}= Catenate ${osm_vim_create_command} --${param_name}=${param_value} + ${osm_vim_create_command}= Set Variable osm vim-create --name ${vim_name} --user ${vim_user} --password ${vim_password} --auth_url ${vim_auth_url} --tenant ${vim_tenant} --account_type ${vim_account_type} + FOR ${param} IN @{optional_parameters} + ${match} ${param_name} ${param_value} = Should Match Regexp ${param} (.+)=(.+) msg=Syntax error in optional parameters + ${osm_vim_create_command}= Catenate ${osm_vim_create_command} --${param_name}=${param_value} END - ${rc} ${stdout}= Run and Return RC and Output ${osm_vim_create_command} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + ${rc} ${stdout}= Run and Return RC and Output ${osm_vim_create_command} + log ${stdout} + Should Be Equal As Integers ${rc} ${success_return_code} + [Return] ${stdout} Delete VIM Target [Arguments] ${vim_name} - ${rc} ${stdout}= Run Keyword And Continue On Failure Run and Return RC and Output osm vim-delete ${vim_name} - log ${stdout} - Wait Until Keyword Succeeds ${delete_max_wait_time} ${delete_pol_time} Check for VIM Target ${vim_name} + ${rc} ${stdout}= Run Keyword And Continue On Failure Run and Return RC and Output osm vim-delete ${vim_name} + log ${stdout} + Wait Until Keyword Succeeds ${delete_max_wait_time} ${delete_pol_time} Check for VIM Target ${vim_name} Get VIM Targets - ${rc} ${stdout}= Run and Return RC and Output osm vim-list - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} + ${rc} ${stdout}= Run and Return RC and Output osm vim-list + log ${stdout} + Should Be Equal As Integers ${rc} ${success_return_code} Check for VIM Target - [Arguments] ${vim_name} + [Arguments] ${vim_name} - ${rc} ${stdout}= Run and Return RC and Output osm vim-list | awk '{print $2}' | grep ${vim_name} - Should Not Be Equal As Strings ${stdout} ${vim_name} + ${rc} ${stdout}= Run and Return RC and Output osm vim-list | awk '{print $2}' | grep ${vim_name} + Should Not Be Equal As Strings ${stdout} ${vim_name} Check for VIM Target Metric - [Arguments] ${vim_name} ${prometheus_host} ${prometheus_port} + [Arguments] ${vim_name} ${prometheus_host} ${prometheus_port} - ${vim_account_id}= Get VIM Target ID ${vim_name} - Wait Until Keyword Succeeds ${vim_status_max_wait_time} ${vim_status_pol_time} Check If VIM Target Has Metric ${vim_account_id} ${prometheus_host} ${prometheus_port} + ${vim_account_id}= Get VIM Target ID ${vim_name} + Wait Until Keyword Succeeds ${vim_status_max_wait_time} ${vim_status_pol_time} Check If VIM Target Has Metric ${vim_account_id} ${prometheus_host} ${prometheus_port} Check for VIM Target Status - [Arguments] ${vim_name} ${prometheus_host} ${prometheus_port} + [Arguments] ${vim_name} ${prometheus_host} ${prometheus_port} - ${vim_account_id}= Get VIM Target ID ${vim_name} - Wait Until Keyword Succeeds ${vim_status_max_wait_time} ${vim_status_pol_time} Check If VIM Target Is Available ${vim_account_id} ${prometheus_host} ${prometheus_port} + ${vim_account_id}= Get VIM Target ID ${vim_name} + Wait Until Keyword Succeeds ${vim_status_max_wait_time} ${vim_status_pol_time} Check If VIM Target Is Available ${vim_account_id} ${prometheus_host} ${prometheus_port} Get VIM Target ID - [Arguments] ${vim_name} + [Arguments] ${vim_name} - ${rc} ${stdout}= Run and Return RC and Output osm vim-list | grep " ${vim_name} " | awk '{print $4}' - Should Be Equal As Integers ${rc} ${success_return_code} - Should Not Be Equal As Strings ${stdout} ${EMPTY} msg=VIM Target '${vim_name}' not found values=false - [Return] ${stdout} + ${rc} ${stdout}= Run and Return RC and Output osm vim-list | grep " ${vim_name} " | awk '{print $4}' + Should Be Equal As Integers ${rc} ${success_return_code} + Should Not Be Equal As Strings ${stdout} ${EMPTY} msg=VIM Target '${vim_name}' not found values=false + [Return] ${stdout} Check VIM Target Operational State - [Arguments] ${vim_name} + [Arguments] ${vim_name} - Wait Until Keyword Succeeds ${vim_opstate_max_wait_time} ${vim_opstate_pol_time} Check If VIM Target Is Enabled ${vim_name} + Wait Until Keyword Succeeds ${vim_opstate_max_wait_time} ${vim_opstate_pol_time} Check If VIM Target Is Enabled ${vim_name} Check If VIM Target Is Enabled - [Arguments] ${vim_name} + [Arguments] ${vim_name} - ${rc} ${stdout}= Run and Return RC and Output osm vim-list | grep " ${vim_name} " | awk '{print $6}' - Should Be Equal As Integers ${rc} ${success_return_code} - Should Be Equal As Strings ${stdout} ENABLED msg=VIM Target '${vim_name}' is not enabled values=false + ${rc} ${stdout}= Run and Return RC and Output osm vim-list | grep " ${vim_name} " | awk '{print $6}' + Should Be Equal As Integers ${rc} ${success_return_code} + Should Be Equal As Strings ${stdout} ENABLED msg=VIM Target '${vim_name}' is not enabled values=false Check If VIM Target Is Available - [Arguments] ${vim_account_id} ${prometheus_host} ${prometheus_port} + [Arguments] ${vim_account_id} ${prometheus_host} ${prometheus_port} - ${metric}= Get Metric ${prometheus_host} ${prometheus_port} osm_vim_status vim_account_id=${vim_account_id} - Should Be Equal As Integers ${metric} 1 msg=VIM Target '${vim_account_id}' is not active values=false + ${metric}= Get Metric ${prometheus_host} ${prometheus_port} osm_vim_status vim_account_id=${vim_account_id} + Should Be Equal As Integers ${metric} 1 msg=VIM Target '${vim_account_id}' is not active values=false Check If VIM Target Has Metric - [Arguments] ${vim_account_id} ${prometheus_host} ${prometheus_port} + [Arguments] ${vim_account_id} ${prometheus_host} ${prometheus_port} - ${metric}= Get Metric ${prometheus_host} ${prometheus_port} osm_vim_status vim_account_id=${vim_account_id} + ${metric}= Get Metric ${prometheus_host} ${prometheus_port} osm_vim_status vim_account_id=${vim_account_id} Should Be True ${metric} <2 msg=VIM Target '${vim_account_id}' has no metric diff --git a/robot-systest/lib/vnf_lib.robot b/robot-systest/lib/vnf_lib.robot index d58c3dd..9fa2f95 100644 --- a/robot-systest/lib/vnf_lib.robot +++ b/robot-systest/lib/vnf_lib.robot @@ -22,7 +22,7 @@ Get VNF VIM ID ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | grep vim-id | awk '{print $2}' log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} + [Return] ${stdout} Get VDU list from VNF @@ -51,24 +51,24 @@ Get VDU VIM Id Get Vnf Vdur IPs - [Documentation] Return a list with the IP addresses of the VDU records of a VNF instance. + [Documentation] Return a list with the IP addresses of the VDU records of a VNF instance. - [Arguments] ${vnf_id} + [Arguments] ${vnf_id} Should Not Be Empty ${vnf_id} - ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq '.vdur[].interfaces[]."ip-address"' | tr -d \\" - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False - @{ip} = Split String ${stdout} - [Return] @{ip} + ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq '.vdur[].interfaces[]."ip-address"' | tr -d \\" + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + @{ip} = Split String ${stdout} + [Return] @{ip} Get Vdu Attribute - [Documentation] Return an attribute from VDU records selected by count_index of a VNF instance. + [Documentation] Return an attribute from VDU records selected by count_index of a VNF instance. - [Arguments] ${vnf_id} ${attribute} ${count_index}=0 + [Arguments] ${vnf_id} ${attribute} ${count_index}=0 Should Not Be Empty ${vnf_id} Should Not Be Empty ${attribute} - ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq '.vdur[] | select(."count-index" == ${count_index})' | yq '."${attribute}"' | tr -d \\" - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False - [Return] ${stdout} + ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq '.vdur[] | select(."count-index" == ${count_index})' | yq '."${attribute}"' | tr -d \\" + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + [Return] ${stdout} diff --git a/robot-systest/lib/vnfd_lib.robot b/robot-systest/lib/vnfd_lib.robot index 2d50170..d171b67 100644 --- a/robot-systest/lib/vnfd_lib.robot +++ b/robot-systest/lib/vnfd_lib.robot @@ -59,16 +59,16 @@ Create VNFD [Arguments] ${vnfd_pkg} ${overrides}=${EMPTY} # If env variable "OVERRIDES" exists, it prevails over the value in the argument - ${overrides}= Get Environment Variable OVERRIDES default=${overrides} + ${overrides}= Get Environment Variable OVERRIDES default=${overrides} # Proceedes with the onboarding with the appropriate arguments ${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-create ${overrides} ${vnfd_pkg} log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - ${lines}= Get Line Count ${stdout} - ${last}= Evaluate ${lines} - 1 - ${id}= Get Line ${stdout} ${last} - [Return] ${id} + ${lines}= Get Line Count ${stdout} + ${last}= Evaluate ${lines} - 1 + ${id}= Get Line ${stdout} ${last} + [Return] ${id} Update VNFD @@ -83,10 +83,10 @@ Update VNFD ${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-update --content ${vnfd_pkg} ${vnfd_name} log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - ${lines}= Get Line Count ${stdout} - ${last}= Evaluate ${lines} - 1 - ${id}= Get Line ${stdout} ${last} - [Return] ${id} + ${lines}= Get Line Count ${stdout} + ${last}= Evaluate ${lines} - 1 + ${id}= Get Line ${stdout} ${last} + [Return] ${id} Create VNFD Overriding Fields @@ -108,16 +108,16 @@ Create VNFD Overriding Fields [Arguments] ${vnfd_pkg} ${override_fields} ${overrides}=${EMPTY} # If env variable "OVERRIDES" exists, it prevails over the value in the argument - ${overrides}= Get Environment Variable OVERRIDES default=${overrides} + ${overrides}= Get Environment Variable OVERRIDES default=${overrides} # Proceedes with the onboarding with the appropriate arguments ${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-create ${overrides} ${vnfd_pkg} --override '${override_fields}' log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - ${lines}= Get Line Count ${stdout} - ${last}= Evaluate ${lines} - 1 - ${id}= Get Line ${stdout} ${last} - [Return] ${id} + ${lines}= Get Line Count ${stdout} + ${last}= Evaluate ${lines} - 1 + ${id}= Get Line ${stdout} ${last} + [Return] ${id} Delete VNFD @@ -141,9 +141,9 @@ Assert Failure Delete VNFD Check For VNFD - [Arguments] ${vnfd_id} ${exists}=False + [Arguments] ${vnfd_id} ${exists}=False ${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-list | awk '{print $2}' | grep ${vnfd_id} - Run Keyword If ${exists} Should Be Equal As Strings ${stdout} ${vnfd_id} - ... ELSE Should Not Be Equal As Strings ${stdout} ${vnfd_id} + Run Keyword If ${exists} Should Be Equal As Strings ${stdout} ${vnfd_id} + ... ELSE Should Not Be Equal As Strings ${stdout} ${vnfd_id} diff --git a/robot-systest/testsuite/basic_01-crud_operations_on_vim_targets.robot b/robot-systest/testsuite/basic_01-crud_operations_on_vim_targets.robot index b7e641a..9445a97 100644 --- a/robot-systest/testsuite/basic_01-crud_operations_on_vim_targets.robot +++ b/robot-systest/testsuite/basic_01-crud_operations_on_vim_targets.robot @@ -11,61 +11,61 @@ # limitations under the License. *** Settings *** -Documentation [BASIC-01] CRUD operations on VIM targets. -... All tests will be performed over an Openstack VIM, and the credentials will be loaded from clouds.yaml file. +Documentation [BASIC-01] CRUD operations on VIM targets. +... All tests will be performed over an Openstack VIM, and the credentials will be loaded from clouds.yaml file. Resource %{ROBOT_DEVOPS_FOLDER}/lib/vim_lib.robot Variables %{ROBOT_DEVOPS_FOLDER}/resources/basic_01-crud_operations_on_vim_targets_data.py -Force Tags basic_01 cluster_main daily regression +Force Tags basic_01 cluster_main daily regression *** Test Cases *** Create VIM Target Basic - [Documentation] Create a VIM Target only with the mandatory parameters. - ... Checks the status of the VIM in Prometheus after it creation. + [Documentation] Create a VIM Target only with the mandatory parameters. + ... Checks the status of the VIM in Prometheus after it creation. Pass Execution If '${vim_account_type}' != 'openstack' Not applicable for ${vim_account_type} VIM - ${rand}= Generate Random String 6 [NUMBERS] - ${vim_name}= Catenate SEPARATOR=_ ${vim_name_prefix} ${rand} - Set Suite Variable ${vim_name} - ${created_vim_account_id}= Create VIM Target ${vim_name} ${vim_user} ${vim_password} ${vim_auth_url} ${vim_tenant} ${vim_account_type} - Set Suite Variable ${created_vim_account_id} - Check VIM Target Operational State ${vim_name} - Check for VIM Target Metric ${vim_name} ${prometheus_host} ${prometheus_port} + ${rand}= Generate Random String 6 [NUMBERS] + ${vim_name}= Catenate SEPARATOR=_ ${vim_name_prefix} ${rand} + Set Suite Variable ${vim_name} + ${created_vim_account_id}= Create VIM Target ${vim_name} ${vim_user} ${vim_password} ${vim_auth_url} ${vim_tenant} ${vim_account_type} + Set Suite Variable ${created_vim_account_id} + Check VIM Target Operational State ${vim_name} + Check for VIM Target Metric ${vim_name} ${prometheus_host} ${prometheus_port} Delete VIM Target By Name - [Documentation] Delete the VIM Target created in previous test-case by its name. - ... Checks whether the VIM Target was created or not before perform the deletion. + [Documentation] Delete the VIM Target created in previous test-case by its name. + ... Checks whether the VIM Target was created or not before perform the deletion. [Tags] cleanup Pass Execution If '${vim_account_type}' != 'openstack' Not applicable for ${vim_account_type} VIM - ${vim_account_id}= Get VIM Target ID ${vim_name} - Should Be Equal As Strings ${vim_account_id} ${created_vim_account_id} - Delete VIM Target ${vim_name} + ${vim_account_id}= Get VIM Target ID ${vim_name} + Should Be Equal As Strings ${vim_account_id} ${created_vim_account_id} + Delete VIM Target ${vim_name} Create VIM Target With Extra Config - [Documentation] Create a VIM Target using the extra parameter 'config'. - ... Checks the status of the VIM in Prometheus after it creation. + [Documentation] Create a VIM Target using the extra parameter 'config'. + ... Checks the status of the VIM in Prometheus after it creation. - ${rand}= Generate Random String 6 [NUMBERS] - ${vim_name}= Catenate SEPARATOR=_ ${vim_name_prefix} ${rand} - Set Suite Variable ${vim_name} - ${created_vim_account_id}= Create VIM Target ${vim_name} ${vim_user} ${vim_password} ${vim_auth_url} ${vim_tenant} ${vim_account_type} config=${vim_config} - Set Suite Variable ${created_vim_account_id} - Check VIM Target Operational State ${vim_name} - Check for VIM Target Status ${vim_name} ${prometheus_host} ${prometheus_port} + ${rand}= Generate Random String 6 [NUMBERS] + ${vim_name}= Catenate SEPARATOR=_ ${vim_name_prefix} ${rand} + Set Suite Variable ${vim_name} + ${created_vim_account_id}= Create VIM Target ${vim_name} ${vim_user} ${vim_password} ${vim_auth_url} ${vim_tenant} ${vim_account_type} config=${vim_config} + Set Suite Variable ${created_vim_account_id} + Check VIM Target Operational State ${vim_name} + Check for VIM Target Status ${vim_name} ${prometheus_host} ${prometheus_port} Delete VIM Target By ID - [Documentation] Delete the VIM Target created in previous test-case by its ID. - ... Checks whether the VIM Target was created or not before perform the deletion. + [Documentation] Delete the VIM Target created in previous test-case by its ID. + ... Checks whether the VIM Target was created or not before perform the deletion. [Tags] cleanup - ${vim_account_id}= Get VIM Target ID ${vim_name} - Should Be Equal As Strings ${vim_account_id} ${created_vim_account_id} - Delete VIM Target ${vim_account_id} + ${vim_account_id}= Get VIM Target ID ${vim_name} + Should Be Equal As Strings ${vim_account_id} ${created_vim_account_id} + Delete VIM Target ${vim_account_id} diff --git a/robot-systest/testsuite/basic_05-instantiation_parameters_in_cloud_init.robot b/robot-systest/testsuite/basic_05-instantiation_parameters_in_cloud_init.robot index 3175a86..5e4dca0 100644 --- a/robot-systest/testsuite/basic_05-instantiation_parameters_in_cloud_init.robot +++ b/robot-systest/testsuite/basic_05-instantiation_parameters_in_cloud_init.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [BASIC-05] Instantiation parameters in cloud-init. +Documentation [BASIC-05] Instantiation parameters in cloud-init. Library OperatingSystem Library SSHLibrary @@ -46,61 +46,61 @@ ${new_password} newpassword *** Test Cases *** Create Cloudinit VNF Descriptor - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' Create Cloudinit NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate Cloudinit Network Service Using Instantiation Parameters - [Documentation] Instantiates the NS using the instantiation parameter 'additionalParamsForVnf' to change the password of the default user. + [Documentation] Instantiates the NS using the instantiation parameter 'additionalParamsForVnf' to change the password of the default user. - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${EMPTY} - Set Suite Variable ${ns_id} ${id} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${EMPTY} + Set Suite Variable ${ns_id} ${id} Get Management Ip Addresses - ${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index} - log ${ip_addr} - Set Suite Variable ${vnf_ip_addr} ${ip_addr} + ${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index} + log ${ip_addr} + Set Suite Variable ${vnf_ip_addr} ${ip_addr} Test SSH Access With The New Password - [Documentation] Test SSH access with the new password configured via cloud-init. + [Documentation] Test SSH access with the new password configured via cloud-init. - Variable Should Exist ${vnf_ip_addr} msg=IP address of the management VNF is not available - Sleep 30s Waiting ssh daemon to be up - Test SSH Connection ${vnf_ip_addr} ${username} ${new_password} ${EMPTY} + Variable Should Exist ${vnf_ip_addr} msg=IP address of the management VNF is not available + Sleep 30s Waiting ssh daemon to be up + Test SSH Connection ${vnf_ip_addr} ${username} ${new_password} ${EMPTY} Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name} + Delete VNFD ${vnfd_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/basic_06-vnf_with_charm.robot b/robot-systest/testsuite/basic_06-vnf_with_charm.robot index 2d9f1a6..b3ae63e 100644 --- a/robot-systest/testsuite/basic_06-vnf_with_charm.robot +++ b/robot-systest/testsuite/basic_06-vnf_with_charm.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [BASIC-06] VNF with Charm. +Documentation [BASIC-06] VNF with Charm. Library OperatingSystem Library SSHLibrary @@ -55,87 +55,87 @@ ${ns_timeout} 15min *** Test Cases *** Create Charm VNF Descriptor - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' Create Charm NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate Charm Network Service - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ${ns_timeout} - Set Suite Variable ${ns_id} ${id} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ${ns_timeout} + Set Suite Variable ${ns_id} ${id} Get Management Ip Addresses - ${ip_addr_1} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1} - log ${ip_addr_1} - Set Suite Variable ${vnf_1_ip_addr} ${ip_addr_1} - ${ip_addr_2} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2} - log ${ip_addr_2} - Set Suite Variable ${vnf_2_ip_addr} ${ip_addr_2} + ${ip_addr_1} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1} + log ${ip_addr_1} + Set Suite Variable ${vnf_1_ip_addr} ${ip_addr_1} + ${ip_addr_2} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2} + log ${ip_addr_2} + Set Suite Variable ${vnf_2_ip_addr} ${ip_addr_2} Test SSH Access - Variable Should Exist ${vnf_1_ip_addr} msg=IP address of the management VNF '${vnf_member_index_1}' is not available - Variable Should Exist ${vnf_2_ip_addr} msg=IP address of the management VNF '${vnf_member_index_2}' is not available - Sleep 30s Waiting ssh daemon to be up - Test SSH Connection ${vnf_1_ip_addr} ${username} ${password} ${privatekey} - Test SSH Connection ${vnf_2_ip_addr} ${username} ${password} ${privatekey} + Variable Should Exist ${vnf_1_ip_addr} msg=IP address of the management VNF '${vnf_member_index_1}' is not available + Variable Should Exist ${vnf_2_ip_addr} msg=IP address of the management VNF '${vnf_member_index_2}' is not available + Sleep 30s Waiting ssh daemon to be up + Test SSH Connection ${vnf_1_ip_addr} ${username} ${password} ${privatekey} + Test SSH Connection ${vnf_2_ip_addr} ${username} ${password} ${privatekey} Check Remote Files Created Via Day 1 Operations - [Documentation] The Charm VNF has a Day 1 operation that creates a file named ${day_1_file_name}. - ... This test checks whether that files have been created or not. + [Documentation] The Charm VNF has a Day 1 operation that creates a file named ${day_1_file_name}. + ... This test checks whether that files have been created or not. - Check If remote File Exists ${vnf_1_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name} - Check If remote File Exists ${vnf_2_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name} + Check If remote File Exists ${vnf_1_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name} + Check If remote File Exists ${vnf_2_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name} Execute Day 2 Operations - [Documentation] Performs one Day 2 operation per VNF that creates a new file. + [Documentation] Performs one Day 2 operation per VNF that creates a new file. - Variable Should Exist ${ns_id} msg=Network service instance is not available - ${ns_op_id_1}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index_1} filename=${day_2_file_name_1} - ${ns_op_id_2}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index_2} filename=${day_2_file_name_2} + Variable Should Exist ${ns_id} msg=Network service instance is not available + ${ns_op_id_1}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index_1} filename=${day_2_file_name_1} + ${ns_op_id_2}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index_2} filename=${day_2_file_name_2} Check Remote Files Created Via Day 2 Operations - [Documentation] Check whether the files created in the previous test via Day 2 operations exist or not. + [Documentation] Check whether the files created in the previous test via Day 2 operations exist or not. - Check If remote File Exists ${vnf_1_ip_addr} ${username} ${password} ${privatekey} ${day_2_file_name_1} - Check If remote File Exists ${vnf_2_ip_addr} ${username} ${password} ${privatekey} ${day_2_file_name_2} + Check If remote File Exists ${vnf_1_ip_addr} ${username} ${password} ${privatekey} ${day_2_file_name_1} + Check If remote File Exists ${vnf_2_ip_addr} ${username} ${password} ${privatekey} ${day_2_file_name_2} Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name} + Delete VNFD ${vnfd_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/basic_07-secure_key_management.robot b/robot-systest/testsuite/basic_07-secure_key_management.robot index 699b0e7..d692801 100644 --- a/robot-systest/testsuite/basic_07-secure_key_management.robot +++ b/robot-systest/testsuite/basic_07-secure_key_management.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [BASIC-07] Secure key management. +Documentation [BASIC-07] Secure key management. Library OperatingSystem Library SSHLibrary @@ -51,85 +51,85 @@ ${day_2_file_name} /home/ubuntu/mytouch1 *** Test Cases *** Create Nopasswd Charm VNF Descriptor [Tags] prepare - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' Create Nopasswd Charm NS Descriptor [Tags] prepare - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate Nopasswd Charm Network Service [Tags] prepare - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${EMPTY} ${ns_timeout} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${EMPTY} ${ns_timeout} Get Ns Id [Tags] verify - ${id}= Get Ns Id ${ns_name} - Set Suite Variable ${ns_id} ${id} + ${id}= Get Ns Id ${ns_name} + Set Suite Variable ${ns_id} ${id} Get Management Ip Addresses [Tags] verify - ${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index} - log ${ip_addr} - Set Suite Variable ${vnf_ip_addr} ${ip_addr} + ${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index} + log ${ip_addr} + Set Suite Variable ${vnf_ip_addr} ${ip_addr} Test SSH Access [Tags] verify - Variable Should Exist ${vnf_ip_addr} msg=IP address of the management VNF is not available - Sleep 30s Waiting ssh daemon to be up - Test SSH Connection ${vnf_ip_addr} ${username} ${password} ${EMPTY} + Variable Should Exist ${vnf_ip_addr} msg=IP address of the management VNF is not available + Sleep 30s Waiting ssh daemon to be up + Test SSH Connection ${vnf_ip_addr} ${username} ${password} ${EMPTY} Check Remote Files Created Via Day 1 Operations [Tags] verify - [Documentation] The Nopasswd VNF has a Day 1 operation that creates a file named ${day_1_file_name} and performs it without password. - ... This test checks whether that files have been created or not. + [Documentation] The Nopasswd VNF has a Day 1 operation that creates a file named ${day_1_file_name} and performs it without password. + ... This test checks whether that files have been created or not. - Check If remote File Exists ${vnf_ip_addr} ${username} ${password} ${EMPTY} ${day_1_file_name} + Check If remote File Exists ${vnf_ip_addr} ${username} ${password} ${EMPTY} ${day_1_file_name} Execute Day 2 Operations [Tags] verify - [Documentation] Performs one Day 2 operation that creates a new file, this action is executed without password too. + [Documentation] Performs one Day 2 operation that creates a new file, this action is executed without password too. - Variable Should Exist ${ns_id} msg=Network service instance is not available - ${ns_op_id}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index} filename=${day_2_file_name} + Variable Should Exist ${ns_id} msg=Network service instance is not available + ${ns_op_id}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index} filename=${day_2_file_name} Check Remote Files Created Via Day 2 Operations [Tags] verify - [Documentation] Check whether the file created in the previous test via Day 2 operation exists or not. + [Documentation] Check whether the file created in the previous test via Day 2 operation exists or not. - Check If remote File Exists ${vnf_ip_addr} ${username} ${password} ${EMPTY} ${day_2_file_name} + Check If remote File Exists ${vnf_ip_addr} ${username} ${password} ${EMPTY} ${day_2_file_name} Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name} + Delete VNFD ${vnfd_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/basic_08-disable_port_security_network_level.robot b/robot-systest/testsuite/basic_08-disable_port_security_network_level.robot index 12c4931..80dd018 100644 --- a/robot-systest/testsuite/basic_08-disable_port_security_network_level.robot +++ b/robot-systest/testsuite/basic_08-disable_port_security_network_level.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [BASIC-08] Disable port security at network level. +Documentation [BASIC-08] Disable port security at network level. Library OperatingSystem Library String @@ -37,60 +37,60 @@ ${port_disabled_msg} port_security_enabled: false *** Test Cases *** Create VIM With Port Security Disabled - ${created_vim_account_id}= Create VIM Target ${vim_name} ${vim_user} ${vim_password} ${vim_auth_url} ${vim_tenant} ${vim_account_type} config=${vim_config} - Check for VIM Target Status ${vim_name} ${prometheus_host} ${prometheus_port} + ${created_vim_account_id}= Create VIM Target ${vim_name} ${vim_user} ${vim_password} ${vim_auth_url} ${vim_tenant} ${vim_account_type} config=${vim_config} + Check for VIM Target Status ${vim_name} ${prometheus_host} ${prometheus_port} Create VNF Descriptor - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' Create NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate Network Service - ${id}= Create Network Service ${nsd_name} ${vim_name} ${ns_name} ${ns_config} ${publickey} - Set Suite Variable ${ns_id} ${id} + ${id}= Create Network Service ${nsd_name} ${vim_name} ${ns_name} ${ns_config} ${publickey} + Set Suite Variable ${ns_id} ${id} Check Port Security Is Disabled ${rc} ${disabled_ports}= Run and Return RC and Output osm ns-show ${ns_name} --literal | grep -c '${port_disabled_msg}' - Run Keyword Unless ${disabled_ports} > 0 Fail msg=Found '${disabled_ports}' matches for '${port_disabled_msg}' + Run Keyword Unless ${disabled_ports} > 0 Fail msg=Found '${disabled_ports}' matches for '${port_disabled_msg}' Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name} + Delete VNFD ${vnfd_name} Delete VIM [Tags] cleanup - Delete VIM Target ${vim_name} + Delete VIM Target ${vim_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} - Run Keyword If Any Tests Failed Delete VIM Target ${vim_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete VIM Target ${vim_name} diff --git a/robot-systest/testsuite/basic_09-manual_vdu_scaling.robot b/robot-systest/testsuite/basic_09-manual_vdu_scaling.robot index fe99726..dfb502e 100644 --- a/robot-systest/testsuite/basic_09-manual_vdu_scaling.robot +++ b/robot-systest/testsuite/basic_09-manual_vdu_scaling.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [BASIC-09] Manual VNF/VDU Scaling. +Documentation [BASIC-09] Manual VNF/VDU Scaling. Library OperatingSystem Library String @@ -38,7 +38,7 @@ ${nsd_name} hackfest_basic-ns-metrics ${ns_name} basic_09_manual_scaling_test ${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } ${scaling_group} vdu_autoscale -${vnf_member_index} vnf +${vnf_member_index} vnf # SSH public key file ${publickey} %{HOME}/.ssh/id_rsa.pub @@ -47,17 +47,17 @@ ${publickey} %{HOME}/.ssh/id_rsa.pub *** Test Cases *** Create Scaling VNF Descriptor [Tags] prepare - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' Create Scaling NS Descriptor [Tags] prepare - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate Scaling Network Service [Tags] prepare - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} Get Ns Id [Tags] verify @@ -66,81 +66,81 @@ Get Ns Id Get Vnf Id [Tags] verify - Variable Should Exist ${ns_id} msg=Network service instance is not available - @{vnfr_list}= Get Ns Vnfr Ids ${ns_id} - Log List ${vnfr_list} - Set Suite Variable ${vnf_id} ${vnfr_list}[0] + Variable Should Exist ${ns_id} msg=Network service instance is not available + @{vnfr_list}= Get Ns Vnfr Ids ${ns_id} + Log List ${vnfr_list} + Set Suite Variable ${vnf_id} ${vnfr_list}[0] Get Vdus Before Scale Out [Tags] verify - [Documentation] Get the number of VDU records before the manual scaling. + [Documentation] Get the number of VDU records before the manual scaling. - @{vdur_list}= Get Vnf Vdur Names ${vnf_id} - Log List ${vdur_list} - ${vdurs}= Get Length ${vdur_list} - Set Suite Variable ${initial_vdur_count} ${vdurs} + @{vdur_list}= Get Vnf Vdur Names ${vnf_id} + Log List ${vdur_list} + ${vdurs}= Get Length ${vdur_list} + Set Suite Variable ${initial_vdur_count} ${vdurs} Perform Manual Vdu Scale Out [Tags] verify - Variable Should Exist ${ns_id} msg=Network service instance is not available - ${ns_op_id}= Execute Manual VNF Scale ${ns_name} ${vnf_member_index} ${scaling_group} SCALE_OUT + Variable Should Exist ${ns_id} msg=Network service instance is not available + ${ns_op_id}= Execute Manual VNF Scale ${ns_name} ${vnf_member_index} ${scaling_group} SCALE_OUT Check Vdus After Scale Out [Tags] verify - [Documentation] Check whether there is one more VDU after scaling or not. + [Documentation] Check whether there is one more VDU after scaling or not. - Variable Should Exist ${ns_id} msg=Network service instance is not available - @{vdur_list}= Get Vnf Vdur Names ${vnf_id} - Log List ${vdur_list} - ${vdurs}= Get Length ${vdur_list} - Run Keyword Unless ${vdurs} == ${initial_vdur_count} + 1 Fail msg=There is no new VDU records in the VNF after Scale Out + Variable Should Exist ${ns_id} msg=Network service instance is not available + @{vdur_list}= Get Vnf Vdur Names ${vnf_id} + Log List ${vdur_list} + ${vdurs}= Get Length ${vdur_list} + Run Keyword Unless ${vdurs} == ${initial_vdur_count} + 1 Fail msg=There is no new VDU records in the VNF after Scale Out Perform Manual Vdu Scale In [Tags] verify - Variable Should Exist ${ns_id} msg=Network service instance is not available - ${ns_op_id}= Execute Manual VNF Scale ${ns_name} ${vnf_member_index} ${scaling_group} SCALE_IN + Variable Should Exist ${ns_id} msg=Network service instance is not available + ${ns_op_id}= Execute Manual VNF Scale ${ns_name} ${vnf_member_index} ${scaling_group} SCALE_IN Check Vdus After Scaling In [Tags] verify - [Documentation] Check whether there is one less VDU after scaling or not. + [Documentation] Check whether there is one less VDU after scaling or not. - Variable Should Exist ${ns_id} msg=Network service instance is not available - @{vdur_list}= Get Vnf Vdur Names ${vnf_id} - Log List ${vdur_list} - ${vdurs}= Get Length ${vdur_list} - Run Keyword Unless ${vdurs} == ${initial_vdur_count} Fail msg=There is the same number of VDU records in the VNF after Scale In + Variable Should Exist ${ns_id} msg=Network service instance is not available + @{vdur_list}= Get Vnf Vdur Names ${vnf_id} + Log List ${vdur_list} + ${vdurs}= Get Length ${vdur_list} + Run Keyword Unless ${vdurs} == ${initial_vdur_count} Fail msg=There is the same number of VDU records in the VNF after Scale In Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name} + Delete VNFD ${vnfd_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/basic_11-native_charms.robot b/robot-systest/testsuite/basic_11-native_charms.robot index 37f0581..da3f0ea 100644 --- a/robot-systest/testsuite/basic_11-native_charms.robot +++ b/robot-systest/testsuite/basic_11-native_charms.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [BASIC-11] Native Charms +Documentation [BASIC-11] Native Charms Library OperatingSystem Library SSHLibrary @@ -55,72 +55,72 @@ ${day_2_file_name_2} /home/ubuntu/mytouch2 *** Test Cases *** Create Charm VNF Descriptor - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' Create Charm NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate Charm Network Service - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ${ns_timeout} - Set Suite Variable ${ns_id} ${id} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ${ns_timeout} + Set Suite Variable ${ns_id} ${id} Get Management Ip Addresses - ${ip_addr_1} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1} - log ${ip_addr_1} - Set Suite Variable ${vnf_1_ip_addr} ${ip_addr_1} - ${ip_addr_2} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2} - log ${ip_addr_2} - Set Suite Variable ${vnf_2_ip_addr} ${ip_addr_2} + ${ip_addr_1} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1} + log ${ip_addr_1} + Set Suite Variable ${vnf_1_ip_addr} ${ip_addr_1} + ${ip_addr_2} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2} + log ${ip_addr_2} + Set Suite Variable ${vnf_2_ip_addr} ${ip_addr_2} Test SSH Access - Variable Should Exist ${vnf_1_ip_addr} msg=IP address of the management VNF '${vnf_member_index_1}' is not available - Variable Should Exist ${vnf_2_ip_addr} msg=IP address of the management VNF '${vnf_member_index_2}' is not available - Sleep 30s Waiting ssh daemon to be up - Test SSH Connection ${vnf_1_ip_addr} ${username} ${password} ${privatekey} - Test SSH Connection ${vnf_2_ip_addr} ${username} ${password} ${privatekey} + Variable Should Exist ${vnf_1_ip_addr} msg=IP address of the management VNF '${vnf_member_index_1}' is not available + Variable Should Exist ${vnf_2_ip_addr} msg=IP address of the management VNF '${vnf_member_index_2}' is not available + Sleep 30s Waiting ssh daemon to be up + Test SSH Connection ${vnf_1_ip_addr} ${username} ${password} ${privatekey} + Test SSH Connection ${vnf_2_ip_addr} ${username} ${password} ${privatekey} Check Remote Files Created Via Day 1 Operations - [Documentation] The Charm VNF has a Day 1 operation that creates a file named ${day_1_file_name}. - ... This test checks whether that files have been created or not. + [Documentation] The Charm VNF has a Day 1 operation that creates a file named ${day_1_file_name}. + ... This test checks whether that files have been created or not. - Check If remote File Exists ${vnf_1_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name} - Check If remote File Exists ${vnf_2_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name} + Check If remote File Exists ${vnf_1_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name} + Check If remote File Exists ${vnf_2_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name} Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name} + Delete VNFD ${vnfd_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/basic_12-ns_primitives.robot b/robot-systest/testsuite/basic_12-ns_primitives.robot index 502557d..154ed6c 100644 --- a/robot-systest/testsuite/basic_12-ns_primitives.robot +++ b/robot-systest/testsuite/basic_12-ns_primitives.robot @@ -12,7 +12,7 @@ # limitations under the License. *** Settings *** -Documentation [BASIC-12] NS Primitives +Documentation [BASIC-12] NS Primitives Library OperatingSystem Library String @@ -52,13 +52,13 @@ ${success_return_code} 0 *** Test Cases *** Change Juju Password - [Documentation] NS package needs to be updated with the Juju credentials for your OSM installation + [Documentation] NS package needs to be updated with the Juju credentials for your OSM installation ${rc} ${stdout}= Run and Return RC and Output cp -r '%{PACKAGES_FOLDER}/${nsd_pkg}' '%{PACKAGES_FOLDER}/${new_nsd_pkg}' Should Be Equal As Integers ${rc} ${success_return_code} - ${nsd_yaml}= Get File %{PACKAGES_FOLDER}/${new_nsd_pkg}/${nsd_file} - ${changed_nsd_yaml}= Replace String ${nsd_yaml} ${old_juju_password} %{JUJU_PASSWORD} - Create File %{PACKAGES_FOLDER}/${new_nsd_pkg}/${nsd_file} ${changed_nsd_yaml} + ${nsd_yaml}= Get File %{PACKAGES_FOLDER}/${new_nsd_pkg}/${nsd_file} + ${changed_nsd_yaml}= Replace String ${nsd_yaml} ${old_juju_password} %{JUJU_PASSWORD} + Create File %{PACKAGES_FOLDER}/${new_nsd_pkg}/${nsd_file} ${changed_nsd_yaml} Upload Vnfds @@ -67,12 +67,12 @@ Upload Vnfds Upload Nsd - Create NSD %{PACKAGES_FOLDER}/${new_nsd_pkg}/ + Create NSD %{PACKAGES_FOLDER}/${new_nsd_pkg}/ Instantiate NS - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ns_launch_max_wait_time=${ns_timeout} - Set Suite Variable ${ns_id} ${id} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ns_launch_max_wait_time=${ns_timeout} + Set Suite Variable ${ns_id} ${id} # TODO: Check Initial Config Primitives Status @@ -85,7 +85,7 @@ Delete NS Descriptor [Tags] cleanup Delete NSD ${nsd_name} - Delete Temporary Descriptor Folder '%{PACKAGES_FOLDER}/${new_nsd_pkg}' + Delete Temporary Descriptor Folder '%{PACKAGES_FOLDER}/${new_nsd_pkg}' Delete VNF Descriptors [Tags] cleanup @@ -96,17 +96,17 @@ Delete VNF Descriptors *** Keywords *** Suite Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptor and instance + [Documentation] Test Suit Cleanup: Deleting Descriptor and instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name1} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name2} - Delete Temporary Descriptor Folder '%{PACKAGES_FOLDER}/${new_nsd_pkg}' + Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name1} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name2} + Delete Temporary Descriptor Folder '%{PACKAGES_FOLDER}/${new_nsd_pkg}' Delete Temporary Descriptor Folder - [Documentation] Removes the temporary package folder created for the test + [Documentation] Removes the temporary package folder created for the test [Arguments] ${folder_name} ${rc} ${stdout}= Run and Return RC and Output rm -rf '${folder_name}' diff --git a/robot-systest/testsuite/basic_13-ns_relations.robot b/robot-systest/testsuite/basic_13-ns_relations.robot index eb8b352..f50f19f 100644 --- a/robot-systest/testsuite/basic_13-ns_relations.robot +++ b/robot-systest/testsuite/basic_13-ns_relations.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [BASIC-13] NS Relations +Documentation [BASIC-13] NS Relations Library OperatingSystem Library SSHLibrary @@ -21,7 +21,7 @@ Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot -Force Tags basic_13 cluster_ee_config cluster_relations daily regression +Force Tags basic_13 cluster_ee_config cluster_relations daily regression Suite Teardown Run Keyword And Ignore Error Suite Cleanup @@ -57,23 +57,23 @@ ${day_2_file_name_2} /home/ubuntu/mytouch2 *** Test Cases *** Create Charm VNF Descriptor Provides - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg1}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg1}' Create Charm VNF Descriptor Requires - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg2}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg2}' Create Charm NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate Charm Network Service - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ${ns_timeout} - Set Suite Variable ${ns_id} ${id} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ${ns_timeout} + Set Suite Variable ${ns_id} ${id} # TODO Check juju status for relations @@ -82,34 +82,34 @@ Instantiate Charm Network Service Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor Provides [Tags] cleanup - Delete VNFD ${vnfd_name1} + Delete VNFD ${vnfd_name1} Delete VNF Descriptor Requires [Tags] cleanup - Delete VNFD ${vnfd_name2} + Delete VNFD ${vnfd_name2} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/basic_14-vnf_relations.robot b/robot-systest/testsuite/basic_14-vnf_relations.robot index 91f4a4d..dfe164a 100644 --- a/robot-systest/testsuite/basic_14-vnf_relations.robot +++ b/robot-systest/testsuite/basic_14-vnf_relations.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [BASIC-14] VNF Relations +Documentation [BASIC-14] VNF Relations Library OperatingSystem Library SSHLibrary @@ -45,18 +45,18 @@ ${publickey} %{HOME}/.ssh/id_rsa.pub *** Test Cases *** Create Charm VNF Descriptor - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' Create Charm NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate Charm Network Service - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ${ns_timeout} - Set Suite Variable ${ns_id} ${id} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ${ns_timeout} + Set Suite Variable ${ns_id} ${id} # TODO Check juju status for relations @@ -65,28 +65,28 @@ Instantiate Charm Network Service Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor Provides [Tags] cleanup - Delete VNFD ${vnfd_name} + Delete VNFD ${vnfd_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/basic_15-rbac_configurations.robot b/robot-systest/testsuite/basic_15-rbac_configurations.robot index 6cc62cc..ce62168 100644 --- a/robot-systest/testsuite/basic_15-rbac_configurations.robot +++ b/robot-systest/testsuite/basic_15-rbac_configurations.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [BASIC-15] RBAC Configurations. +Documentation [BASIC-15] RBAC Configurations. Library OperatingSystem Library String @@ -47,9 +47,9 @@ Create And Validate User Assign Role To User - Update User Role ${user_name} ${user_project} ${user_role} + Update User Role ${user_name} ${user_project} ${user_role} Check If User Is Assigned To Project ${user_name} ${user_project} - Check If User Has Role ${user_name} ${user_role} ${user_project} + Check If User Has Role ${user_name} ${user_role} ${user_project} Run Action As User @@ -86,7 +86,7 @@ Delete Allocated Resources *** Keywords *** Suite Cleanup - Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete User ${user_name} - Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete Role ${role_name} - Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete Project ${project_name} - Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete Project ${new_project_name} + Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete User ${user_name} + Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete Role ${role_name} + Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete Project ${project_name} + Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete Project ${new_project_name} diff --git a/robot-systest/testsuite/basic_16-advanced_onboarding_and_scaling.robot b/robot-systest/testsuite/basic_16-advanced_onboarding_and_scaling.robot index af8ec1c..bd0acb2 100644 --- a/robot-systest/testsuite/basic_16-advanced_onboarding_and_scaling.robot +++ b/robot-systest/testsuite/basic_16-advanced_onboarding_and_scaling.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [BASIC-16] Advanced onboarding with override and complex scaling (3 initial instances, scaled by two). +Documentation [BASIC-16] Advanced onboarding with override and complex scaling (3 initial instances, scaled by two). Library OperatingSystem Library String @@ -47,99 +47,99 @@ ${min_instances} 3 ${max_instances} 5 ${delta_instances} 2 ${scaling_group} vdu_autoscale -${vnf_member_index} vnf +${vnf_member_index} vnf *** Test Cases *** Create Scaling VNF Descriptor - Create VNFD Overriding Fields '%{PACKAGES_FOLDER}/${vnfd_pkg}' df.0.instantiation-level.0.vdu-level.0.number-of-instances=${init_instances};df.0.vdu-profile.0.min-number-of-instances=${min_instances};df.0.vdu-profile.0.max-number-of-instances=${max_instances};df.0.scaling-aspect.0.aspect-delta-details.deltas.0.vdu-delta.0.number-of-instances=${delta_instances} + Create VNFD Overriding Fields '%{PACKAGES_FOLDER}/${vnfd_pkg}' df.0.instantiation-level.0.vdu-level.0.number-of-instances=${init_instances};df.0.vdu-profile.0.min-number-of-instances=${min_instances};df.0.vdu-profile.0.max-number-of-instances=${max_instances};df.0.scaling-aspect.0.aspect-delta-details.deltas.0.vdu-delta.0.number-of-instances=${delta_instances} Create Scaling NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate Scaling Network Service - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} - Set Suite Variable ${ns_id} ${id} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} + Set Suite Variable ${ns_id} ${id} Get Vnf Id - Variable Should Exist ${ns_id} msg=Network service instance is not available - @{vnfr_list}= Get Ns Vnfr Ids ${ns_id} - Log List ${vnfr_list} - Set Suite Variable ${vnf_id} ${vnfr_list}[0] + Variable Should Exist ${ns_id} msg=Network service instance is not available + @{vnfr_list}= Get Ns Vnfr Ids ${ns_id} + Log List ${vnfr_list} + Set Suite Variable ${vnf_id} ${vnfr_list}[0] Check Vdus Before Scale Out - [Documentation] Check the number of VDUs instances before the manual scaling. + [Documentation] Check the number of VDUs instances before the manual scaling. - @{vdur_list}= Get Vnf Vdur Names ${vnf_id} - Log List ${vdur_list} - ${vdurs}= Get Length ${vdur_list} - Set Suite Variable ${initial_vdur_count} ${vdurs} - Run Keyword Unless ${init_instances} == ${initial_vdur_count} Fail msg=Instantiated VDUs (${initial_vdur_count}) don't match specified number in descriptor (${init_instances}) + @{vdur_list}= Get Vnf Vdur Names ${vnf_id} + Log List ${vdur_list} + ${vdurs}= Get Length ${vdur_list} + Set Suite Variable ${initial_vdur_count} ${vdurs} + Run Keyword Unless ${init_instances} == ${initial_vdur_count} Fail msg=Instantiated VDUs (${initial_vdur_count}) don't match specified number in descriptor (${init_instances}) Perform Manual Vdu Scale Out - Variable Should Exist ${ns_id} msg=Network service instance is not available - ${ns_op_id}= Execute Manual VNF Scale ${ns_name} ${vnf_member_index} ${scaling_group} SCALE_OUT + Variable Should Exist ${ns_id} msg=Network service instance is not available + ${ns_op_id}= Execute Manual VNF Scale ${ns_name} ${vnf_member_index} ${scaling_group} SCALE_OUT Check Vdus After Scale Out - [Documentation] Check whether there is one more VDU after scaling or not. + [Documentation] Check whether there is one more VDU after scaling or not. - Variable Should Exist ${ns_id} msg=Network service instance is not available - @{vdur_list}= Get Vnf Vdur Names ${vnf_id} - Log List ${vdur_list} - ${vdurs}= Get Length ${vdur_list} - Run Keyword Unless ${vdurs} == ${initial_vdur_count} + ${delta_instances} Fail msg=VDU instances in the VNF (${vdurs}) don't match after Scale Out (${initial_vdur_count} + ${delta_instances}) + Variable Should Exist ${ns_id} msg=Network service instance is not available + @{vdur_list}= Get Vnf Vdur Names ${vnf_id} + Log List ${vdur_list} + ${vdurs}= Get Length ${vdur_list} + Run Keyword Unless ${vdurs} == ${initial_vdur_count} + ${delta_instances} Fail msg=VDU instances in the VNF (${vdurs}) don't match after Scale Out (${initial_vdur_count} + ${delta_instances}) Perform Manual Vdu Scale In - Variable Should Exist ${ns_id} msg=Network service instance is not available - ${ns_op_id}= Execute Manual VNF Scale ${ns_name} ${vnf_member_index} ${scaling_group} SCALE_IN + Variable Should Exist ${ns_id} msg=Network service instance is not available + ${ns_op_id}= Execute Manual VNF Scale ${ns_name} ${vnf_member_index} ${scaling_group} SCALE_IN Check Vdus After Scaling In - [Documentation] Check whether there is one less VDU after scaling or not. + [Documentation] Check whether there is one less VDU after scaling or not. - Variable Should Exist ${ns_id} msg=Network service instance is not available - @{vdur_list}= Get Vnf Vdur Names ${vnf_id} - Log List ${vdur_list} - ${vdurs}= Get Length ${vdur_list} - Run Keyword Unless ${vdurs} == ${initial_vdur_count} Fail msg=There is the same number of VDU records in the VNF after Scale In + Variable Should Exist ${ns_id} msg=Network service instance is not available + @{vdur_list}= Get Vnf Vdur Names ${vnf_id} + Log List ${vdur_list} + ${vdurs}= Get Length ${vdur_list} + Run Keyword Unless ${vdurs} == ${initial_vdur_count} Fail msg=There is the same number of VDU records in the VNF after Scale In Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name} + Delete VNFD ${vnfd_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/basic_17-delete_vnf_package.robot b/robot-systest/testsuite/basic_17-delete_vnf_package.robot index b6ce774..906ddd2 100644 --- a/robot-systest/testsuite/basic_17-delete_vnf_package.robot +++ b/robot-systest/testsuite/basic_17-delete_vnf_package.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [BASIC-17] Delete VNF Package Before NS Package. +Documentation [BASIC-17] Delete VNF Package Before NS Package. Library OperatingSystem Library String @@ -65,9 +65,9 @@ Delete VNF Package *** Keywords *** Suite Cleanup - [Documentation] Test Suit Cleanup: Deleting NS and VNF packages + [Documentation] Test Suit Cleanup: Deleting NS and VNF packages - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/basic_18-ns_ip_profile.robot b/robot-systest/testsuite/basic_18-ns_ip_profile.robot index 49e4961..9bc2391 100644 --- a/robot-systest/testsuite/basic_18-ns_ip_profile.robot +++ b/robot-systest/testsuite/basic_18-ns_ip_profile.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [BASIC-18] NS with a VLD with a virtual link profile. +Documentation [BASIC-18] NS with a VLD with a virtual link profile. Library OperatingSystem Library String @@ -60,121 +60,121 @@ ${success_return_code} 0 *** Test Cases *** Create VNF Descriptor - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' Create NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate Network Service - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} - Set Suite Variable ${ns_id} ${id} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} + Set Suite Variable ${ns_id} ${id} Get Vnfs Info - Variable Should Exist ${ns_id} msg=Network service instance is not available - @{vnfr_list}= Get Ns Vnfr Ids ${ns_id} + Variable Should Exist ${ns_id} msg=Network service instance is not available + @{vnfr_list}= Get Ns Vnfr Ids ${ns_id} Log List ${vnfr_list} Set Suite Variable ${vnf_id1} ${vnfr_list}[0] Set Suite Variable ${vnf_id2} ${vnfr_list}[1] - ${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1} - Set Suite Variable ${vnf1_ipmgmt} ${ip} - log ${vnf1_ipmgmt} - ${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2} - Set Suite Variable ${vnf2_ipmgmt} ${ip} - log ${vnf2_ipmgmt} + ${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1} + Set Suite Variable ${vnf1_ipmgmt} ${ip} + log ${vnf1_ipmgmt} + ${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2} + Set Suite Variable ${vnf2_ipmgmt} ${ip} + log ${vnf2_ipmgmt} Check Vnf1 IPs - Variable Should Exist ${vnf_id1} msg=VNF1 is not available - ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id1} --literal | yq '.vdur[0].interfaces[] | select(.name == "${iface1_name}")' | yq '."ip-address"' | tr -d \\" - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False - Should Match Regexp ${stdout} ${datanet1_prefix} msg=${stdout} doesn't match subnet's regexp ${datanet1_prefix} + Variable Should Exist ${vnf_id1} msg=VNF1 is not available + ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id1} --literal | yq '.vdur[0].interfaces[] | select(.name == "${iface1_name}")' | yq '."ip-address"' | tr -d \\" + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + Should Match Regexp ${stdout} ${datanet1_prefix} msg=${stdout} doesn't match subnet's regexp ${datanet1_prefix} Set Suite Variable ${vnf1_ip1} ${stdout} - ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id1} --literal | yq '.vdur[0].interfaces[] | select(.name == "${iface2_name}")' | yq '."ip-address"' | tr -d \\" - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False - Should Match Regexp ${stdout} ${datanet2_prefix} msg=${stdout} doesn't match subnet's regexp ${datanet2_prefix} + ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id1} --literal | yq '.vdur[0].interfaces[] | select(.name == "${iface2_name}")' | yq '."ip-address"' | tr -d \\" + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + Should Match Regexp ${stdout} ${datanet2_prefix} msg=${stdout} doesn't match subnet's regexp ${datanet2_prefix} Set Suite Variable ${vnf1_ip2} ${stdout} - ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id1} --literal | yq '.vdur[0].interfaces[] | select(.name == "${iface3_name}")' | yq '."ip-address"' | tr -d \\" - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False - Should Match Regexp ${stdout} ${datanet3_prefix} msg=${stdout} doesn't match subnet's regexp ${datanet3_prefix} + ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id1} --literal | yq '.vdur[0].interfaces[] | select(.name == "${iface3_name}")' | yq '."ip-address"' | tr -d \\" + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + Should Match Regexp ${stdout} ${datanet3_prefix} msg=${stdout} doesn't match subnet's regexp ${datanet3_prefix} Set Suite Variable ${vnf1_ip3} ${stdout} Check Vnf2 IPs - Variable Should Exist ${vnf_id1} msg=VNF2 is not available - ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id2} --literal | yq '.vdur[0].interfaces[] | select(.name == "${iface1_name}")' | yq '."ip-address"' | tr -d \\" - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False - Should Match Regexp ${stdout} ${datanet1_prefix} msg=${stdout} doesn't match subnet's regexp ${datanet1_prefix} + Variable Should Exist ${vnf_id1} msg=VNF2 is not available + ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id2} --literal | yq '.vdur[0].interfaces[] | select(.name == "${iface1_name}")' | yq '."ip-address"' | tr -d \\" + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + Should Match Regexp ${stdout} ${datanet1_prefix} msg=${stdout} doesn't match subnet's regexp ${datanet1_prefix} Set Suite Variable ${vnf2_ip1} ${stdout} - ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id2} --literal | yq '.vdur[0].interfaces[] | select(.name == "${iface2_name}")' | yq '."ip-address"' | tr -d \\" - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False - Should Match Regexp ${stdout} ${datanet2_prefix} msg=${stdout} doesn't match subnet's regexp ${datanet2_prefix} + ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id2} --literal | yq '.vdur[0].interfaces[] | select(.name == "${iface2_name}")' | yq '."ip-address"' | tr -d \\" + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + Should Match Regexp ${stdout} ${datanet2_prefix} msg=${stdout} doesn't match subnet's regexp ${datanet2_prefix} Set Suite Variable ${vnf2_ip2} ${stdout} - ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id2} --literal | yq '.vdur[0].interfaces[] | select(.name == "${iface3_name}")' | yq '."ip-address"' | tr -d \\" - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False - Should Match Regexp ${stdout} ${datanet3_prefix} msg=${stdout} doesn't match subnet's regexp ${datanet3_prefix} + ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id2} --literal | yq '.vdur[0].interfaces[] | select(.name == "${iface3_name}")' | yq '."ip-address"' | tr -d \\" + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + Should Match Regexp ${stdout} ${datanet3_prefix} msg=${stdout} doesn't match subnet's regexp ${datanet3_prefix} Set Suite Variable ${vnf2_ip3} ${stdout} Ping from Vnf1 to Vnf2 - Variable Should Exist ${vnf1_ipmgmt} msg=IP address of the data VNF '${vnf_member_index_1}' is not available - Variable Should Exist ${privatekey} msg=SSH private key not available + Variable Should Exist ${vnf1_ipmgmt} msg=IP address of the data VNF '${vnf_member_index_1}' is not available + Variable Should Exist ${privatekey} msg=SSH private key not available Sleep 30 seconds Wait for SSH daemon to be up ${stdout}= Execute Remote Command Check Rc Return Output ${vnf1_ipmgmt} ${username} ${EMPTY} ${privatekey} ip addr ; ping -c 5 ${vnf2_ipmgmt} - log ${stdout} + log ${stdout} ${stdout}= Execute Remote Command Check Rc Return Output ${vnf1_ipmgmt} ${username} ${EMPTY} ${privatekey} ping -c 5 ${vnf2_ip1} - log ${stdout} + log ${stdout} ${stdout}= Execute Remote Command Check Rc Return Output ${vnf1_ipmgmt} ${username} ${EMPTY} ${privatekey} ping -c 5 ${vnf2_ip2} - log ${stdout} + log ${stdout} ${stdout}= Execute Remote Command Check Rc Return Output ${vnf1_ipmgmt} ${username} ${EMPTY} ${privatekey} ping -c 5 ${vnf2_ip3} - log ${stdout} + log ${stdout} Ping from Vnf2 to Vnf1 - Variable Should Exist ${vnf1_ipmgmt} msg=IP address of the data VNF '${vnf_member_index_2}' is not available - Variable Should Exist ${privatekey} msg=SSH private key not available + Variable Should Exist ${vnf1_ipmgmt} msg=IP address of the data VNF '${vnf_member_index_2}' is not available + Variable Should Exist ${privatekey} msg=SSH private key not available ${stdout}= Execute Remote Command Check Rc Return Output ${vnf2_ipmgmt} ${username} ${EMPTY} ${privatekey} ip addr ; ping -c 5 ${vnf1_ipmgmt} - log ${stdout} + log ${stdout} ${stdout}= Execute Remote Command Check Rc Return Output ${vnf2_ipmgmt} ${username} ${EMPTY} ${privatekey} ip addr ; ping -c 5 ${vnf1_ip1} - log ${stdout} + log ${stdout} ${stdout}= Execute Remote Command Check Rc Return Output ${vnf2_ipmgmt} ${username} ${EMPTY} ${privatekey} ip addr ; ping -c 5 ${vnf1_ip2} - log ${stdout} + log ${stdout} ${stdout}= Execute Remote Command Check Rc Return Output ${vnf2_ipmgmt} ${username} ${EMPTY} ${privatekey} ip addr ; ping -c 5 ${vnf1_ip3} - log ${stdout} + log ${stdout} Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name} + Delete VNFD ${vnfd_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/basic_19-vnf_ip_profile.robot b/robot-systest/testsuite/basic_19-vnf_ip_profile.robot index 8c9d1d3..8922b49 100644 --- a/robot-systest/testsuite/basic_19-vnf_ip_profile.robot +++ b/robot-systest/testsuite/basic_19-vnf_ip_profile.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [BASIC-19] NS with a single VNF and two VDU linked by a VLD with ip-profile. +Documentation [BASIC-19] NS with a single VNF and two VDU linked by a VLD with ip-profile. Library OperatingSystem Library String @@ -53,64 +53,64 @@ ${success_return_code} 0 *** Test Cases *** Create VNF Descriptor - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' Create NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate Network Service - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} - Set Suite Variable ${ns_id} ${id} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} + Set Suite Variable ${ns_id} ${id} Get Vnf Info - Variable Should Exist ${ns_id} msg=Network service instance is not available - @{vnfr_list}= Get Ns Vnfr Ids ${ns_id} + Variable Should Exist ${ns_id} msg=Network service instance is not available + @{vnfr_list}= Get Ns Vnfr Ids ${ns_id} Log List ${vnfr_list} Set Suite Variable ${vnf_id} ${vnfr_list}[0] - ${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1} - Set Suite Variable ${vnf_ipmgmt} ${ip} - log ${vnf_ipmgmt} + ${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1} + Set Suite Variable ${vnf_ipmgmt} ${ip} + log ${vnf_ipmgmt} Check Vnf IPs - Variable Should Exist ${vnf_id} msg=VNF is not available - ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq '.vdur[0].interfaces[] | select(."vnf-vld-id" == "internal")' | yq '."ip-address"' | tr -d \\" - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False - Should Match Regexp ${stdout} ${internal_prefix} msg=${stdout} doesn't match subnet's regexp ${internal_prefix} - ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq '.vdur[1].interfaces[] | select(."vnf-vld-id" == "internal")' | yq '."ip-address"' | tr -d \\" - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False - Should Match Regexp ${stdout} ${internal_prefix} msg=${stdout} doesn't match subnet's regexp ${internal_prefix} + Variable Should Exist ${vnf_id} msg=VNF is not available + ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq '.vdur[0].interfaces[] | select(."vnf-vld-id" == "internal")' | yq '."ip-address"' | tr -d \\" + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + Should Match Regexp ${stdout} ${internal_prefix} msg=${stdout} doesn't match subnet's regexp ${internal_prefix} + ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq '.vdur[1].interfaces[] | select(."vnf-vld-id" == "internal")' | yq '."ip-address"' | tr -d \\" + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + Should Match Regexp ${stdout} ${internal_prefix} msg=${stdout} doesn't match subnet's regexp ${internal_prefix} Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name} + Delete VNFD ${vnfd_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/basic_20-manual_native_charm_vdu_scaling.robot b/robot-systest/testsuite/basic_20-manual_native_charm_vdu_scaling.robot index 3637f56..df4faa4 100644 --- a/robot-systest/testsuite/basic_20-manual_native_charm_vdu_scaling.robot +++ b/robot-systest/testsuite/basic_20-manual_native_charm_vdu_scaling.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [BASIC-20] Manual VDU Scaling to test juju applications are scaling for native charms (testing Bug-1609). +Documentation [BASIC-20] Manual VDU Scaling to test juju applications are scaling for native charms (testing Bug-1609). Library OperatingSystem Library String @@ -37,7 +37,7 @@ ${nsd_name} native_manual_scale_charm-ns # NS instance name and configuration ${ns_name} basic_20_manual_vdu_scaling_test ${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } -${vnf_member_index} vnf +${vnf_member_index} vnf # SSH public key file ${publickey} %{HOME}/.ssh/id_rsa.pub @@ -50,138 +50,138 @@ ${scale_wait_time} 4min *** Test Cases *** Create VNF Descriptor - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' Create NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate Network Service - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} - Set Suite Variable ${ns_id} ${id} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} + Set Suite Variable ${ns_id} ${id} Get Vnf Id - Variable Should Exist ${ns_id} msg=Network service instance is not available - @{vnfr_list}= Get Ns Vnfr Ids ${ns_id} - Log List ${vnfr_list} - Set Suite Variable ${vnf_id} ${vnfr_list}[0] + Variable Should Exist ${ns_id} msg=Network service instance is not available + @{vnfr_list}= Get Ns Vnfr Ids ${ns_id} + Log List ${vnfr_list} + Set Suite Variable ${vnf_id} ${vnfr_list}[0] Get Vdus Before Scale Out - [Documentation] Get the number of VDU records before the manual scaling. + [Documentation] Get the number of VDU records before the manual scaling. - @{vdur_list}= Get Vnf Vdur Names ${vnf_id} - Log List ${vdur_list} - ${vdurs}= Get Length ${vdur_list} - Set Suite Variable ${initial_vdur_count} ${vdurs} + @{vdur_list}= Get Vnf Vdur Names ${vnf_id} + Log List ${vdur_list} + ${vdurs}= Get Length ${vdur_list} + Set Suite Variable ${initial_vdur_count} ${vdurs} Get Application Name Before Scale Out - [Documentation] Get the application names. + [Documentation] Get the application names. - @{name_list}= Get Application Names ${ns_name} - Log List ${name_list} - Set Suite Variable ${application_list} ${name_list} + @{name_list}= Get Application Names ${ns_name} + Log List ${name_list} + Set Suite Variable ${application_list} ${name_list} Check Number of Duplicated Application Name Before Scale Out - [Documentation] Check the application names if there are 2 application name in the application list. + [Documentation] Check the application names if there are 2 application name in the application list. - ${count_duplicated}= Get Length ${application_list} - Run Keyword Unless ${count_duplicated} == 2 Fail msg=There are not 2 application name in the application list before Scale Out + ${count_duplicated}= Get Length ${application_list} + Run Keyword Unless ${count_duplicated} == 2 Fail msg=There are not 2 application name in the application list before Scale Out Perform Manual Vdu Scale Out - Variable Should Exist ${ns_id} msg=Network service instance is not available - ${ns_op_id}= Execute Manual VNF Scale ${ns_name} ${vnf_member_index} ${scaling_group} SCALE_OUT ${scale_wait_time} + Variable Should Exist ${ns_id} msg=Network service instance is not available + ${ns_op_id}= Execute Manual VNF Scale ${ns_name} ${vnf_member_index} ${scaling_group} SCALE_OUT ${scale_wait_time} Check Vdus After Scale Out - [Documentation] Check whether there is one more VDU after scaling or not. + [Documentation] Check whether there is one more VDU after scaling or not. - Variable Should Exist ${ns_id} msg=Network service instance is not available - @{vdur_list}= Get Vnf Vdur Names ${vnf_id} - Log List ${vdur_list} - ${vdurs}= Get Length ${vdur_list} - Run Keyword Unless ${vdurs} == ${initial_vdur_count} + 1 Fail msg=There is no new VDU records in the VNF after Scale Out + Variable Should Exist ${ns_id} msg=Network service instance is not available + @{vdur_list}= Get Vnf Vdur Names ${vnf_id} + Log List ${vdur_list} + ${vdurs}= Get Length ${vdur_list} + Run Keyword Unless ${vdurs} == ${initial_vdur_count} + 1 Fail msg=There is no new VDU records in the VNF after Scale Out Get Application Name After Scale Out - [Documentation] Get the application names. + [Documentation] Get the application names. - @{name_list}= Get Application Names ${ns_name} - Log List ${name_list} - Set Suite Variable ${application_list} ${name_list} + @{name_list}= Get Application Names ${ns_name} + Log List ${name_list} + Set Suite Variable ${application_list} ${name_list} Check Number of Duplicated Application Name After Scale Out - [Documentation] Check the application names if there are 3 application name in the application list. + [Documentation] Check the application names if there are 3 application name in the application list. - ${count_duplicated}= Get Length ${application_list} - Run Keyword Unless ${count_duplicated} == 3 Fail msg=There are not 2 application name in the application list after Scale Out + ${count_duplicated}= Get Length ${application_list} + Run Keyword Unless ${count_duplicated} == 3 Fail msg=There are not 2 application name in the application list after Scale Out Perform Manual Vdu Scale In - Variable Should Exist ${ns_id} msg=Network service instance is not available - ${ns_op_id}= Execute Manual VNF Scale ${ns_name} ${vnf_member_index} ${scaling_group} SCALE_IN + Variable Should Exist ${ns_id} msg=Network service instance is not available + ${ns_op_id}= Execute Manual VNF Scale ${ns_name} ${vnf_member_index} ${scaling_group} SCALE_IN Check Vdus After Scaling In - [Documentation] Check whether there is one less VDU after scaling or not. + [Documentation] Check whether there is one less VDU after scaling or not. - Variable Should Exist ${ns_id} msg=Network service instance is not available - @{vdur_list}= Get Vnf Vdur Names ${vnf_id} - Log List ${vdur_list} - ${vdurs}= Get Length ${vdur_list} - Run Keyword Unless ${vdurs} == ${initial_vdur_count} Fail msg=There is the same number of VDU records in the VNF after Scale In + Variable Should Exist ${ns_id} msg=Network service instance is not available + @{vdur_list}= Get Vnf Vdur Names ${vnf_id} + Log List ${vdur_list} + ${vdurs}= Get Length ${vdur_list} + Run Keyword Unless ${vdurs} == ${initial_vdur_count} Fail msg=There is the same number of VDU records in the VNF after Scale In Get Application Name After Scale In - [Documentation] Get the application names. + [Documentation] Get the application names. - @{name_list}= Get Application Names ${ns_name} - Log List ${name_list} - Set Suite Variable ${application_list} ${name_list} + @{name_list}= Get Application Names ${ns_name} + Log List ${name_list} + Set Suite Variable ${application_list} ${name_list} Check Number of Duplicated Application Name After Scale In - [Documentation] Check the application names if there are 2 application name in the application list. + [Documentation] Check the application names if there are 2 application name in the application list. - ${count_duplicated}= Get Length ${application_list} - Run Keyword Unless ${count_duplicated} == 2 Fail msg=There are not 2 application name in the application list after Scale In + ${count_duplicated}= Get Length ${application_list} + Run Keyword Unless ${count_duplicated} == 2 Fail msg=There are not 2 application name in the application list after Scale In Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name} + Delete VNFD ${vnfd_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/basic_21-support_of_volumes.robot b/robot-systest/testsuite/basic_21-support_of_volumes.robot index a4de2ae..3e86b51 100644 --- a/robot-systest/testsuite/basic_21-support_of_volumes.robot +++ b/robot-systest/testsuite/basic_21-support_of_volumes.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [BASIC-21] NS with only one VDU and several volumes +Documentation [BASIC-21] NS with only one VDU and several volumes Library OperatingSystem Library String @@ -55,17 +55,17 @@ ${success_return_code} 0 *** Test Cases *** Create VNF Descriptor - [Tags] prepare + [Tags] prepare Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' Create NS Descriptor - [Tags] prepare + [Tags] prepare Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Network Service Instance Test - [Tags] prepare + [Tags] prepare ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} Set Suite Variable ${ns_id} ${id} @@ -78,41 +78,41 @@ Get NS Id END Get Volumes From VNFD - [Tags] verify - ${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-show ${vnfd_name} --literal | yq '.vdu[0]."virtual-storage-desc" | length' - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + [Tags] verify + ${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-show ${vnfd_name} --literal | yq '.vdu[0]."virtual-storage-desc" | length' + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False ${num_virtual_storage}= Convert To Integer ${stdout} Set Suite Variable ${vnf_num_volumes} ${num_virtual_storage} log ${vnf_num_volumes} Get VNF IP Address - [Tags] verify - Variable Should Exist ${ns_id} msg=NS is not available - ${ip_addr}= Get Vnf Management Ip Address ${ns_id} ${vnf_member_index} + [Tags] verify + Variable Should Exist ${ns_id} msg=NS is not available + ${ip_addr}= Get Vnf Management Ip Address ${ns_id} ${vnf_member_index} log ${ip_addr} Set Suite Variable ${vnf_ip_addr} ${ip_addr} #Get Persistent Volume Id -# [Tags] cleanup -# Variable Should Exist ${ns_id} msg=NS is not available -# ${vnfs_list}= Get Ns Vnf List ${ns_id} -# ${vim_id}= Get VNF VIM ID ${vnfs_list}[0] -# ${volumes_attached}= Get Server Property ${vim_id} volumes_attached -# ${match}= Get Regexp Matches ${volumes_attached} '([0-9a-f\-]+)' 1 +# [Tags] cleanup +# Variable Should Exist ${ns_id} msg=NS is not available +# ${vnfs_list}= Get Ns Vnf List ${ns_id} +# ${vim_id}= Get VNF VIM ID ${vnfs_list}[0] +# ${volumes_attached}= Get Server Property ${vim_id} volumes_attached +# ${match}= Get Regexp Matches ${volumes_attached} '([0-9a-f\-]+)' 1 # Set Suite Variable ${volume_id} ${match}[0] Check VDU disks - [Tags] verify - Variable Should Exist ${vnf_ip_addr} msg=VNF is not available + [Tags] verify + Variable Should Exist ${vnf_ip_addr} msg=VNF is not available Sleep 30 seconds Wait for SSH daemon to be up ${stdout}= Execute Remote Command Check Rc Return Output ${vnf_ip_addr} ${username} ${password} ${privatekey} sudo lsblk -l - log ${stdout} + log ${stdout} ${lines}= Get Lines Containing String ${stdout} disk ${num_lines}= Get Line Count ${lines} - Run Keyword If ${num_lines} < ${vnf_num_volumes} Fail msg=Number of disks (${num_lines}) is less than specified in VDU (${vnf_num_volumes}) + Run Keyword If ${num_lines} < ${vnf_num_volumes} Fail msg=Number of disks (${num_lines}) is less than specified in VDU (${vnf_num_volumes}) Delete NS Instance Test @@ -122,7 +122,7 @@ Delete NS Instance Test #Check Persistent Volume Was Deleted # [Tags] cleanup -# Variable Should Exist ${volume_id} msg=Volume is not available +# Variable Should Exist ${volume_id} msg=Volume is not available # ${exists}= Check If Volume Exists ${volume_id} # log ${exists} # IF ${exists}==0 @@ -147,12 +147,12 @@ Delete VNF Descriptor Test *** Keywords *** Suite Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim + [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim - Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} -# Run Keyword If Any Tests Failed Check Volume Was Deleted +# Run Keyword If Any Tests Failed Check Volume Was Deleted diff --git a/robot-systest/testsuite/basic_22-cross_model_relations.robot b/robot-systest/testsuite/basic_22-cross_model_relations.robot index e63c462..e1e313b 100644 --- a/robot-systest/testsuite/basic_22-cross_model_relations.robot +++ b/robot-systest/testsuite/basic_22-cross_model_relations.robot @@ -11,20 +11,20 @@ # limitations under the License. *** Settings *** -Documentation [BASIC-22] Cross-model relations +Documentation [BASIC-22] Cross-model relations -Library OperatingSystem -Library SSHLibrary +Library OperatingSystem +Library SSHLibrary -Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/k8scluster_lib.robot +Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot +Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot +Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot +Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot +Resource %{ROBOT_DEVOPS_FOLDER}/lib/k8scluster_lib.robot -Force Tags basic_22 cluster_ee_config cluster_relations daily regression +Force Tags basic_22 cluster_ee_config cluster_relations daily regression -Suite Teardown Run Keyword And Ignore Error Suite Cleanup +Suite Teardown Run Keyword And Ignore Error Suite Cleanup *** Variables *** @@ -33,85 +33,85 @@ ${k8scluster_name} k8sbasic_22 ${k8scluster_version} v1 # NS and VNF descriptor package folder and ids -${vnfd_pkg_1} charm-packages/cmr_relation_vnf -${vnfd_pkg_2} charm-packages/cmr_no_relation_vnf -${nsd_pkg} charm-packages/cmr_relation_ns +${vnfd_pkg_1} charm-packages/cmr_relation_vnf +${vnfd_pkg_2} charm-packages/cmr_no_relation_vnf +${nsd_pkg} charm-packages/cmr_relation_ns ${vnfd_name_1} cross_model_relation-vnf ${vnfd_name_2} cross_model_no_relation-vnf -${nsd_name} cross_model_relation-ns +${nsd_name} cross_model_relation-ns # NS instance name and configuration -${ns_name} basic_22 -${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } -${ns_timeout} 15min +${ns_name} basic_22 +${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } +${ns_timeout} 15min # SSH keys and username to be used -${publickey} %{HOME}/.ssh/id_rsa.pub -${privatekey} %{HOME}/.ssh/id_rsa -${username} ubuntu -${password} ${EMPTY} +${publickey} %{HOME}/.ssh/id_rsa.pub +${privatekey} %{HOME}/.ssh/id_rsa +${username} ubuntu +${password} ${EMPTY} *** Test Cases *** Create Charm VNF Descriptor 1 - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg_1}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg_1}' Create Charm VNF Descriptor 2 - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg_2}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg_2}' Create Charm NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Add K8s Cluster To OSM - Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} %{VIM_TARGET} %{VIM_MGMT_NET} ${k8scluster_name} + Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} %{VIM_TARGET} %{VIM_MGMT_NET} ${k8scluster_name} Instantiate Charm Network Service - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ${ns_timeout} - Set Suite Variable ${ns_id} ${id} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ${ns_timeout} + Set Suite Variable ${ns_id} ${id} # TODO Check juju status for relations Delete NS Instance - [Tags] cleanup + [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Remove K8s Cluster from OSM [Tags] cleanup - Delete K8s Cluster ${k8scluster_name} + Delete K8s Cluster ${k8scluster_name} Delete NS Descriptor - [Tags] cleanup + [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor 1 - [Tags] cleanup + [Tags] cleanup - Delete VNFD ${vnfd_name_1} + Delete VNFD ${vnfd_name_1} Delete VNF Descriptor 2 - [Tags] cleanup + [Tags] cleanup - Delete VNFD ${vnfd_name_2} + Delete VNFD ${vnfd_name_2} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD 1 ${vnfd_name_1} + Run Keyword If Any Tests Failed Delete VNFD 1 ${vnfd_name_1} - Run Keyword If Any Tests Failed Delete VNFD 2 ${vnfd_name_2} + Run Keyword If Any Tests Failed Delete VNFD 2 ${vnfd_name_2} diff --git a/robot-systest/testsuite/basic_23-sol004_sol007_packages.robot b/robot-systest/testsuite/basic_23-sol004_sol007_packages.robot index 1d870bb..b6c7112 100644 --- a/robot-systest/testsuite/basic_23-sol004_sol007_packages.robot +++ b/robot-systest/testsuite/basic_23-sol004_sol007_packages.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [BASIC-23] Creation and deletion of SOL004 and SOL007 packages. +Documentation [BASIC-23] Creation and deletion of SOL004 and SOL007 packages. Library OperatingSystem Library String @@ -65,9 +65,9 @@ Delete VNF Package *** Keywords *** Suite Cleanup - [Documentation] Test Suit Cleanup: Deleting NS and VNF packages + [Documentation] Test Suit Cleanup: Deleting NS and VNF packages - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/basic_24-affinity_groups.robot b/robot-systest/testsuite/basic_24-affinity_groups.robot index 11f34b1..b3b51eb 100644 --- a/robot-systest/testsuite/basic_24-affinity_groups.robot +++ b/robot-systest/testsuite/basic_24-affinity_groups.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [BASIC-24] VNF with two VDUs belonging to an Openstack server group +Documentation [BASIC-24] VNF with two VDUs belonging to an Openstack server group Library OperatingSystem Library String @@ -100,7 +100,7 @@ Delete VNF Descriptor Test *** Keywords *** Suite Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim + [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim Run Keyword If Any Tests Failed Delete NS ${ns_name} diff --git a/robot-systest/testsuite/basic_25-update_charm_in_running_vnf_instance.robot b/robot-systest/testsuite/basic_25-update_charm_in_running_vnf_instance.robot index 9a744ee..f5ae2fc 100644 --- a/robot-systest/testsuite/basic_25-update_charm_in_running_vnf_instance.robot +++ b/robot-systest/testsuite/basic_25-update_charm_in_running_vnf_instance.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [BASIC-25] Update Charms in Running VNF Instance. +Documentation [BASIC-25] Update Charms in Running VNF Instance. Library OperatingSystem Library SSHLibrary @@ -60,117 +60,117 @@ ${ns_update_timeout} 500 *** Test Cases *** Create Charm VNF Descriptor - ${id}= Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' - Set Suite Variable ${vnfd_id} ${id} + ${id}= Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' + Set Suite Variable ${vnfd_id} ${id} Create Charm NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate Charm Network Service - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ${ns_timeout} - Set Suite Variable ${ns_id} ${id} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ${ns_timeout} + Set Suite Variable ${ns_id} ${id} Set NS Update Config Variable Should Exist ${ns_id} msg=NS is not available ${id} Get Vnf Id ${ns_id} ${vnf_member_index} - log ${id} - Set Suite Variable ${vnf_id} ${id} - Set Suite Variable ${ns_update_config} '{changeVnfPackageData: [{vnfInstanceId: "${vnf_id}", vnfdId: "${vnfd_id}"}]}' + log ${id} + Set Suite Variable ${vnf_id} ${id} + Set Suite Variable ${ns_update_config} '{changeVnfPackageData: [{vnfInstanceId: "${vnf_id}", vnfdId: "${vnfd_id}"}]}' Get Management Ip Address - ${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index} - log ${ip_addr} - Set Suite Variable ${vnf_ip_addr} ${ip_addr} + ${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index} + log ${ip_addr} + Set Suite Variable ${vnf_ip_addr} ${ip_addr} Test SSH Access - Variable Should Exist ${vnf_ip_addr} msg=IP address of the management VNF '${vnf_member_index}' is not available - Sleep 30s Waiting ssh daemon to be up - Test SSH Connection ${vnf_ip_addr} ${username} ${password} ${privatekey} + Variable Should Exist ${vnf_ip_addr} msg=IP address of the management VNF '${vnf_member_index}' is not available + Sleep 30s Waiting ssh daemon to be up + Test SSH Connection ${vnf_ip_addr} ${username} ${password} ${privatekey} Check Remote Files Created Via Day 1 Operation - [Documentation] The Charm VNF has a Day 1 operation that creates a file named ${day_1_file_name}. - ... This test checks whether that files have been created or not. + [Documentation] The Charm VNF has a Day 1 operation that creates a file named ${day_1_file_name}. + ... This test checks whether that files have been created or not. - Check If remote File Exists ${vnf_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name} + Check If remote File Exists ${vnf_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name} Execute Day 2 Operation - [Documentation] Performs one Day 2 operation on the VNF that creates a new file. + [Documentation] Performs one Day 2 operation on the VNF that creates a new file. - Variable Should Exist ${ns_id} msg=Network service instance is not available - ${ns_op_id_1}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index} filename=${day_2_file_name} + Variable Should Exist ${ns_id} msg=Network service instance is not available + ${ns_op_id_1}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index} filename=${day_2_file_name} Check Remote File Created Via Day 2 Operation - [Documentation] Check whether the file created in the previous test via Day 2 operations exist or not. + [Documentation] Check whether the file created in the previous test via Day 2 operations exist or not. - Check If remote File Exists ${vnf_ip_addr} ${username} ${password} ${privatekey} ${day_2_file_name} + Check If remote File Exists ${vnf_ip_addr} ${username} ${password} ${privatekey} ${day_2_file_name} Update VNFD Package - [Documentation] Updates the VNFD by using new VNFD package which includes the Charm - ... which has new day2 operation. + [Documentation] Updates the VNFD by using new VNFD package which includes the Charm + ... which has new day2 operation. - Update VNFD '%{PACKAGES_FOLDER}/${updated_vnfd_pkg}' ${vnfd_name} + Update VNFD '%{PACKAGES_FOLDER}/${updated_vnfd_pkg}' ${vnfd_name} Update Running VNF Instance - [Documentation] Updates the running VNF instance by using new VNFD package. - ... As the VNFD has an updated charm, this operation will trigger the upgrade of existing charm - ... for the specific VNF. + [Documentation] Updates the running VNF instance by using new VNFD package. + ... As the VNFD has an updated charm, this operation will trigger the upgrade of existing charm + ... for the specific VNF. - Update Network Service ${ns_id} ${update_type} ${ns_update_config} ${ns_update_timeout} + Update Network Service ${ns_id} ${update_type} ${ns_update_config} ${ns_update_timeout} Execute Day 2 Operation on Upgraded Charm - [Documentation] Performs one Day 2 operation on the updated VNF that creates a new folder. + [Documentation] Performs one Day 2 operation on the updated VNF that creates a new folder. - Variable Should Exist ${ns_id} msg=Network service instance is not available - ${ns_op_id_2}= Execute NS Action ${ns_name} ${new_action_name} ${vnf_member_index} foldername=${day_2_folder_name} + Variable Should Exist ${ns_id} msg=Network service instance is not available + ${ns_op_id_2}= Execute NS Action ${ns_name} ${new_action_name} ${vnf_member_index} foldername=${day_2_folder_name} Check Remote Folder Created Via Day 2 Operation - [Documentation] Check whether the folder created in the previous test via Day 2 operations exist or not. + [Documentation] Check whether the folder created in the previous test via Day 2 operations exist or not. - Check If remote Folder Exists ${vnf_ip_addr} ${username} ${password} ${privatekey} ${day_2_folder_name} + Check If remote Folder Exists ${vnf_ip_addr} ${username} ${password} ${privatekey} ${day_2_folder_name} Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name} + Delete VNFD ${vnfd_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/epa_01-epa_sriov.robot b/robot-systest/testsuite/epa_01-epa_sriov.robot index 8afcb77..cdee22d 100644 --- a/robot-systest/testsuite/epa_01-epa_sriov.robot +++ b/robot-systest/testsuite/epa_01-epa_sriov.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [EPA-01] EPA+SRIOV without underlay. +Documentation [EPA-01] EPA+SRIOV without underlay. Library OperatingSystem Library String @@ -53,57 +53,57 @@ ${vnf_ip_addr} ${EMPTY} *** Test Cases *** Create VNF Descriptor - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' Create NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate Network Service - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} - Set Suite Variable ${ns_id} ${id} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} + Set Suite Variable ${ns_id} ${id} Get VNF IP Address - ${ip_addr}= Get Vnf Management Ip Address ${ns_id} ${vnf_member_index} + ${ip_addr}= Get Vnf Management Ip Address ${ns_id} ${vnf_member_index} log ${ip_addr} Set Suite Variable ${vnf_ip_addr} ${ip_addr} Check SR-IOV Interface - Sleep 30 seconds Waiting for SSH daemon to be up + Sleep 30 seconds Waiting for SSH daemon to be up Execute Remote Command Check Rc Return Output ${vnf_ip_addr} ${username} ${password} ${privatekey} lspci | grep "Ethernet controller" | grep -v "Virtio" Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name} + Delete VNFD ${vnfd_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/epa_02-additional_capabilities.robot b/robot-systest/testsuite/epa_02-additional_capabilities.robot index 6a108b3..a719a2b 100644 --- a/robot-systest/testsuite/epa_02-additional_capabilities.robot +++ b/robot-systest/testsuite/epa_02-additional_capabilities.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [EPA-02] Support for additional EPA capabilities. +Documentation [EPA-02] Support for additional EPA capabilities. Library OperatingSystem Library String @@ -52,33 +52,33 @@ ${success_return_code} 0 *** Test Cases *** Create VNF Descriptor - Remove Environment Variable OVERRIDES - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' + Remove Environment Variable OVERRIDES + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' Create NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate Network Service - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} - Set Suite Variable ${ns_id} ${id} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} + Set Suite Variable ${ns_id} ${id} Get VNF Server ID - ${vnfs_list}= Get Ns Vnf List ${ns_id} - ${vim_id}= Get VNF VIM ID ${vnfs_list}[0] + ${vnfs_list}= Get Ns Vnf List ${ns_id} + ${vim_id}= Get VNF VIM ID ${vnfs_list}[0] log ${vim_id} Set Suite Variable ${vnf_server_id} ${vim_id} Get Server Flavor Properties - ${flavor_id}= Get Server Flavor ID ${vnf_server_id} - ${properties}= Get Flavor Properties ${flavor_id} + ${flavor_id}= Get Server Flavor ID ${vnf_server_id} + ${properties}= Get Flavor Properties ${flavor_id} log ${properties} Set Suite Variable ${flavor_properties} ${properties} @@ -96,28 +96,28 @@ Check Flavor Quota Properties Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name} + Delete VNFD ${vnfd_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/epa_03-crud_operations_on_sdnc.robot b/robot-systest/testsuite/epa_03-crud_operations_on_sdnc.robot index b0d86df..e507fa7 100644 --- a/robot-systest/testsuite/epa_03-crud_operations_on_sdnc.robot +++ b/robot-systest/testsuite/epa_03-crud_operations_on_sdnc.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [EPA-03] CRUD operations on SDNC accounts. +Documentation [EPA-03] CRUD operations on SDNC accounts. Resource %{ROBOT_DEVOPS_FOLDER}/lib/sdnc_lib.robot @@ -30,17 +30,17 @@ ${sdnc_enabled_pol_time} 10 *** Test Cases *** Create Basic SDNC - ${created_sdnc_id}= Create SDNC ${sdnc_name} ${sdnc_user} ${sdnc_password} ${sdnc_url} ${sdnc_type} - Set Suite Variable ${sdnc_id} ${created_sdnc_id} - Wait Until Keyword Succeeds ${sdnc_enabled_max_wait_time} ${sdnc_enabled_pol_time} Check for SDNC ${sdnc_id} + ${created_sdnc_id}= Create SDNC ${sdnc_name} ${sdnc_user} ${sdnc_password} ${sdnc_url} ${sdnc_type} + Set Suite Variable ${sdnc_id} ${created_sdnc_id} + Wait Until Keyword Succeeds ${sdnc_enabled_max_wait_time} ${sdnc_enabled_pol_time} Check for SDNC ${sdnc_id} Check SDNC Status Is Healthy - Check for SDNC Status ${sdnc_id} ${prometheus_host} ${prometheus_port} + Check for SDNC Status ${sdnc_id} ${prometheus_host} ${prometheus_port} Delete Basic SDNC [Tags] cleanup - Delete SDNC ${sdnc_name} + Delete SDNC ${sdnc_name} diff --git a/robot-systest/testsuite/epa_04-epa_underlay_sriov.robot b/robot-systest/testsuite/epa_04-epa_underlay_sriov.robot index e7e5a4c..a7ea9b0 100644 --- a/robot-systest/testsuite/epa_04-epa_underlay_sriov.robot +++ b/robot-systest/testsuite/epa_04-epa_underlay_sriov.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [EPA-04] EPA underlay SR-IOV. +Documentation [EPA-04] EPA underlay SR-IOV. Library OperatingSystem Library String @@ -54,74 +54,74 @@ ${success_return_code} 0 *** Test Cases *** Create VNF Descriptor - Remove Environment Variable OVERRIDES - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' + Remove Environment Variable OVERRIDES + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' Create NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate Network Service - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${EMPTY} - Set Suite Variable ${ns_id} ${id} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${EMPTY} + Set Suite Variable ${ns_id} ${id} Get Management Ip Addresses - Variable Should Exist ${ns_id} msg=Network service instance is not available - ${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1} - Set Suite Variable ${ip_mgmt_1} ${ip} - log ${ip_mgmt_1} + Variable Should Exist ${ns_id} msg=Network service instance is not available + ${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1} + Set Suite Variable ${ip_mgmt_1} ${ip} + log ${ip_mgmt_1} - ${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2} - Set Suite Variable ${ip_mgmt_2} ${ip} - log ${ip_mgmt_2} + ${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2} + Set Suite Variable ${ip_mgmt_2} ${ip} + log ${ip_mgmt_2} Ping from Vnf1 to Vnf2 - Variable Should Exist ${ip_mgmt_1} msg=IP address of the data VNF '${vnf_member_index_1}' is not available + Variable Should Exist ${ip_mgmt_1} msg=IP address of the data VNF '${vnf_member_index_1}' is not available Sleep 30 seconds Wait for SSH daemon to be up ${stdout}= Execute Remote Command Check Rc Return Output ${ip_mgmt_1} ${username} ${password} ${EMPTY} ip addr ; ping -c 5 ${datanet_ip2} - log ${stdout} + log ${stdout} Ping from Vnf2 to Vnf1 - Variable Should Exist ${ip_mgmt_2} msg=IP address of the data VNF '${vnf_member_index_2}' is not available + Variable Should Exist ${ip_mgmt_2} msg=IP address of the data VNF '${vnf_member_index_2}' is not available ${stdout}= Execute Remote Command Check Rc Return Output ${ip_mgmt_2} ${username} ${password} ${EMPTY} ip addr ; ping -c 5 ${datanet_ip1} - log ${stdout} + log ${stdout} Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name} + Delete VNFD ${vnfd_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/epa_05-epa_underlay_passthrough.robot b/robot-systest/testsuite/epa_05-epa_underlay_passthrough.robot index 63c1aa6..df72e28 100644 --- a/robot-systest/testsuite/epa_05-epa_underlay_passthrough.robot +++ b/robot-systest/testsuite/epa_05-epa_underlay_passthrough.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [EPA-05] EPA underlay PASSTHROUGH. +Documentation [EPA-05] EPA underlay PASSTHROUGH. Library OperatingSystem Library String @@ -54,75 +54,75 @@ ${success_return_code} 0 *** Test Cases *** Create VNF Descriptor - Remove Environment Variable OVERRIDES - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' + Remove Environment Variable OVERRIDES + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' Create NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate Network Service - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${EMPTY} - Set Suite Variable ${ns_id} ${id} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${EMPTY} + Set Suite Variable ${ns_id} ${id} Get Management Ip Addresses - Variable Should Exist ${ns_id} msg=Network service instance is not available - ${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1} - Set Suite Variable ${ip_mgmt_1} ${ip} - log ${ip_mgmt_1} + Variable Should Exist ${ns_id} msg=Network service instance is not available + ${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1} + Set Suite Variable ${ip_mgmt_1} ${ip} + log ${ip_mgmt_1} - ${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2} - Set Suite Variable ${ip_mgmt_2} ${ip} - log ${ip_mgmt_2} + ${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2} + Set Suite Variable ${ip_mgmt_2} ${ip} + log ${ip_mgmt_2} Ping from Vnf1 to Vnf2 - Variable Should Exist ${ip_mgmt_1} msg=IP address of the data VNF '${vnf_member_index_1}' is not available + Variable Should Exist ${ip_mgmt_1} msg=IP address of the data VNF '${vnf_member_index_1}' is not available Sleep 30 seconds Wait for SSH daemon to be up ${stdout}= Execute Remote Command Check Rc Return Output ${ip_mgmt_1} ${username} ${password} ${EMPTY} ip addr ; ping -c 5 ${datanet_ip2} - log ${stdout} + log ${stdout} Ping from Vnf2 to Vnf1 - Variable Should Exist ${ip_mgmt_2} msg=IP address of the data VNF '${vnf_member_index_2}' is not available + Variable Should Exist ${ip_mgmt_2} msg=IP address of the data VNF '${vnf_member_index_2}' is not available ${stdout}= Execute Remote Command Check Rc Return Output ${ip_mgmt_2} ${username} ${password} ${EMPTY} ip addr ; ping -c 5 ${datanet_ip1} - log ${stdout} + log ${stdout} Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name} + Delete VNFD ${vnfd_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/fail_01-insufficient_resources.robot b/robot-systest/testsuite/fail_01-insufficient_resources.robot index 958d45c..e15e1d9 100644 --- a/robot-systest/testsuite/fail_01-insufficient_resources.robot +++ b/robot-systest/testsuite/fail_01-insufficient_resources.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [FAIL-01] A single VNF with 2 VDUs, one of them unallocatable because of resources. +Documentation [FAIL-01] A single VNF with 2 VDUs, one of them unallocatable because of resources. Library OperatingSystem Library String @@ -60,7 +60,7 @@ Create VNF Descriptor ${ram_quota}= Get Project Quota ram IF ${ram_quota} == -1 - ${memory}= Get Environment Variable VM_MEMORY_OVERRIDE default=${default_memory} + ${memory}= Get Environment Variable VM_MEMORY_OVERRIDE default=${default_memory} ELSE ${memory}= Evaluate ${ram_quota} / 1000 END @@ -70,18 +70,18 @@ Create VNF Descriptor Create NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Cannot Instantiate Network Service - ${rand}= Generate Random String 4 [NUMBERS] - ${ns_name}= Catenate SEPARATOR=_ ${ns_name_prefix} ${rand} - Set Suite Variable ${ns_name} + ${rand}= Generate Random String 4 [NUMBERS] + ${ns_name}= Catenate SEPARATOR=_ ${ns_name_prefix} ${rand} + Set Suite Variable ${ns_name} log ${ns_name} ${id}= Instantiate Network Service ${ns_name} ${nsd_name} %{VIM_TARGET} --config '${ns_config}' --ssh_keys ${publickey} log ${id} - Set Suite Variable ${ns_id} ${id} + Set Suite Variable ${ns_id} ${id} WAIT UNTIL KEYWORD SUCCEEDS ${ns_launch_max_wait_time} ${ns_launch_pol_time} Check For Ns Instance To Configured ${ns_name} ${rc} ${stdout}= run and return rc and output osm ns-list --filter id="${ns_id}" | grep ${ns_id} | awk '{print $8}' log ${stdout} @@ -94,26 +94,26 @@ Cannot Instantiate Network Service Delete NS Instance And Check VIM [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} WAIT UNTIL KEYWORD SUCCEEDS ${os_delete_max_wait_time} ${os_delete_pol_time} Check NS Servers In VIM ${ns_name} 0 Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name} + Delete VNFD ${vnfd_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/hackfest_basic.robot b/robot-systest/testsuite/hackfest_basic.robot index 1996d81..092074a 100644 --- a/robot-systest/testsuite/hackfest_basic.robot +++ b/robot-systest/testsuite/hackfest_basic.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [HACKFEST-BASIC] Basic NS with a single-VDU VNF +Documentation [HACKFEST-BASIC] Basic NS with a single-VDU VNF Library OperatingSystem Library String @@ -70,16 +70,16 @@ Network Service Instance Test Get Vnf Ip Address - ${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index} + ${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index} log ${ip_addr} Set Suite Variable ${vnf_ip_addr} ${ip_addr} Test Ping - Test Connectivity ${vnf_ip_addr} + Test Connectivity ${vnf_ip_addr} Test SSH Access Sleep 30s Waiting ssh daemon to be up - Test SSH Connection ${vnf_ip_addr} ${username} ${password} ${privatekey} + Test SSH Connection ${vnf_ip_addr} ${username} ${password} ${privatekey} Delete NS Instance Test [Tags] cleanup @@ -101,12 +101,12 @@ Delete VNF Descriptor Test *** Keywords *** Suite Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim + [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim - Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/hackfest_cloudinit.robot b/robot-systest/testsuite/hackfest_cloudinit.robot index 87df100..5f20a71 100644 --- a/robot-systest/testsuite/hackfest_cloudinit.robot +++ b/robot-systest/testsuite/hackfest_cloudinit.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [HACKFEST-CLOUDINIT] Basic NS with two multi-VDU VNF with cloudinit +Documentation [HACKFEST-CLOUDINIT] Basic NS with two multi-VDU VNF with cloudinit Library OperatingSystem Library String @@ -69,7 +69,7 @@ Network Service Instance Test Get Vnf Ip Address - ${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index} + ${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index} log ${ip_addr} Set Suite Variable ${vnf_ip_addr} ${ip_addr} @@ -106,12 +106,12 @@ Delete VNF Descriptor Test *** Keywords *** Suite Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim + [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim - Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/hackfest_multivdu.robot b/robot-systest/testsuite/hackfest_multivdu.robot index 0005609..229e9e6 100644 --- a/robot-systest/testsuite/hackfest_multivdu.robot +++ b/robot-systest/testsuite/hackfest_multivdu.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [HACKFEST-MULTIVDU] Basic NS with two multi-VDU VNF +Documentation [HACKFEST-MULTIVDU] Basic NS with two multi-VDU VNF Library OperatingSystem Library String @@ -65,15 +65,15 @@ Create Hackfest Multivdu NS Descriptor Network Service Instance Test - ${status} ${message}= Run Keyword And Ignore Error Variable Should Exist ${publickey} + ${status} ${message}= Run Keyword And Ignore Error Variable Should Exist ${publickey} Run Keyword If "${status}" == "FAIL" Set Global Variable ${publickey} ${EMPTY} ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} Set Suite Variable ${ns_id} ${id} - Sleep ${wait_guard_for_vm_boot} Waiting for VM's daemons to be up and running + Sleep ${wait_guard_for_vm_boot} Waiting for VM's daemons to be up and running Get Vnf Ip Address - ${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index} + ${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index} log ${ip_addr} Set Suite Variable ${vnf_ip_addr} ${ip_addr} @@ -81,9 +81,9 @@ Test Ping Test Connectivity ${vnf_ip_addr} Test SSH Access - ${status} ${message}= Run Keyword And Ignore Error Variable Should Exist ${privatekey} + ${status} ${message}= Run Keyword And Ignore Error Variable Should Exist ${privatekey} Run Keyword If "${status}" == "FAIL" Set Global Variable ${privatekey} ${EMPTY} - Test SSH Connection ${vnf_ip_addr} ${username} ${password} ${privatekey} + Test SSH Connection ${vnf_ip_addr} ${username} ${password} ${privatekey} Delete NS Instance Test [Tags] cleanup @@ -105,10 +105,10 @@ Delete VNF Descriptor Test *** Keywords *** Suite Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim + [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim - Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/heal_01-volume_vdu_healing.robot b/robot-systest/testsuite/heal_01-volume_vdu_healing.robot index 774a502..13e662b 100644 --- a/robot-systest/testsuite/heal_01-volume_vdu_healing.robot +++ b/robot-systest/testsuite/heal_01-volume_vdu_healing.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [HEAL-01] Healing of a multi-volume VDU +Documentation [HEAL-01] Healing of a multi-volume VDU Library OperatingSystem Library String @@ -58,18 +58,18 @@ ${success_return_code} 0 *** Test Cases *** Create VNF Descriptors - [Tags] prepare + [Tags] prepare Create VNFD '%{PACKAGES_FOLDER}/${vnfd_charm_pkg}' Create VNFD '%{PACKAGES_FOLDER}/${vnfd_volumes_pkg}' Create NS Descriptor - [Tags] prepare + [Tags] prepare Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Network Service Instance Test - [Tags] prepare + [Tags] prepare ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} Set Suite Variable ${ns_id} ${id} @@ -84,81 +84,81 @@ Get NS Id Get Volume VNF Info - [Tags] verify - Variable Should Exist ${ns_id} msg=NS is not available - ${ip_addr}= Get Vnf Management Ip Address ${ns_id} ${vnf_several_index} + [Tags] verify + Variable Should Exist ${ns_id} msg=NS is not available + ${ip_addr}= Get Vnf Management Ip Address ${ns_id} ${vnf_several_index} log ${ip_addr} Set Suite Variable ${vnf_volumes_ip_addr} ${ip_addr} - ${vnf_id}= Get Vnf Id ${ns_id} ${vnf_several_index} + ${vnf_id}= Get Vnf Id ${ns_id} ${vnf_several_index} Set Suite Variable ${vnf_volumes_id} ${vnf_id} - ${id}= Get VNF VIM ID ${vnf_id} + ${id}= Get VNF VIM ID ${vnf_id} Set Suite Variable ${vdu_volumes_id} ${id} log ${vdu_volumes_id} - @{volumes_ip_list}= Get Vnf Vdur IPs ${vnf_volumes_id} + @{volumes_ip_list}= Get Vnf Vdur IPs ${vnf_volumes_id} Set Suite Variable @{volumes_ip_list} @{volumes_ip_list} log @{volumes_ip_list} Get Volumes Info - [Tags] verify - ${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-show ${vnfd_volumes_name} --literal | yq '.vdu[0]."virtual-storage-desc" | length' - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + [Tags] verify + ${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-show ${vnfd_volumes_name} --literal | yq '.vdu[0]."virtual-storage-desc" | length' + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False ${num_virtual_storage}= Convert To Integer ${stdout} Set Suite Variable ${vnf_num_volumes} ${num_virtual_storage} log ${vnf_num_volumes} - ${volumes_attached}= Get Server Property ${vdu_volumes_id} volumes_attached - ${match}= Get Regexp Matches ${volumes_attached} '([0-9a-f\-]+)' 1 + ${volumes_attached}= Get Server Property ${vdu_volumes_id} volumes_attached + ${match}= Get Regexp Matches ${volumes_attached} '([0-9a-f\-]+)' 1 Set Suite Variable ${volume_id} ${match}[0] Check VDU Disks - [Tags] verify - Variable Should Exist ${vnf_volumes_ip_addr} msg=VNF is not available + [Tags] verify + Variable Should Exist ${vnf_volumes_ip_addr} msg=VNF is not available Sleep 30 seconds Wait for SSH daemon to be up ${stdout}= Execute Remote Command Check Rc Return Output ${vnf_volumes_ip_addr} ${username} ${password} ${privatekey} sudo lsblk -l - log ${stdout} + log ${stdout} ${lines}= Get Lines Containing String ${stdout} disk ${num_lines}= Get Line Count ${lines} - Run Keyword If ${num_lines} < ${vnf_num_volumes} Fail msg=Number of disks (${num_lines}) is less than specified in VDU (${vnf_num_volumes}) + Run Keyword If ${num_lines} < ${vnf_num_volumes} Fail msg=Number of disks (${num_lines}) is less than specified in VDU (${vnf_num_volumes}) Stop Persistent Volume VDU - [Tags] verify - Variable Should Exist ${vdu_volumes_id} msg=VDU is not available + [Tags] verify + Variable Should Exist ${vdu_volumes_id} msg=VDU is not available Stop Server ${vdu_volumes_id} Sleep 20 Heal Persistent Volume VDU - [Tags] verify - Variable Should Exist ${vnf_volumes_id} msg=VNF is not available + [Tags] verify + Variable Should Exist ${vnf_volumes_id} msg=VNF is not available Heal Network Service ${ns_id} --vnf ${vnf_volumes_id} --cause "Heal VM of volumes_vnf" --vdu ${vdu_volumes_name} Check VNF After Healing - [Tags] verify - Variable Should Exist ${vnf_volumes_id} msg=VNF is not available + [Tags] verify + Variable Should Exist ${vnf_volumes_id} msg=VNF is not available - @{ip_list}= Get Vnf Vdur IPs ${vnf_volumes_id} + @{ip_list}= Get Vnf Vdur IPs ${vnf_volumes_id} log @{ip_list} Should Be Equal ${ip_list} ${volumes_ip_list} IP addresses have changed after healing - ${id}= Get VNF VIM ID ${vnf_volumes_id} + ${id}= Get VNF VIM ID ${vnf_volumes_id} log ${id} Should Not Be Equal ${id} ${vdu_volumes_id} VDU id has not changed after healing - ${volumes_attached}= Get Server Property ${id} volumes_attached - ${match}= Get Regexp Matches ${volumes_attached} '([0-9a-f\-]+)' 1 + ${volumes_attached}= Get Server Property ${id} volumes_attached + ${match}= Get Regexp Matches ${volumes_attached} '([0-9a-f\-]+)' 1 Should Be Equal ${match}[0] ${volume_id} Volume id has changed after healing Sleep 30 seconds Wait for SSH daemon to be up ${stdout}= Execute Remote Command Check Rc Return Output ${vnf_volumes_ip_addr} ${username} ${password} ${privatekey} sudo lsblk -l - log ${stdout} + log ${stdout} ${lines}= Get Lines Containing String ${stdout} disk ${num_lines}= Get Line Count ${lines} - Run Keyword If ${num_lines} < ${vnf_num_volumes} Fail msg=Number of disks (${num_lines}) is less than specified in VDU (${vnf_num_volumes}) + Run Keyword If ${num_lines} < ${vnf_num_volumes} Fail msg=Number of disks (${num_lines}) is less than specified in VDU (${vnf_num_volumes}) Delete NS Instance @@ -179,9 +179,9 @@ Delete VNF Descriptors *** Keywords *** Suite Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim + [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim - Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_volumes_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_charm_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_volumes_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_charm_name} diff --git a/robot-systest/testsuite/heal_02-scale_vdu_healing.robot b/robot-systest/testsuite/heal_02-scale_vdu_healing.robot index 4dd145b..9fda7c8 100644 --- a/robot-systest/testsuite/heal_02-scale_vdu_healing.robot +++ b/robot-systest/testsuite/heal_02-scale_vdu_healing.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [HEAL-02] Healing of scaled charm VDUs +Documentation [HEAL-02] Healing of scaled charm VDUs Library OperatingSystem Library String @@ -64,18 +64,18 @@ ${success_return_code} 0 *** Test Cases *** Create VNF Descriptors - [Tags] prepare + [Tags] prepare Create VNFD '%{PACKAGES_FOLDER}/${vnfd_charm_pkg}' Create VNFD '%{PACKAGES_FOLDER}/${vnfd_volumes_pkg}' Create NS Descriptor - [Tags] prepare + [Tags] prepare Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Network Service Instance Test - [Tags] prepare + [Tags] prepare ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} Set Suite Variable ${ns_id} ${id} @@ -90,64 +90,64 @@ Get NS Id Scale Out Charm VNF - [Tags] prepare - ${vnf_id}= Get Vnf Id ${ns_id} ${vnf_charm_index} + [Tags] prepare + ${vnf_id}= Get Vnf Id ${ns_id} ${vnf_charm_index} Set Suite Variable ${vnf_charm_id} ${vnf_id} - @{vdur_list}= Get Vnf Vdur Names ${vnf_charm_id} - ${vdurs}= Get Length ${vdur_list} + @{vdur_list}= Get Vnf Vdur Names ${vnf_charm_id} + ${vdurs}= Get Length ${vdur_list} Set Suite Variable ${initial_vdur_count} ${vdurs} - Execute Manual VNF Scale ${ns_name} ${vnf_charm_index} ${vnf_charm_scaling_group} SCALE_OUT ${scale_wait_time} - @{vdur_list}= Get Vnf Vdur Names ${vnf_charm_id} - ${vdurs}= Get Length ${vdur_list} - Run Keyword Unless ${vdurs} == ${initial_vdur_count} + 1 Fail msg=There is no new VDU records in the VNF after Scale Out + Execute Manual VNF Scale ${ns_name} ${vnf_charm_index} ${vnf_charm_scaling_group} SCALE_OUT ${scale_wait_time} + @{vdur_list}= Get Vnf Vdur Names ${vnf_charm_id} + ${vdurs}= Get Length ${vdur_list} + Run Keyword Unless ${vdurs} == ${initial_vdur_count} + 1 Fail msg=There is no new VDU records in the VNF after Scale Out Get Charm VNF Info - [Tags] verify - Variable Should Exist ${ns_id} msg=NS is not available + [Tags] verify + Variable Should Exist ${ns_id} msg=NS is not available ${variables} Get Variables IF not "\${vnf_charm_id}" in "${variables}" - ${vnf_id}= Get Vnf Id ${ns_id} ${vnf_charm_index} + ${vnf_id}= Get Vnf Id ${ns_id} ${vnf_charm_index} Set Suite Variable ${vnf_charm_id} ${vnf_id} END - ${id}= Get VNF VIM ID ${vnf_charm_id} - @{vdu_charm_ids}= Split String ${id} + ${id}= Get VNF VIM ID ${vnf_charm_id} + @{vdu_charm_ids}= Split String ${id} Set Suite Variable @{vdu_charm_ids} @{vdu_charm_ids} log ${vdu_charm_ids}[1] - @{charm_ip_list}= Get Vnf Vdur IPs ${vnf_charm_id} + @{charm_ip_list}= Get Vnf Vdur IPs ${vnf_charm_id} Set Suite Variable @{charm_ip_list} @{charm_ip_list} Stop Charm VDU - [Tags] verify - Variable Should Exist @{vdu_charm_ids} msg=VDU is not available + [Tags] verify + Variable Should Exist @{vdu_charm_ids} msg=VDU is not available Stop Server ${vdu_charm_ids}[1] Sleep 15 Heal Charm VDU - [Tags] verify - Variable Should Exist ${vnf_charm_id} msg=VNF is not available + [Tags] verify + Variable Should Exist ${vnf_charm_id} msg=VNF is not available Heal Network Service ${ns_id} --vnf ${vnf_charm_id} --cause "Heal VM of charm_vnf" --vdu ${vdu_charm_name} --count-index 1 --run-day1 Check VNF After Healing - [Tags] verify - Variable Should Exist ${vnf_charm_id} msg=VNF is not available + [Tags] verify + Variable Should Exist ${vnf_charm_id} msg=VNF is not available - @{ip_list}= Get Vnf Vdur IPs ${vnf_charm_id} + @{ip_list}= Get Vnf Vdur IPs ${vnf_charm_id} Should Be Equal ${ip_list} ${charm_ip_list} IP addresses have changed after healing - ${id}= Get VNF VIM ID ${vnf_charm_id} - @{ids}= Split String ${id} + ${id}= Get VNF VIM ID ${vnf_charm_id} + @{ids}= Split String ${id} Should Be Equal ${vdu_charm_ids}[0] ${ids}[0] VDU[0] id has changed after healing Should Not Be Equal ${vdu_charm_ids}[1] ${ids}[1] VDU[1] id has not changed after healing Should Be Equal ${vdu_charm_ids}[2] ${ids}[2] VDU[2] id has changed after healing - ${ip}= Get Vdu Attribute ${vnf_charm_id} ip-address 1 + ${ip}= Get Vdu Attribute ${vnf_charm_id} ip-address 1 ${stdout}= Execute Remote Command Check Rc Return Output ${ip} ${username} ${password} ${privatekey} sudo ls ${vnf_charm_cloudinit_file} - log ${stdout} - Check If remote File Exists ${ip} ${username} ${password} ${privatekey} ${vnf_charm_day1_file} + log ${stdout} + Check If remote File Exists ${ip} ${username} ${password} ${privatekey} ${vnf_charm_day1_file} Delete NS Instance @@ -168,9 +168,9 @@ Delete VNF Descriptors *** Keywords *** Suite Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim + [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim - Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_volumes_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_charm_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_volumes_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_charm_name} diff --git a/robot-systest/testsuite/heal_03-multiple_healing.robot b/robot-systest/testsuite/heal_03-multiple_healing.robot index f321c1c..c6b9e24 100644 --- a/robot-systest/testsuite/heal_03-multiple_healing.robot +++ b/robot-systest/testsuite/heal_03-multiple_healing.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [HEAL-03] Healing of multiple VDUs +Documentation [HEAL-03] Healing of multiple VDUs Library OperatingSystem Library String @@ -64,18 +64,18 @@ ${success_return_code} 0 *** Test Cases *** Create VNF Descriptors - [Tags] prepare + [Tags] prepare Create VNFD '%{PACKAGES_FOLDER}/${vnfd_charm_pkg}' Create VNFD '%{PACKAGES_FOLDER}/${vnfd_volumes_pkg}' Create NS Descriptor - [Tags] prepare + [Tags] prepare Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Network Service Instance Test - [Tags] prepare + [Tags] prepare ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} Set Suite Variable ${ns_id} ${id} @@ -90,56 +90,56 @@ Get NS Id Scale Out Charm VNF - [Tags] prepare - ${vnf_id}= Get Vnf Id ${ns_id} ${vnf_charm_index} + [Tags] prepare + ${vnf_id}= Get Vnf Id ${ns_id} ${vnf_charm_index} Set Suite Variable ${vnf_charm_id} ${vnf_id} - @{vdur_list}= Get Vnf Vdur Names ${vnf_charm_id} - ${vdurs}= Get Length ${vdur_list} + @{vdur_list}= Get Vnf Vdur Names ${vnf_charm_id} + ${vdurs}= Get Length ${vdur_list} Set Suite Variable ${initial_vdur_count} ${vdurs} - Execute Manual VNF Scale ${ns_name} ${vnf_charm_index} ${vnf_charm_scaling_group} SCALE_OUT ${scale_wait_time} - @{vdur_list}= Get Vnf Vdur Names ${vnf_charm_id} - ${vdurs}= Get Length ${vdur_list} - Run Keyword Unless ${vdurs} == ${initial_vdur_count} + 1 Fail msg=There is no new VDU records in the VNF after Scale Out + Execute Manual VNF Scale ${ns_name} ${vnf_charm_index} ${vnf_charm_scaling_group} SCALE_OUT ${scale_wait_time} + @{vdur_list}= Get Vnf Vdur Names ${vnf_charm_id} + ${vdurs}= Get Length ${vdur_list} + Run Keyword Unless ${vdurs} == ${initial_vdur_count} + 1 Fail msg=There is no new VDU records in the VNF after Scale Out Get Charm VNF Info - [Tags] verify - Variable Should Exist ${ns_id} msg=NS is not available + [Tags] verify + Variable Should Exist ${ns_id} msg=NS is not available ${variables} Get Variables IF not "\${vnf_charm_id}" in "${variables}" - ${vnf_id}= Get Vnf Id ${ns_id} ${vnf_charm_index} + ${vnf_id}= Get Vnf Id ${ns_id} ${vnf_charm_index} Set Suite Variable ${vnf_charm_id} ${vnf_id} END - ${id}= Get VNF VIM ID ${vnf_charm_id} - @{vdu_charm_ids}= Split String ${id} + ${id}= Get VNF VIM ID ${vnf_charm_id} + @{vdu_charm_ids}= Split String ${id} Set Suite Variable @{vdu_charm_ids} @{vdu_charm_ids} log ${vdu_charm_ids}[1] - @{charm_ip_list}= Get Vnf Vdur IPs ${vnf_charm_id} + @{charm_ip_list}= Get Vnf Vdur IPs ${vnf_charm_id} Set Suite Variable @{charm_ip_list} @{charm_ip_list} Get Volume VNF Info - [Tags] verify - Variable Should Exist ${ns_id} msg=NS is not available - ${ip_addr}= Get Vnf Management Ip Address ${ns_id} ${vnf_several_index} + [Tags] verify + Variable Should Exist ${ns_id} msg=NS is not available + ${ip_addr}= Get Vnf Management Ip Address ${ns_id} ${vnf_several_index} log ${ip_addr} Set Suite Variable ${vnf_volumes_ip_addr} ${ip_addr} - ${vnf_id}= Get Vnf Id ${ns_id} ${vnf_several_index} + ${vnf_id}= Get Vnf Id ${ns_id} ${vnf_several_index} Set Suite Variable ${vnf_volumes_id} ${vnf_id} - ${id}= Get VNF VIM ID ${vnf_id} + ${id}= Get VNF VIM ID ${vnf_id} Set Suite Variable ${vdu_volumes_id} ${id} log ${vdu_volumes_id} - @{volumes_ip_list}= Get Vnf Vdur IPs ${vnf_volumes_id} + @{volumes_ip_list}= Get Vnf Vdur IPs ${vnf_volumes_id} Set Suite Variable @{volumes_ip_list} @{volumes_ip_list} log @{volumes_ip_list} Stop VDUs - [Tags] verify - Variable Should Exist @{vdu_charm_ids} msg=Charm VDUs are not available - Variable Should Exist ${vdu_volumes_id} msg=Volume VDU is not available + [Tags] verify + Variable Should Exist @{vdu_charm_ids} msg=Charm VDUs are not available + Variable Should Exist ${vdu_volumes_id} msg=Volume VDU is not available Stop Server ${vdu_charm_ids}[1] Stop Server ${vdu_charm_ids}[2] Stop Server ${vdu_volumes_id} @@ -147,29 +147,29 @@ Stop VDUs Heal VDUs - [Tags] verify - Variable Should Exist ${vnf_charm_id} msg=Charm VNF is not available - Variable Should Exist ${vnf_volumes_id} msg=Volume VNF is not available + [Tags] verify + Variable Should Exist ${vnf_charm_id} msg=Charm VNF is not available + Variable Should Exist ${vnf_volumes_id} msg=Volume VNF is not available Heal Network Service ${ns_id} --vnf ${vnf_volumes_id} --cause "Heal myvdu1 of several_volumes_vnf" --vdu several_volumes-VM --vnf ${vnf_charm_id} --cause "Heal two VMs of native_manual_scale_charm_vnf" --vdu mgmtVM --count-index 1 --run-day1 --vdu mgmtVM --count-index 2 Check VNFs After Healing - [Tags] verify - Variable Should Exist ${vnf_charm_id} msg=Charm VNF is not available - Variable Should Exist ${vnf_volumes_id} msg=Volume VNF is not available - ${id}= Get VNF VIM ID ${vnf_charm_id} - @{ids}= Split String ${id} + [Tags] verify + Variable Should Exist ${vnf_charm_id} msg=Charm VNF is not available + Variable Should Exist ${vnf_volumes_id} msg=Volume VNF is not available + ${id}= Get VNF VIM ID ${vnf_charm_id} + @{ids}= Split String ${id} Should Be Equal ${vdu_charm_ids}[0] ${ids}[0] VDU[0] id has changed after healing Should Not Be Equal ${vdu_charm_ids}[1] ${ids}[1] VDU[1] id has not changed after healing Should Not Be Equal ${vdu_charm_ids}[2] ${ids}[2] VDU[2] id has not changed after healing - ${id}= Get VNF VIM ID ${vnf_volumes_id} + ${id}= Get VNF VIM ID ${vnf_volumes_id} Should Not Be Equal ${id} ${vdu_volumes_id} VDU id has not changed after healing - ${ip}= Get Vdu Attribute ${vnf_charm_id} ip-address 1 + ${ip}= Get Vdu Attribute ${vnf_charm_id} ip-address 1 ${stdout}= Execute Remote Command Check Rc Return Output ${ip} ${username} ${password} ${privatekey} sudo ls ${vnf_charm_cloudinit_file} - log ${stdout} - Check If remote File Exists ${ip} ${username} ${password} ${privatekey} ${vnf_charm_day1_file} + log ${stdout} + Check If remote File Exists ${ip} ${username} ${password} ${privatekey} ${vnf_charm_day1_file} Delete NS Instance @@ -190,9 +190,9 @@ Delete VNF Descriptors *** Keywords *** Suite Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim + [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim - Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_volumes_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_charm_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_volumes_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_charm_name} diff --git a/robot-systest/testsuite/heal_04-autohealing.robot b/robot-systest/testsuite/heal_04-autohealing.robot index 73b8990..5518b11 100644 --- a/robot-systest/testsuite/heal_04-autohealing.robot +++ b/robot-systest/testsuite/heal_04-autohealing.robot @@ -1,140 +1,140 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -*** Settings *** -Documentation [HEAL-04] Autohealing of NS -Suite Teardown Run Keyword And Ignore Error Suite Cleanup -Force Tags heal_04 cluster_main daily regression -Library OperatingSystem -Library String -Library Collections -Library Process -Library SSHLibrary -Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnf_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/openstack_lib.robot - -*** Variables *** -# NS and VNF descriptor package folder and ids -${vnfd_pkg} autoheal_vnf -${vnfd_name} autoheal_vnfd -${vdu_name} autoheal_vnfd-VM -${vnf_index} autoheal-basic-1 -${nsd_pkg} autoheal_ns -${nsd_name} autoheal_nsd -# NS instance name and configuration -${ns_name} heal_04 -${ns_config} {vld: [ {name: mgmt, vim-network-name: %{VIM_MGMT_NET}} ] } - -# SSH keys and username to be used -${publickey} %{HOME}/.ssh/id_rsa.pub -${privatekey} %{HOME}/.ssh/id_rsa -${username} ubuntu -${password} ${EMPTY} - -${success_return_code} 0 - -#Healing wait time -${healing_pol_time} 15sec -${healing_max_wait_time} 10m - -*** Test Cases *** -Create VNF Descriptors - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' - - -Create NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' - - -Network Service Instance Test - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} - Set Suite Variable ${ns_id} ${id} - - -Get NS Id - [Tags] cleanup - ${variables} Get Variables - IF not "\${ns_id}" in "${variables}" - ${id}= Get Ns Id ${ns_name} - Set Suite Variable ${ns_id} ${id} - END - - -Get VNF Info - Variable Should Exist ${ns_id} msg=NS is not available - ${ip_addr}= Get Vnf Management Ip Address ${ns_id} ${vnf_index} - log ${ip_addr} - Set Suite Variable ${vnf_ip_addr} ${ip_addr} - - ${vnf_id}= Get Vnf Id ${ns_id} ${vnf_index} - Set Suite Variable ${vnf_autoheal_id} ${vnf_id} - ${id}= Get VNF VIM ID ${vnf_id} - Set Suite Variable ${vdu_autoheal_id} ${id} - log ${vdu_autoheal_id} - - @{autoheal_ip_list}= Get Vnf Vdur IPs ${vnf_autoheal_id} - Set Suite Variable @{autoheal_ip_list} @{autoheal_ip_list} - log @{autoheal_ip_list} - - -Stop Autoheal VDU - Variable Should Exist ${vdu_autoheal_id} msg=VDU is not available - Halt Server ${vdu_autoheal_id} - Sleep 30 - - -Wait For Autohealing To Be Completed - ${healing_max_wait_time}= Convert Time ${healing_max_wait_time} result_format=number - ${healing_max_wait_time}= Evaluate ${healing_max_wait_time} * ${vim_timeout_multiplier} - Wait Until Keyword Succeeds ${healing_max_wait_time} ${healing_pol_time} Get Operations By Type ${ns_id} heal - ${stdout}= Get Operations By Type ${ns_id} heal - Wait Until Keyword Succeeds ${healing_max_wait_time} ${healing_pol_time} Check For NS Operation Ended ${stdout} - Check For NS Operation Completed ${stdout} - - -Check VNF After Healing - Variable Should Exist ${vnf_autoheal_id} msg=VNF is not available - - @{ip_list}= Get Vnf Vdur IPs ${vnf_autoheal_id} - log @{ip_list} - Should Be Equal ${ip_list} ${autoheal_ip_list} IP addresses have changed after healing - - ${id}= Get VNF VIM ID ${vnf_autoheal_id} - log ${id} - Should Not Be Equal ${id} ${vdu_autoheal_id} VDU id has not changed after healing - - -Delete NS Instance - [Tags] cleanup - Delete NS ${ns_name} - - -Delete NS Descriptor - [Tags] cleanup - Delete NSD ${nsd_name} - - -Delete VNF Descriptors - [Tags] cleanup - Delete VNFD ${vnfd_name} - -*** Keywords *** -Suite Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim - - Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +*** Settings *** +Documentation [HEAL-04] Autohealing of NS +Suite Teardown Run Keyword And Ignore Error Suite Cleanup +Force Tags heal_04 cluster_main daily regression +Library OperatingSystem +Library String +Library Collections +Library Process +Library SSHLibrary +Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot +Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnf_lib.robot +Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot +Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot +Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot +Resource %{ROBOT_DEVOPS_FOLDER}/lib/openstack_lib.robot + +*** Variables *** +# NS and VNF descriptor package folder and ids +${vnfd_pkg} autoheal_vnf +${vnfd_name} autoheal_vnfd +${vdu_name} autoheal_vnfd-VM +${vnf_index} autoheal-basic-1 +${nsd_pkg} autoheal_ns +${nsd_name} autoheal_nsd +# NS instance name and configuration +${ns_name} heal_04 +${ns_config} {vld: [ {name: mgmt, vim-network-name: %{VIM_MGMT_NET}} ] } + +# SSH keys and username to be used +${publickey} %{HOME}/.ssh/id_rsa.pub +${privatekey} %{HOME}/.ssh/id_rsa +${username} ubuntu +${password} ${EMPTY} + +${success_return_code} 0 + +#Healing wait time +${healing_pol_time} 15sec +${healing_max_wait_time} 10m + +*** Test Cases *** +Create VNF Descriptors + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' + + +Create NS Descriptor + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + + +Network Service Instance Test + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} + Set Suite Variable ${ns_id} ${id} + + +Get NS Id + [Tags] cleanup + ${variables} Get Variables + IF not "\${ns_id}" in "${variables}" + ${id}= Get Ns Id ${ns_name} + Set Suite Variable ${ns_id} ${id} + END + + +Get VNF Info + Variable Should Exist ${ns_id} msg=NS is not available + ${ip_addr}= Get Vnf Management Ip Address ${ns_id} ${vnf_index} + log ${ip_addr} + Set Suite Variable ${vnf_ip_addr} ${ip_addr} + + ${vnf_id}= Get Vnf Id ${ns_id} ${vnf_index} + Set Suite Variable ${vnf_autoheal_id} ${vnf_id} + ${id}= Get VNF VIM ID ${vnf_id} + Set Suite Variable ${vdu_autoheal_id} ${id} + log ${vdu_autoheal_id} + + @{autoheal_ip_list}= Get Vnf Vdur IPs ${vnf_autoheal_id} + Set Suite Variable @{autoheal_ip_list} @{autoheal_ip_list} + log @{autoheal_ip_list} + + +Stop Autoheal VDU + Variable Should Exist ${vdu_autoheal_id} msg=VDU is not available + Halt Server ${vdu_autoheal_id} + Sleep 30 + + +Wait For Autohealing To Be Completed + ${healing_max_wait_time}= Convert Time ${healing_max_wait_time} result_format=number + ${healing_max_wait_time}= Evaluate ${healing_max_wait_time} * ${vim_timeout_multiplier} + Wait Until Keyword Succeeds ${healing_max_wait_time} ${healing_pol_time} Get Operations By Type ${ns_id} heal + ${stdout}= Get Operations By Type ${ns_id} heal + Wait Until Keyword Succeeds ${healing_max_wait_time} ${healing_pol_time} Check For NS Operation Ended ${stdout} + Check For NS Operation Completed ${stdout} + + +Check VNF After Healing + Variable Should Exist ${vnf_autoheal_id} msg=VNF is not available + + @{ip_list}= Get Vnf Vdur IPs ${vnf_autoheal_id} + log @{ip_list} + Should Be Equal ${ip_list} ${autoheal_ip_list} IP addresses have changed after healing + + ${id}= Get VNF VIM ID ${vnf_autoheal_id} + log ${id} + Should Not Be Equal ${id} ${vdu_autoheal_id} VDU id has not changed after healing + + +Delete NS Instance + [Tags] cleanup + Delete NS ${ns_name} + + +Delete NS Descriptor + [Tags] cleanup + Delete NSD ${nsd_name} + + +Delete VNF Descriptors + [Tags] cleanup + Delete VNFD ${vnfd_name} + +*** Keywords *** +Suite Cleanup + [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim + + Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/k8s_01-create_k8s_cluster.robot b/robot-systest/testsuite/k8s_01-create_k8s_cluster.robot index 6733c6c..210b772 100644 --- a/robot-systest/testsuite/k8s_01-create_k8s_cluster.robot +++ b/robot-systest/testsuite/k8s_01-create_k8s_cluster.robot @@ -13,7 +13,7 @@ # limitations under the License. *** Settings *** -Documentation [K8s-01] Create K8s cluster. +Documentation [K8s-01] Create K8s cluster. Library OperatingSystem Library String @@ -71,97 +71,97 @@ ${config_file} config.yaml *** Test Cases *** Render a template - ${stdout}= Render template %{ROBOT_DEVOPS_FOLDER}/resources/${template} %{ROBOT_DEVOPS_FOLDER}/resources/${config_file} IP_VM1=%{IP_VM1} IP_VM2=%{IP_VM2} IP_VM3=%{IP_VM3} IP_VM4=%{IP_VM4} IP_JUJU=%{IP_JUJU} NETWORK=%{VIM_MGMT_NET} - Log To Console \n${stdout} + ${stdout}= Render template %{ROBOT_DEVOPS_FOLDER}/resources/${template} %{ROBOT_DEVOPS_FOLDER}/resources/${config_file} IP_VM1=%{IP_VM1} IP_VM2=%{IP_VM2} IP_VM3=%{IP_VM3} IP_VM4=%{IP_VM4} IP_JUJU=%{IP_JUJU} NETWORK=%{VIM_MGMT_NET} + Log To Console \n${stdout} Create Controller VNF Descriptor - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg1}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg1}' Create Machines VNF Descriptor - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg2}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg2}' Create K8s Cluster NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate K8s Cluster Network Service - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ns_config=${EMPTY} publickey=${publickey} ns_launch_max_wait_time=70min config_file=%{ROBOT_DEVOPS_FOLDER}/resources/${config_file} - Set Suite Variable ${ns_id} ${id} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ns_config=${EMPTY} publickey=${publickey} ns_launch_max_wait_time=70min config_file=%{ROBOT_DEVOPS_FOLDER}/resources/${config_file} + Set Suite Variable ${ns_id} ${id} Get Management Ip Addresses - ${ip_addr_1} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1} - log ${ip_addr_1} - Set Suite Variable ${vnf_1_ip_addr} ${ip_addr_1} - ${ip_addr_2} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2} - log ${ip_addr_2} - Set Suite Variable ${vnf_2_ip_addr} ${ip_addr_2} - ${ip_addr_3} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_3} - log ${ip_addr_3} - Set Suite Variable ${vnf_3_ip_addr} ${ip_addr_3} - ${ip_addr_4} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_4} - log ${ip_addr_4} - Set Suite Variable ${vnf_4_ip_addr} ${ip_addr_4} - ${ip_addr_5} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_5} - log ${ip_addr_5} - Set Suite Variable ${vnf_5_ip_addr} ${ip_addr_5} + ${ip_addr_1} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1} + log ${ip_addr_1} + Set Suite Variable ${vnf_1_ip_addr} ${ip_addr_1} + ${ip_addr_2} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2} + log ${ip_addr_2} + Set Suite Variable ${vnf_2_ip_addr} ${ip_addr_2} + ${ip_addr_3} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_3} + log ${ip_addr_3} + Set Suite Variable ${vnf_3_ip_addr} ${ip_addr_3} + ${ip_addr_4} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_4} + log ${ip_addr_4} + Set Suite Variable ${vnf_4_ip_addr} ${ip_addr_4} + ${ip_addr_5} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_5} + log ${ip_addr_5} + Set Suite Variable ${vnf_5_ip_addr} ${ip_addr_5} Test SSH Access - Variable Should Exist ${vnf_1_ip_addr} msg=IP address of the management VNF '${vnf_member_index_1}' is not available - Variable Should Exist ${vnf_2_ip_addr} msg=IP address of the management VNF '${vnf_member_index_2}' is not available - Variable Should Exist ${vnf_3_ip_addr} msg=IP address of the management VNF '${vnf_member_index_3}' is not available - Variable Should Exist ${vnf_4_ip_addr} msg=IP address of the management VNF '${vnf_member_index_4}' is not available - Variable Should Exist ${vnf_5_ip_addr} msg=IP address of the management VNF '${vnf_member_index_5}' is not available - Sleep 30s Waiting ssh daemon to be up - Test SSH Connection ${vnf_1_ip_addr} ${username} ${password} ${privatekey} - Test SSH Connection ${vnf_2_ip_addr} ${username} ${password} ${privatekey} - Test SSH Connection ${vnf_3_ip_addr} ${username} ${password} ${privatekey} - Test SSH Connection ${vnf_4_ip_addr} ${username} ${password} ${privatekey} - Test SSH Connection ${vnf_5_ip_addr} ${username} ${password} ${privatekey} + Variable Should Exist ${vnf_1_ip_addr} msg=IP address of the management VNF '${vnf_member_index_1}' is not available + Variable Should Exist ${vnf_2_ip_addr} msg=IP address of the management VNF '${vnf_member_index_2}' is not available + Variable Should Exist ${vnf_3_ip_addr} msg=IP address of the management VNF '${vnf_member_index_3}' is not available + Variable Should Exist ${vnf_4_ip_addr} msg=IP address of the management VNF '${vnf_member_index_4}' is not available + Variable Should Exist ${vnf_5_ip_addr} msg=IP address of the management VNF '${vnf_member_index_5}' is not available + Sleep 30s Waiting ssh daemon to be up + Test SSH Connection ${vnf_1_ip_addr} ${username} ${password} ${privatekey} + Test SSH Connection ${vnf_2_ip_addr} ${username} ${password} ${privatekey} + Test SSH Connection ${vnf_3_ip_addr} ${username} ${password} ${privatekey} + Test SSH Connection ${vnf_4_ip_addr} ${username} ${password} ${privatekey} + Test SSH Connection ${vnf_5_ip_addr} ${username} ${password} ${privatekey} Check kubeconfig file - Check If remote File Exists ${vnf_5_ip_addr} ${username} ${password} ${privatekey} ${kubeconfig_file} + Check If remote File Exists ${vnf_5_ip_addr} ${username} ${password} ${privatekey} ${kubeconfig_file} Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete Controller VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name1} + Delete VNFD ${vnfd_name1} Delete Machines VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name2} + Delete VNFD ${vnfd_name2} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/k8s_02-k8scluster_creation.robot b/robot-systest/testsuite/k8s_02-k8scluster_creation.robot index b27ce70..6225913 100644 --- a/robot-systest/testsuite/k8s_02-k8scluster_creation.robot +++ b/robot-systest/testsuite/k8s_02-k8scluster_creation.robot @@ -13,7 +13,7 @@ # limitations under the License. *** Settings *** -Documentation [K8s-02] K8s cluster addition. +Documentation [K8s-02] K8s cluster addition. Library OperatingSystem Library String @@ -35,15 +35,15 @@ ${k8scluster_version} v1 *** Test Cases *** Add K8s Cluster To OSM - Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} %{VIM_TARGET} %{VIM_MGMT_NET} ${k8scluster_name} + Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} %{VIM_TARGET} %{VIM_MGMT_NET} ${k8scluster_name} Remove K8s Cluster from OSM [Tags] cleanup - Delete K8s Cluster ${k8scluster_name} + Delete K8s Cluster ${k8scluster_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suit Cleanup: Deleting K8s Cluster + [Documentation] Test Suit Cleanup: Deleting K8s Cluster - Run Keyword If Any Tests Failed Delete K8s Cluster ${k8scluster_name} + Run Keyword If Any Tests Failed Delete K8s Cluster ${k8scluster_name} diff --git a/robot-systest/testsuite/k8s_03-simple_k8s.robot b/robot-systest/testsuite/k8s_03-simple_k8s.robot index 366e552..a7d7e73 100644 --- a/robot-systest/testsuite/k8s_03-simple_k8s.robot +++ b/robot-systest/testsuite/k8s_03-simple_k8s.robot @@ -13,7 +13,7 @@ # limitations under the License. *** Settings *** -Documentation [K8s-03] Simple K8s. +Documentation [K8s-03] Simple K8s. Library OperatingSystem Library String @@ -64,17 +64,17 @@ Create Simple K8s Descriptor Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Add K8s Cluster To OSM - Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} %{VIM_TARGET} %{VIM_MGMT_NET} ${k8scluster_name} + Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} %{VIM_TARGET} %{VIM_MGMT_NET} ${k8scluster_name} Network Service K8s Instance Test - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} Set Suite Variable ${ns_id} ${id} Execute Day 2 Operations - [Documentation] Performs one Day 2 operation per VNF that creates a new file. + [Documentation] Performs one Day 2 operation per VNF that creates a new file. - Variable Should Exist ${ns_id} msg=Network service instance is not available - ${ns_op_id}= Execute NS K8s Action ${ns_name} ${action_name} ${vnf_member_index} ${kdu_name} application-name=${application_name} customtitle=${customtitle} + Variable Should Exist ${ns_id} msg=Network service instance is not available + ${ns_op_id}= Execute NS K8s Action ${ns_name} ${action_name} ${vnf_member_index} ${kdu_name} application-name=${application_name} customtitle=${customtitle} Delete NS K8s Instance Test [Tags] cleanup @@ -82,7 +82,7 @@ Delete NS K8s Instance Test Remove K8s Cluster from OSM [Tags] cleanup - Delete K8s Cluster ${k8scluster_name} + Delete K8s Cluster ${k8scluster_name} Delete NS Descriptor Test [Tags] cleanup @@ -100,8 +100,8 @@ Delete VNF NS Packages *** Keywords *** Suite Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim - Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} - Run Keyword If Any Tests Failed Delete K8s Cluster ${k8scluster_name} + [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim + Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete K8s Cluster ${k8scluster_name} diff --git a/robot-systest/testsuite/k8s_04-openldap_helm.robot b/robot-systest/testsuite/k8s_04-openldap_helm.robot index 5ce9ea3..96a1caa 100644 --- a/robot-systest/testsuite/k8s_04-openldap_helm.robot +++ b/robot-systest/testsuite/k8s_04-openldap_helm.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [K8s-04] Openldap Helm chart. +Documentation [K8s-04] Openldap Helm chart. Library OperatingSystem Library String @@ -58,20 +58,20 @@ ${action_param_dc} example.org *** Test Cases *** Create Package For OpenLDAP CNF - [Tags] prepare + [Tags] prepare Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' Create Package For OpenLDAP NS - [Tags] prepare + [Tags] prepare Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Add K8s Cluster To OSM - [Tags] prepare - Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} %{VIM_TARGET} %{VIM_MGMT_NET} ${k8scluster_name} + [Tags] prepare + Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} %{VIM_TARGET} %{VIM_MGMT_NET} ${k8scluster_name} Create Network Service Instance - [Tags] prepare - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} + [Tags] prepare + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} Get Ns Id [Tags] verify @@ -80,37 +80,37 @@ Get Ns Id Get Vnf Id [Tags] verify - Variable Should Exist ${ns_id} msg=Network service instance is not available - @{vnfr_list}= Get Ns Vnfr Ids ${ns_id} - Log List ${vnfr_list} - Set Suite Variable ${vnf_id} ${vnfr_list}[0] + Variable Should Exist ${ns_id} msg=Network service instance is not available + @{vnfr_list}= Get Ns Vnfr Ids ${ns_id} + Log List ${vnfr_list} + Set Suite Variable ${vnf_id} ${vnfr_list}[0] Execute Day 2 Operations - [Documentation] Performs one Day 2 operation. + [Documentation] Performs one Day 2 operation. - Variable Should Exist ${ns_id} msg=Network service instance is not available - ${ns_op_id}= Execute NS K8s Action ${ns_name} ${action_name} ${vnf_member_index} ${kdu_name} cn=${action_param_cn} dc=${action_param_dc} + Variable Should Exist ${ns_id} msg=Network service instance is not available + ${ns_op_id}= Execute NS K8s Action ${ns_name} ${action_name} ${vnf_member_index} ${kdu_name} cn=${action_param_cn} dc=${action_param_dc} Execute Upgrade Operation [Tags] verify - Variable Should Exist ${ns_id} msg=Network service instance is not available - ${ns_op_id}= Execute NS K8s Action ${ns_name} ${upgrade_action} ${vnf_member_index} ${kdu_name} replicaCount=${replica_count} + Variable Should Exist ${ns_id} msg=Network service instance is not available + ${ns_op_id}= Execute NS K8s Action ${ns_name} ${upgrade_action} ${vnf_member_index} ${kdu_name} replicaCount=${replica_count} Check Replicas After Upgrade Operation [Tags] verify - Variable Should Exist ${ns_id} msg=Network service instance is not available + Variable Should Exist ${ns_id} msg=Network service instance is not available ${count}= Get Vnf Kdu Replica Count ${vnf_id} ${kdu_name} log ${count} Should Be Equal As Integers ${count} ${replica_count} Execute Rollback Operation [Tags] verify - Variable Should Exist ${ns_id} msg=Network service instance is not available - ${ns_op_id}= Execute NS K8s Action ${ns_name} ${rollback_action} ${vnf_member_index} ${kdu_name} + Variable Should Exist ${ns_id} msg=Network service instance is not available + ${ns_op_id}= Execute NS K8s Action ${ns_name} ${rollback_action} ${vnf_member_index} ${kdu_name} Check Replicas After Rollback Operation [Tags] verify - Variable Should Exist ${ns_id} msg=Network service instance is not available + Variable Should Exist ${ns_id} msg=Network service instance is not available ${count}= Get Vnf Kdu Replica Count ${vnf_id} ${kdu_name} log ${count} Should Be Empty ${count} @@ -121,7 +121,7 @@ Delete Network Service Instance Remove K8s Cluster from OSM [Tags] cleanup - Delete K8s Cluster ${k8scluster_name} + Delete K8s Cluster ${k8scluster_name} Delete NS Descriptor Test [Tags] cleanup @@ -134,8 +134,8 @@ Delete VNF Descriptor Test *** Keywords *** Suite Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim - Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} - Run Keyword If Any Tests Failed Delete K8s Cluster ${k8scluster_name} + [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim + Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete K8s Cluster ${k8scluster_name} diff --git a/robot-systest/testsuite/k8s_05-k8s_proxy_charms.robot b/robot-systest/testsuite/k8s_05-k8s_proxy_charms.robot index b10098f..10ad9c5 100644 --- a/robot-systest/testsuite/k8s_05-k8s_proxy_charms.robot +++ b/robot-systest/testsuite/k8s_05-k8s_proxy_charms.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [K8s-05] K8s Proxy Charm. +Documentation [K8s-05] K8s Proxy Charm. Library OperatingSystem Library SSHLibrary @@ -55,87 +55,87 @@ ${day_2_file_name_2} /home/ubuntu/mytouch2 *** Test Cases *** Create Charm VNF Descriptor - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' Create Charm NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate Charm Network Service - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ${ns_timeout} - Set Suite Variable ${ns_id} ${id} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ${ns_timeout} + Set Suite Variable ${ns_id} ${id} Get Management Ip Addresses - ${ip_addr_1} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1} - log ${ip_addr_1} - Set Suite Variable ${vnf_1_ip_addr} ${ip_addr_1} - ${ip_addr_2} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2} - log ${ip_addr_2} - Set Suite Variable ${vnf_2_ip_addr} ${ip_addr_2} + ${ip_addr_1} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1} + log ${ip_addr_1} + Set Suite Variable ${vnf_1_ip_addr} ${ip_addr_1} + ${ip_addr_2} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2} + log ${ip_addr_2} + Set Suite Variable ${vnf_2_ip_addr} ${ip_addr_2} Test SSH Access - Variable Should Exist ${vnf_1_ip_addr} msg=IP address of the management VNF '${vnf_member_index_1}' is not available - Variable Should Exist ${vnf_2_ip_addr} msg=IP address of the management VNF '${vnf_member_index_2}' is not available - Sleep 30s Waiting ssh daemon to be up - Test SSH Connection ${vnf_1_ip_addr} ${username} ${password} ${privatekey} - Test SSH Connection ${vnf_2_ip_addr} ${username} ${password} ${privatekey} + Variable Should Exist ${vnf_1_ip_addr} msg=IP address of the management VNF '${vnf_member_index_1}' is not available + Variable Should Exist ${vnf_2_ip_addr} msg=IP address of the management VNF '${vnf_member_index_2}' is not available + Sleep 30s Waiting ssh daemon to be up + Test SSH Connection ${vnf_1_ip_addr} ${username} ${password} ${privatekey} + Test SSH Connection ${vnf_2_ip_addr} ${username} ${password} ${privatekey} Check Remote Files Created Via Day 1 Operations - [Documentation] The Charm VNF has a Day 1 operation that creates a file named ${day_1_file_name}. - ... This test checks whether that files have been created or not. + [Documentation] The Charm VNF has a Day 1 operation that creates a file named ${day_1_file_name}. + ... This test checks whether that files have been created or not. - Check If remote File Exists ${vnf_1_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name} - Check If remote File Exists ${vnf_2_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name} + Check If remote File Exists ${vnf_1_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name} + Check If remote File Exists ${vnf_2_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name} Execute Day 2 Operations - [Documentation] Performs one Day 2 operation per VNF that creates a new file. + [Documentation] Performs one Day 2 operation per VNF that creates a new file. - Variable Should Exist ${ns_id} msg=Network service instance is not available - ${ns_op_id_1}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index_1} filename=${day_2_file_name_1} - ${ns_op_id_2}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index_2} filename=${day_2_file_name_2} + Variable Should Exist ${ns_id} msg=Network service instance is not available + ${ns_op_id_1}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index_1} filename=${day_2_file_name_1} + ${ns_op_id_2}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index_2} filename=${day_2_file_name_2} Check Remote Files Created Via Day 2 Operations - [Documentation] Check whether the files created in the previous test via Day 2 operations exist or not. + [Documentation] Check whether the files created in the previous test via Day 2 operations exist or not. - Check If remote File Exists ${vnf_1_ip_addr} ${username} ${password} ${privatekey} ${day_2_file_name_1} - Check If remote File Exists ${vnf_2_ip_addr} ${username} ${password} ${privatekey} ${day_2_file_name_2} + Check If remote File Exists ${vnf_1_ip_addr} ${username} ${password} ${privatekey} ${day_2_file_name_1} + Check If remote File Exists ${vnf_2_ip_addr} ${username} ${password} ${privatekey} ${day_2_file_name_2} Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name} + Delete VNFD ${vnfd_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/k8s_06-k8s_secure_key_management.robot b/robot-systest/testsuite/k8s_06-k8s_secure_key_management.robot index 6b8d3cf..40611ab 100644 --- a/robot-systest/testsuite/k8s_06-k8s_secure_key_management.robot +++ b/robot-systest/testsuite/k8s_06-k8s_secure_key_management.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [K8s-06] K8s Secure Key Management. +Documentation [K8s-06] K8s Secure Key Management. Library OperatingSystem Library SSHLibrary @@ -56,17 +56,17 @@ ${ns_timeout} 15min *** Test Cases *** Create Charm VNF Descriptor [Tags] prepare - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' Create Charm NS Descriptor [Tags] prepare - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate Charm Network Service [Tags] prepare - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ${ns_timeout} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ${ns_timeout} Get Ns Id [Tags] verify @@ -75,74 +75,74 @@ Get Ns Id Get Management Ip Addresses [Tags] verify - ${ip_addr_1} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1} - log ${ip_addr_1} - Set Suite Variable ${vnf_1_ip_addr} ${ip_addr_1} - ${ip_addr_2} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2} - log ${ip_addr_2} - Set Suite Variable ${vnf_2_ip_addr} ${ip_addr_2} + ${ip_addr_1} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1} + log ${ip_addr_1} + Set Suite Variable ${vnf_1_ip_addr} ${ip_addr_1} + ${ip_addr_2} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2} + log ${ip_addr_2} + Set Suite Variable ${vnf_2_ip_addr} ${ip_addr_2} Test SSH Access [Tags] verify - Variable Should Exist ${vnf_1_ip_addr} msg=IP address of the management VNF '${vnf_member_index_1}' is not available - Variable Should Exist ${vnf_2_ip_addr} msg=IP address of the management VNF '${vnf_member_index_2}' is not available - Sleep 30s Waiting ssh daemon to be up - Test SSH Connection ${vnf_1_ip_addr} ${username} ${password} ${privatekey} - Test SSH Connection ${vnf_2_ip_addr} ${username} ${password} ${privatekey} + Variable Should Exist ${vnf_1_ip_addr} msg=IP address of the management VNF '${vnf_member_index_1}' is not available + Variable Should Exist ${vnf_2_ip_addr} msg=IP address of the management VNF '${vnf_member_index_2}' is not available + Sleep 30s Waiting ssh daemon to be up + Test SSH Connection ${vnf_1_ip_addr} ${username} ${password} ${privatekey} + Test SSH Connection ${vnf_2_ip_addr} ${username} ${password} ${privatekey} Check Remote Files Created Via Day 1 Operations [Tags] verify - [Documentation] The Charm VNF has a Day 1 operation that creates a file named ${day_1_file_name}. - ... This test checks whether that files have been created or not. + [Documentation] The Charm VNF has a Day 1 operation that creates a file named ${day_1_file_name}. + ... This test checks whether that files have been created or not. - Check If remote File Exists ${vnf_1_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name} - Check If remote File Exists ${vnf_2_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name} + Check If remote File Exists ${vnf_1_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name} + Check If remote File Exists ${vnf_2_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name} Execute Day 2 Operations [Tags] verify - [Documentation] Performs one Day 2 operation per VNF that creates a new file. + [Documentation] Performs one Day 2 operation per VNF that creates a new file. - Variable Should Exist ${ns_id} msg=Network service instance is not available - ${ns_op_id_1}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index_1} filename=${day_2_file_name_1} - ${ns_op_id_2}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index_2} filename=${day_2_file_name_2} + Variable Should Exist ${ns_id} msg=Network service instance is not available + ${ns_op_id_1}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index_1} filename=${day_2_file_name_1} + ${ns_op_id_2}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index_2} filename=${day_2_file_name_2} Check Remote Files Created Via Day 2 Operations [Tags] verify - [Documentation] Check whether the files created in the previous test via Day 2 operations exist or not. + [Documentation] Check whether the files created in the previous test via Day 2 operations exist or not. - Check If remote File Exists ${vnf_1_ip_addr} ${username} ${password} ${privatekey} ${day_2_file_name_1} - Check If remote File Exists ${vnf_2_ip_addr} ${username} ${password} ${privatekey} ${day_2_file_name_2} + Check If remote File Exists ${vnf_1_ip_addr} ${username} ${password} ${privatekey} ${day_2_file_name_1} + Check If remote File Exists ${vnf_2_ip_addr} ${username} ${password} ${privatekey} ${day_2_file_name_2} Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name} + Delete VNFD ${vnfd_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/k8s_07-dummy_helm.robot b/robot-systest/testsuite/k8s_07-dummy_helm.robot index 8669f07..c70f550 100644 --- a/robot-systest/testsuite/k8s_07-dummy_helm.robot +++ b/robot-systest/testsuite/k8s_07-dummy_helm.robot @@ -1,107 +1,107 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -*** Settings *** -Documentation [K8s-07] Openldap Helm in isolated cluster with dummy VIM. - -Library OperatingSystem -Library String -Library Collections -Library Process - -Resource %{ROBOT_DEVOPS_FOLDER}/lib/vim_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/connectivity_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/k8scluster_lib.robot - -Force Tags k8s_07 cluster_k8s daily regression - -Suite Teardown Run Keyword And Ignore Error Suite Cleanup - - -*** Variables *** -# VIM Configuration -${vim_name} k8s07_dummy -${vim_user} user -${vim_password} pass -${vim_auth_url} http://localhost/dummy -${vim_tenant} tenant -${vim_account_type} dummy - -# K8s cluster data -${k8scluster_name} k8s07 -${k8scluster_version} v1 -${k8scluster_net} null - -# NS and VNF descriptor package files -${vnfd_pkg} openldap_knf -${nsd_pkg} openldap_ns -${vnfd_name} openldap_knf -${nsd_name} openldap_ns - -# NS instance name -${ns_name} ldap - -${ns_id} ${EMPTY} -${ns_config} ${EMPTY} -${publickey} ${EMPTY} - - -*** Test Cases *** -Create Package For OpenLDAP CNF - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' - -Create Package For OpenLDAP NS - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' - -Create Dummy VIM - ${created_vim_account_id}= Create VIM Target ${vim_name} ${vim_user} ${vim_password} ${vim_auth_url} ${vim_tenant} ${vim_account_type} - -Add K8s Cluster To OSM - Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} ${vim_name} ${k8scluster_net} ${k8scluster_name} - -Create Network Service Instance - ${id}= Create Network Service ${nsd_name} ${vim_name} ${ns_name} ${ns_config} ${publickey} - Set Suite Variable ${ns_id} ${id} - -Delete Network Service Instance - [Tags] cleanup - Delete NS ${ns_name} - -Remove K8s Cluster from OSM - [Tags] cleanup - Delete K8s Cluster ${k8scluster_name} - -Delete VIM - [Tags] cleanup - Delete VIM Target ${vim_name} - -Delete NS Descriptor Test - [Tags] cleanup - Delete NSD ${nsd_name} - -Delete VNF Descriptor Test - [Tags] cleanup - Delete VNFD ${vnfd_name} - - -*** Keywords *** -Suite Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptor, instance, cluster and vim - Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} - Run Keyword If Any Tests Failed Delete K8s Cluster ${k8scluster_name} - Run Keyword If Any Tests Failed Delete VIM Target ${vim_name} +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +*** Settings *** +Documentation [K8s-07] Openldap Helm in isolated cluster with dummy VIM. + +Library OperatingSystem +Library String +Library Collections +Library Process + +Resource %{ROBOT_DEVOPS_FOLDER}/lib/vim_lib.robot +Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot +Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot +Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot +Resource %{ROBOT_DEVOPS_FOLDER}/lib/connectivity_lib.robot +Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot +Resource %{ROBOT_DEVOPS_FOLDER}/lib/k8scluster_lib.robot + +Force Tags k8s_07 cluster_k8s daily regression + +Suite Teardown Run Keyword And Ignore Error Suite Cleanup + + +*** Variables *** +# VIM Configuration +${vim_name} k8s07_dummy +${vim_user} user +${vim_password} pass +${vim_auth_url} http://localhost/dummy +${vim_tenant} tenant +${vim_account_type} dummy + +# K8s cluster data +${k8scluster_name} k8s07 +${k8scluster_version} v1 +${k8scluster_net} null + +# NS and VNF descriptor package files +${vnfd_pkg} openldap_knf +${nsd_pkg} openldap_ns +${vnfd_name} openldap_knf +${nsd_name} openldap_ns + +# NS instance name +${ns_name} ldap + +${ns_id} ${EMPTY} +${ns_config} ${EMPTY} +${publickey} ${EMPTY} + + +*** Test Cases *** +Create Package For OpenLDAP CNF + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' + +Create Package For OpenLDAP NS + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + +Create Dummy VIM + ${created_vim_account_id}= Create VIM Target ${vim_name} ${vim_user} ${vim_password} ${vim_auth_url} ${vim_tenant} ${vim_account_type} + +Add K8s Cluster To OSM + Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} ${vim_name} ${k8scluster_net} ${k8scluster_name} + +Create Network Service Instance + ${id}= Create Network Service ${nsd_name} ${vim_name} ${ns_name} ${ns_config} ${publickey} + Set Suite Variable ${ns_id} ${id} + +Delete Network Service Instance + [Tags] cleanup + Delete NS ${ns_name} + +Remove K8s Cluster from OSM + [Tags] cleanup + Delete K8s Cluster ${k8scluster_name} + +Delete VIM + [Tags] cleanup + Delete VIM Target ${vim_name} + +Delete NS Descriptor Test + [Tags] cleanup + Delete NSD ${nsd_name} + +Delete VNF Descriptor Test + [Tags] cleanup + Delete VNFD ${vnfd_name} + + +*** Keywords *** +Suite Cleanup + [Documentation] Test Suit Cleanup: Deleting Descriptor, instance, cluster and vim + Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete K8s Cluster ${k8scluster_name} + Run Keyword If Any Tests Failed Delete VIM Target ${vim_name} diff --git a/robot-systest/testsuite/k8s_08-simple_k8s_scaling.robot b/robot-systest/testsuite/k8s_08-simple_k8s_scaling.robot index e8d2315..a172dac 100644 --- a/robot-systest/testsuite/k8s_08-simple_k8s_scaling.robot +++ b/robot-systest/testsuite/k8s_08-simple_k8s_scaling.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [K8s-08] Simple K8s Scale. +Documentation [K8s-08] Simple K8s Scale. Library OperatingSystem Library String @@ -68,48 +68,48 @@ Create Simple K8s Scale NS Descriptor Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Add K8s Cluster To OSM - Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} %{VIM_TARGET} %{VIM_MGMT_NET} ${k8scluster_name} + Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} %{VIM_TARGET} %{VIM_MGMT_NET} ${k8scluster_name} Network Service K8s Instance Test - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} Set Suite Variable ${ns_id} ${id} Get KDU Model Name - [Documentation] Get the model name of the network service k8s instance + [Documentation] Get the model name of the network service k8s instance - Variable Should Exist ${ns_id} msg=Network service instance is not available + Variable Should Exist ${ns_id} msg=Network service instance is not available ${name}= Get Model Name %{OSM_HOSTNAME} ${username} ${password} ${privatekey} ${ns_id} ${kdu_name} Set Suite Variable ${model_name} ${name} Get Scale Count Before Scale Out - [Documentation] Get the scale count of the application of network service k8s instance + [Documentation] Get the scale count of the application of network service k8s instance - Variable Should Exist ${model_name} msg=Model name is not available - ${kdu_count}= Get Scale Number %{OSM_HOSTNAME} ${username} ${password} ${privatekey} ${application_name} ${model_name} - Set Suite Variable ${initial_kdu_count} ${kdu_count} + Variable Should Exist ${model_name} msg=Model name is not available + ${kdu_count}= Get Scale Number %{OSM_HOSTNAME} ${username} ${password} ${privatekey} ${application_name} ${model_name} + Set Suite Variable ${initial_kdu_count} ${kdu_count} Perform Manual KDU Scale Out - [Documentation] Scale out the application of network service k8s instance. + [Documentation] Scale out the application of network service k8s instance. - ${ns_op_id_2}= Execute Manual VNF Scale ${ns_name} ${vnf_member_index} ${scaling_group} SCALE_OUT + ${ns_op_id_2}= Execute Manual VNF Scale ${ns_name} ${vnf_member_index} ${scaling_group} SCALE_OUT Check Scale Count After Scale Out - [Documentation] Check whether the scale count is more than one. + [Documentation] Check whether the scale count is more than one. - Variable Should Exist ${initial_kdu_count} msg=Initial KDU count is not available - ${kdu_count}= Get Scale Number %{OSM_HOSTNAME} ${username} ${password} ${privatekey} ${application_name} ${model_name} - Run Keyword Unless ${kdu_count} == ${initial_kdu_count} + 1 Fail msg=There is no new KDU in the model after Scale Out + Variable Should Exist ${initial_kdu_count} msg=Initial KDU count is not available + ${kdu_count}= Get Scale Number %{OSM_HOSTNAME} ${username} ${password} ${privatekey} ${application_name} ${model_name} + Run Keyword Unless ${kdu_count} == ${initial_kdu_count} + 1 Fail msg=There is no new KDU in the model after Scale Out Perform Manual KDU Scale In - [Documentation] Scale in the application of network service k8s instance. + [Documentation] Scale in the application of network service k8s instance. - ${ns_op_id_3}= Execute Manual VNF Scale ${ns_name} ${vnf_member_index} ${scaling_group} SCALE_IN + ${ns_op_id_3}= Execute Manual VNF Scale ${ns_name} ${vnf_member_index} ${scaling_group} SCALE_IN Check Scale Count After Scale In - [Documentation] Check whether the scale count is one less. + [Documentation] Check whether the scale count is one less. - ${kdu_count}= Get Scale Number %{OSM_HOSTNAME} ${username} ${password} ${privatekey} ${application_name} ${model_name} - Run Keyword Unless ${kdu_count} == ${initial_kdu_count} Fail msg=There is the same number of KDU in the model after Scale In + ${kdu_count}= Get Scale Number %{OSM_HOSTNAME} ${username} ${password} ${privatekey} ${application_name} ${model_name} + Run Keyword Unless ${kdu_count} == ${initial_kdu_count} Fail msg=There is the same number of KDU in the model after Scale In Delete NS K8s Instance Test [Tags] cleanup @@ -117,7 +117,7 @@ Delete NS K8s Instance Test Remove K8s Cluster from OSM [Tags] cleanup - Delete K8s Cluster ${k8scluster_name} + Delete K8s Cluster ${k8scluster_name} Delete NS Descriptor Test [Tags] cleanup @@ -130,8 +130,8 @@ Delete VNF Descriptor Test *** Keywords *** Suite Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim - Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} - Run Keyword If Any Tests Failed Delete K8s Cluster ${k8scluster_name} + [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim + Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete K8s Cluster ${k8scluster_name} diff --git a/robot-systest/testsuite/k8s_09-pebble_charm_k8s.robot b/robot-systest/testsuite/k8s_09-pebble_charm_k8s.robot index f450c41..6e0ee5a 100644 --- a/robot-systest/testsuite/k8s_09-pebble_charm_k8s.robot +++ b/robot-systest/testsuite/k8s_09-pebble_charm_k8s.robot @@ -13,7 +13,7 @@ # limitations under the License. *** Settings *** -Documentation [K8s-09] Pebble Charm. +Documentation [K8s-09] Pebble Charm. Library OperatingSystem Library String @@ -64,17 +64,17 @@ Create Simple K8s Descriptor Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Add K8s Cluster To OSM - Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} %{VIM_TARGET} %{VIM_MGMT_NET} ${k8scluster_name} + Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} %{VIM_TARGET} %{VIM_MGMT_NET} ${k8scluster_name} Network Service K8s Instance Test - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} Set Suite Variable ${ns_id} ${id} Execute Day 2 Operations - [Documentation] Performs one Day 2 operation per VNF that creates a new file. + [Documentation] Performs one Day 2 operation per VNF that creates a new file. - Variable Should Exist ${ns_id} msg=Network service instance is not available - ${ns_op_id}= Execute NS K8s Action ${ns_name} ${action_name} ${vnf_member_index} ${kdu_name} application-name=${application_name} + Variable Should Exist ${ns_id} msg=Network service instance is not available + ${ns_op_id}= Execute NS K8s Action ${ns_name} ${action_name} ${vnf_member_index} ${kdu_name} application-name=${application_name} Delete NS K8s Instance Test [Tags] cleanup @@ -82,7 +82,7 @@ Delete NS K8s Instance Test Remove K8s Cluster from OSM [Tags] cleanup - Delete K8s Cluster ${k8scluster_name} + Delete K8s Cluster ${k8scluster_name} Delete NS Descriptor Test [Tags] cleanup @@ -100,8 +100,8 @@ Delete VNF NS Packages *** Keywords *** Suite Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim - Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} - Run Keyword If Any Tests Failed Delete K8s Cluster ${k8scluster_name} + [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim + Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete K8s Cluster ${k8scluster_name} diff --git a/robot-systest/testsuite/k8s_10-sol004_sol007_with_k8s_proxy_charms.robot b/robot-systest/testsuite/k8s_10-sol004_sol007_with_k8s_proxy_charms.robot index 68d5cce..b804aee 100644 --- a/robot-systest/testsuite/k8s_10-sol004_sol007_with_k8s_proxy_charms.robot +++ b/robot-systest/testsuite/k8s_10-sol004_sol007_with_k8s_proxy_charms.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [K8s-10] K8s Proxy Charm using SOL004 and SOL007 packages. +Documentation [K8s-10] K8s Proxy Charm using SOL004 and SOL007 packages. Library OperatingSystem Library SSHLibrary @@ -55,87 +55,87 @@ ${day_2_file_name_2} /home/ubuntu/mytouch2 *** Test Cases *** Create Charm VNF Descriptor - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' Create Charm NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate Charm Network Service - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ${ns_timeout} - Set Suite Variable ${ns_id} ${id} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ${ns_timeout} + Set Suite Variable ${ns_id} ${id} Get Management Ip Addresses - ${ip_addr_1} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1} - log ${ip_addr_1} - Set Suite Variable ${vnf_1_ip_addr} ${ip_addr_1} - ${ip_addr_2} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2} - log ${ip_addr_2} - Set Suite Variable ${vnf_2_ip_addr} ${ip_addr_2} + ${ip_addr_1} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1} + log ${ip_addr_1} + Set Suite Variable ${vnf_1_ip_addr} ${ip_addr_1} + ${ip_addr_2} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2} + log ${ip_addr_2} + Set Suite Variable ${vnf_2_ip_addr} ${ip_addr_2} Test SSH Access - Variable Should Exist ${vnf_1_ip_addr} msg=IP address of the management VNF '${vnf_member_index_1}' is not available - Variable Should Exist ${vnf_2_ip_addr} msg=IP address of the management VNF '${vnf_member_index_2}' is not available - Sleep 30s Waiting ssh daemon to be up - Test SSH Connection ${vnf_1_ip_addr} ${username} ${password} ${privatekey} - Test SSH Connection ${vnf_2_ip_addr} ${username} ${password} ${privatekey} + Variable Should Exist ${vnf_1_ip_addr} msg=IP address of the management VNF '${vnf_member_index_1}' is not available + Variable Should Exist ${vnf_2_ip_addr} msg=IP address of the management VNF '${vnf_member_index_2}' is not available + Sleep 30s Waiting ssh daemon to be up + Test SSH Connection ${vnf_1_ip_addr} ${username} ${password} ${privatekey} + Test SSH Connection ${vnf_2_ip_addr} ${username} ${password} ${privatekey} Check Remote Files Created Via Day 1 Operations - [Documentation] The Charm VNF has a Day 1 operation that creates a file named ${day_1_file_name}. - ... This test checks whether that files have been created or not. + [Documentation] The Charm VNF has a Day 1 operation that creates a file named ${day_1_file_name}. + ... This test checks whether that files have been created or not. - Check If remote File Exists ${vnf_1_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name} - Check If remote File Exists ${vnf_2_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name} + Check If remote File Exists ${vnf_1_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name} + Check If remote File Exists ${vnf_2_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name} Execute Day 2 Operations - [Documentation] Performs one Day 2 operation per VNF that creates a new file. + [Documentation] Performs one Day 2 operation per VNF that creates a new file. - Variable Should Exist ${ns_id} msg=Network service instance is not available - ${ns_op_id_1}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index_1} filename=${day_2_file_name_1} - ${ns_op_id_2}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index_2} filename=${day_2_file_name_2} + Variable Should Exist ${ns_id} msg=Network service instance is not available + ${ns_op_id_1}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index_1} filename=${day_2_file_name_1} + ${ns_op_id_2}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index_2} filename=${day_2_file_name_2} Check Remote Files Created Via Day 2 Operations - [Documentation] Check whether the files created in the previous test via Day 2 operations exist or not. + [Documentation] Check whether the files created in the previous test via Day 2 operations exist or not. - Check If remote File Exists ${vnf_1_ip_addr} ${username} ${password} ${privatekey} ${day_2_file_name_1} - Check If remote File Exists ${vnf_2_ip_addr} ${username} ${password} ${privatekey} ${day_2_file_name_2} + Check If remote File Exists ${vnf_1_ip_addr} ${username} ${password} ${privatekey} ${day_2_file_name_1} + Check If remote File Exists ${vnf_2_ip_addr} ${username} ${password} ${privatekey} ${day_2_file_name_2} Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name} + Delete VNFD ${vnfd_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/k8s_11-simple_helm_k8s_scaling.robot b/robot-systest/testsuite/k8s_11-simple_helm_k8s_scaling.robot index 78611e5..528a647 100644 --- a/robot-systest/testsuite/k8s_11-simple_helm_k8s_scaling.robot +++ b/robot-systest/testsuite/k8s_11-simple_helm_k8s_scaling.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [K8s-11] Simple Helm K8s Scale. +Documentation [K8s-11] Simple Helm K8s Scale. Library OperatingSystem Library String @@ -65,49 +65,49 @@ Create Simple K8s Scale NS Descriptor Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Add K8s Cluster To OSM - Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} %{VIM_TARGET} %{VIM_MGMT_NET} ${k8scluster_name} + Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} %{VIM_TARGET} %{VIM_MGMT_NET} ${k8scluster_name} Create Network Service Instance - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} Set Suite Variable ${ns_id} ${id} Get Vnf Id - Variable Should Exist ${ns_id} msg=Network service instance is not available - @{vnfr_list}= Get Ns Vnfr Ids ${ns_id} - Log List ${vnfr_list} - Set Suite Variable ${vnf_id} ${vnfr_list}[0] + Variable Should Exist ${ns_id} msg=Network service instance is not available + @{vnfr_list}= Get Ns Vnfr Ids ${ns_id} + Log List ${vnfr_list} + Set Suite Variable ${vnf_id} ${vnfr_list}[0] Get Scale Count Before Scale Out - [Documentation] Get the scale count of the application of network service k8s instance + [Documentation] Get the scale count of the application of network service k8s instance - Variable Should Exist ${ns_id} msg=Network service instance is not available + Variable Should Exist ${ns_id} msg=Network service instance is not available ${kdu_count}= Get Vnf Kdu Replica Count ${vnf_id} ${kdu_name} log ${kdu_count} - Set Suite Variable ${initial_kdu_count} ${kdu_count} + Set Suite Variable ${initial_kdu_count} ${kdu_count} Perform Manual KDU Scale Out - [Documentation] Scale out the application of network service k8s instance. + [Documentation] Scale out the application of network service k8s instance. - ${ns_op_id_1}= Execute Manual VNF Scale ${ns_name} ${vnf_member_index} ${scaling_group} SCALE_OUT + ${ns_op_id_1}= Execute Manual VNF Scale ${ns_name} ${vnf_member_index} ${scaling_group} SCALE_OUT Check Scale Count After Scale Out - [Documentation] Check whether the scale count is more than one. + [Documentation] Check whether the scale count is more than one. - Variable Should Exist ${initial_kdu_count} msg=Initial KDU count is not available + Variable Should Exist ${initial_kdu_count} msg=Initial KDU count is not available ${kdu_count}= Get Vnf Kdu Replica Count ${vnf_id} ${kdu_name} log ${kdu_count} - Run Keyword Unless ${kdu_count} == ${initial_kdu_count} + 2 Fail msg=There is no new KDU in the model after Scale Out + Run Keyword Unless ${kdu_count} == ${initial_kdu_count} + 2 Fail msg=There is no new KDU in the model after Scale Out Perform Manual KDU Scale In - [Documentation] Scale in the application of network service k8s instance. + [Documentation] Scale in the application of network service k8s instance. - ${ns_op_id_2}= Execute Manual VNF Scale ${ns_name} ${vnf_member_index} ${scaling_group} SCALE_IN + ${ns_op_id_2}= Execute Manual VNF Scale ${ns_name} ${vnf_member_index} ${scaling_group} SCALE_IN Check Scale Count After Scale In - [Documentation] Check whether the scale count is one less. + [Documentation] Check whether the scale count is one less. ${kdu_count}= Get Vnf Kdu Replica Count ${vnf_id} ${kdu_name} - Run Keyword Unless ${kdu_count} == ${initial_kdu_count} Fail msg=There is the same number of KDU in the model after Scale In + Run Keyword Unless ${kdu_count} == ${initial_kdu_count} Fail msg=There is the same number of KDU in the model after Scale In Delete NS K8s Instance Test [Tags] cleanup @@ -115,7 +115,7 @@ Delete NS K8s Instance Test Remove K8s Cluster from OSM [Tags] cleanup - Delete K8s Cluster ${k8scluster_name} + Delete K8s Cluster ${k8scluster_name} Delete NS Descriptor Test [Tags] cleanup @@ -128,8 +128,8 @@ Delete VNF Descriptor Test *** Keywords *** Suite Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim - Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} - Run Keyword If Any Tests Failed Delete K8s Cluster ${k8scluster_name} + [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim + Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete K8s Cluster ${k8scluster_name} diff --git a/robot-systest/testsuite/quotas_01-quota_enforcement.robot b/robot-systest/testsuite/quotas_01-quota_enforcement.robot index c0a5043..229a60c 100644 --- a/robot-systest/testsuite/quotas_01-quota_enforcement.robot +++ b/robot-systest/testsuite/quotas_01-quota_enforcement.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [QUOTAS-01] Quota enforcement. +Documentation [QUOTAS-01] Quota enforcement. Library OperatingSystem Library String @@ -88,8 +88,8 @@ Change First Project Name to Third Project Name Create VNFDs On Third Project Until Exceed Quota - Create VNFD In Project ${project_3_name} ${vnfd_pkg} ${user_name} ${user_password} override='id=v1;product-name=v1' - Run Keyword And Expect Error * Create VNFD In Project ${project_3_name} ${vnfd_pkg} ${user_name} ${user_password} override='id=v2;product-name=v2' + Create VNFD In Project ${project_3_name} ${vnfd_pkg} ${user_name} ${user_password} override='id=v1;product-name=v1' + Run Keyword And Expect Error * Create VNFD In Project ${project_3_name} ${vnfd_pkg} ${user_name} ${user_password} override='id=v2;product-name=v2' Increase Third Project Quotas @@ -101,17 +101,17 @@ Increase Third Project Quotas Create More VNFDs On Third Project Until Exceed Quota - Create VNFD In Project ${project_3_name} ${vnfd_pkg} ${user_name} ${user_password} override='id=v2;product-name=v2' - Create VNFD In Project ${project_3_name} ${vnfd_pkg} ${user_name} ${user_password} override='id=v3;product-name=v3' - Create VNFD In Project ${project_3_name} ${vnfd_pkg} ${user_name} ${user_password} override='id=v4;product-name=v4' - Create VNFD In Project ${project_3_name} ${vnfd_pkg} ${user_name} ${user_password} override='id=v5;product-name=v5' - Run Keyword And Expect Error * Create VNFD In Project ${project_3_name} ${vnfd_pkg} ${user_name} ${user_password} override='id=v6;product-name=v6' + Create VNFD In Project ${project_3_name} ${vnfd_pkg} ${user_name} ${user_password} override='id=v2;product-name=v2' + Create VNFD In Project ${project_3_name} ${vnfd_pkg} ${user_name} ${user_password} override='id=v3;product-name=v3' + Create VNFD In Project ${project_3_name} ${vnfd_pkg} ${user_name} ${user_password} override='id=v4;product-name=v4' + Create VNFD In Project ${project_3_name} ${vnfd_pkg} ${user_name} ${user_password} override='id=v5;product-name=v5' + Run Keyword And Expect Error * Create VNFD In Project ${project_3_name} ${vnfd_pkg} ${user_name} ${user_password} override='id=v6;product-name=v6' Create VNFDs On Second Project Until Exceed Quota - Create VNFD In Project ${project_2_name} ${vnfd_pkg} ${user_name} ${user_password} override='id=vp2_1;product-name=vp2_1' - Run Keyword And Expect Error * Create VNFD In Project ${project_2_name} ${vnfd_pkg} ${user_name} ${user_password} override='id=vp2_2;product-name=vp2_2' + Create VNFD In Project ${project_2_name} ${vnfd_pkg} ${user_name} ${user_password} override='id=vp2_1;product-name=vp2_1' + Run Keyword And Expect Error * Create VNFD In Project ${project_2_name} ${vnfd_pkg} ${user_name} ${user_password} override='id=vp2_2;product-name=vp2_2' Check Project Scopes @@ -127,25 +127,25 @@ Check Project Scopes Delete Second Project VNFD [Tags] cleanup - Delete VNFD In Project ${project_2_name} vp2_1 ${user_name} ${user_password} + Delete VNFD In Project ${project_2_name} vp2_1 ${user_name} ${user_password} Delete Third Project VNFDs [Tags] cleanup - Delete VNFD In Project ${project_3_name} v1 ${user_name} ${user_password} - Delete VNFD In Project ${project_3_name} v2 ${user_name} ${user_password} - Delete VNFD In Project ${project_3_name} v3 ${user_name} ${user_password} - Delete VNFD In Project ${project_3_name} v4 ${user_name} ${user_password} - Delete VNFD In Project ${project_3_name} v5 ${user_name} ${user_password} + Delete VNFD In Project ${project_3_name} v1 ${user_name} ${user_password} + Delete VNFD In Project ${project_3_name} v2 ${user_name} ${user_password} + Delete VNFD In Project ${project_3_name} v3 ${user_name} ${user_password} + Delete VNFD In Project ${project_3_name} v4 ${user_name} ${user_password} + Delete VNFD In Project ${project_3_name} v5 ${user_name} ${user_password} Delete Second Project After Removing User From It [Tags] cleanup - Run Keyword And Expect Error * Delete Project ${project_2_name} - Remove User From Project ${user_name} ${project_2_name} - Delete Project ${project_2_name} + Run Keyword And Expect Error * Delete Project ${project_2_name} + Remove User From Project ${user_name} ${project_2_name} + Delete Project ${project_2_name} Delete Projects User @@ -157,18 +157,18 @@ Delete Projects User Delete Third Project [Tags] cleanup - Delete Project ${project_3_name} + Delete Project ${project_3_name} *** Keywords *** Suite Cleanup - Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete VNFD In Project ${project_2_name} vp2_1 ${user_name} ${user_password} - Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete VNFD In Project ${project_3_name} v1 ${user_name} ${user_password} - Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete VNFD In Project ${project_3_name} v2 ${user_name} ${user_password} - Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete VNFD In Project ${project_3_name} v3 ${user_name} ${user_password} - Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete VNFD In Project ${project_3_name} v4 ${user_name} ${user_password} - Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete VNFD In Project ${project_3_name} v5 ${user_name} ${user_password} - Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete Project ${project_1_name} - Run Keyword If Any Tests Failed Delete Project ${project_2_name} - Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete Project ${project_3_name} + Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete VNFD In Project ${project_2_name} vp2_1 ${user_name} ${user_password} + Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete VNFD In Project ${project_3_name} v1 ${user_name} ${user_password} + Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete VNFD In Project ${project_3_name} v2 ${user_name} ${user_password} + Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete VNFD In Project ${project_3_name} v3 ${user_name} ${user_password} + Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete VNFD In Project ${project_3_name} v4 ${user_name} ${user_password} + Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete VNFD In Project ${project_3_name} v5 ${user_name} ${user_password} + Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete Project ${project_1_name} + Run Keyword If Any Tests Failed Delete Project ${project_2_name} + Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete Project ${project_3_name} Run And Return RC osm user-delete ${user_name} diff --git a/robot-systest/testsuite/sa_01-vnf_with_vim_metrics.robot b/robot-systest/testsuite/sa_01-vnf_with_vim_metrics.robot index 49b9273..0eb546b 100644 --- a/robot-systest/testsuite/sa_01-vnf_with_vim_metrics.robot +++ b/robot-systest/testsuite/sa_01-vnf_with_vim_metrics.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [SA-01] VNF with VIM-based metrics. +Documentation [SA-01] VNF with VIM-based metrics. Library OperatingSystem Library String @@ -37,60 +37,60 @@ ${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } *** Test Cases *** Create VNF Descriptor - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' Create NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate Network Service - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} - Set Suite Variable ${ns_id} ${id} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} + Set Suite Variable ${ns_id} ${id} Get VNF VIM-based Metrics - Variable Should Exist ${prometheus_poll_retries} msg=Metric polling retries is not available - Variable Should Exist ${prometheus_poll_timeout} msg=Metric polling timeout is not available - Variable Should Exist ${prometheus_host} msg=Prometheus address is not available - Variable Should Exist ${prometheus_port} msg=Prometheus port is not available - Variable Should Exist ${metric_1_name} msg=Prometheus first metric name is not available - Variable Should Exist ${metric_2_name} msg=Prometheus second metric name is not available - ${metric_1_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${metric_1_name} - Run Keyword Unless ${metric_1_value} > 0 Fail msg=The metric '${metric_1_name}' value is '${metric_1_value}' - ${metric_2_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${metric_2_name} - Run Keyword Unless ${metric_2_value} > 0 Fail msg=The metric '${metric_2_name}' value is '${metric_2_value}' + Variable Should Exist ${prometheus_poll_retries} msg=Metric polling retries is not available + Variable Should Exist ${prometheus_poll_timeout} msg=Metric polling timeout is not available + Variable Should Exist ${prometheus_host} msg=Prometheus address is not available + Variable Should Exist ${prometheus_port} msg=Prometheus port is not available + Variable Should Exist ${metric_1_name} msg=Prometheus first metric name is not available + Variable Should Exist ${metric_2_name} msg=Prometheus second metric name is not available + ${metric_1_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${metric_1_name} + Run Keyword Unless ${metric_1_value} > 0 Fail msg=The metric '${metric_1_name}' value is '${metric_1_value}' + ${metric_2_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${metric_2_name} + Run Keyword Unless ${metric_2_value} > 0 Fail msg=The metric '${metric_2_name}' value is '${metric_2_value}' Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name} + Delete VNFD ${vnfd_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/sa_02-vnf_with_vim_metrics_and_autoscaling.robot b/robot-systest/testsuite/sa_02-vnf_with_vim_metrics_and_autoscaling.robot index e769f55..ec2a6a3 100644 --- a/robot-systest/testsuite/sa_02-vnf_with_vim_metrics_and_autoscaling.robot +++ b/robot-systest/testsuite/sa_02-vnf_with_vim_metrics_and_autoscaling.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [SA-02] VNF with VIM-based metrics and auto-scaling. +Documentation [SA-02] VNF with VIM-based metrics and auto-scaling. Library OperatingSystem Library String @@ -45,13 +45,13 @@ ${success_return_code} 0 *** Test Cases *** Create VNF Descriptor - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' Get Scale-Out Threshold From VNF - ${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-show ${vnfd_name} --literal | yq '.df[0]."scaling-aspect"[0]."scaling-policy"[0]."scaling-criteria"[0]."scale-out-threshold"' | tr -d \\" - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + ${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-show ${vnfd_name} --literal | yq '.df[0]."scaling-aspect"[0]."scaling-policy"[0]."scaling-criteria"[0]."scale-out-threshold"' | tr -d \\" + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False ${scaleout_threshold}= Convert To Number ${stdout} Set Suite Variable ${metric_threshold} ${scaleout_threshold} log ${metric_threshold} @@ -59,97 +59,97 @@ Get Scale-Out Threshold From VNF Create NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate Network Service - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} - Set Suite Variable ${ns_id} ${id} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} + Set Suite Variable ${ns_id} ${id} Get VNF Id - @{vnfr_list}= Get Ns Vnfr Ids ${ns_id} - Log List ${vnfr_list} + @{vnfr_list}= Get Ns Vnfr Ids ${ns_id} + Log List ${vnfr_list} Set Suite Variable ${vnf_id} ${vnfr_list}[0] Get VNF IP Address - ${ip_addr}= Get Vnf Management Ip Address ${ns_id} ${vnf_member_index} + ${ip_addr}= Get Vnf Management Ip Address ${ns_id} ${vnf_member_index} log ${ip_addr} Set Suite Variable ${vnf_ip_addr} ${ip_addr} Get VNF VIM-based Metric Before Auto-scaling - Variable Should Exist ${prometheus_poll_retries} msg=Metric polling retries is not available - Variable Should Exist ${prometheus_poll_timeout} msg=Metric polling timeout is not available - Variable Should Exist ${prometheus_host} msg=Prometheus address is not available - Variable Should Exist ${prometheus_port} msg=Prometheus port is not available - Variable Should Exist ${metric_name} msg=Prometheus metric name is not available - ${metric_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${metric_name} - Run Keyword Unless ${metric_value} > 0 Fail msg=The metric '${metric_name}' value is '${metric_value}' - Run Keyword Unless ${metric_value} < ${metric_threshold} Fail msg=The metric '${metric_name}' value is higher than '${metric_threshold}' before scaling + Variable Should Exist ${prometheus_poll_retries} msg=Metric polling retries is not available + Variable Should Exist ${prometheus_poll_timeout} msg=Metric polling timeout is not available + Variable Should Exist ${prometheus_host} msg=Prometheus address is not available + Variable Should Exist ${prometheus_port} msg=Prometheus port is not available + Variable Should Exist ${metric_name} msg=Prometheus metric name is not available + ${metric_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${metric_name} + Run Keyword Unless ${metric_value} > 0 Fail msg=The metric '${metric_name}' value is '${metric_value}' + Run Keyword Unless ${metric_value} < ${metric_threshold} Fail msg=The metric '${metric_name}' value is higher than '${metric_threshold}' before scaling Increase VIM-based Metric To Force Auto-scaling - Variable Should Exist ${privatekey} msg=SSH private key not available + Variable Should Exist ${privatekey} msg=SSH private key not available Execute Remote Command Check Rc Return Output ${vnf_ip_addr} ${username} ${password} ${privatekey} for i in {1..9}; do yes > /dev/null & done Wait VIM-based Metric To Exceed Threshold - Variable Should Exist ${prometheus_poll_retries} msg=Metric polling retries is not available - Variable Should Exist ${prometheus_poll_timeout} msg=Metric polling timeout is not available - Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Check VIM-based Metric Exceeds Threshold + Variable Should Exist ${prometheus_poll_retries} msg=Metric polling retries is not available + Variable Should Exist ${prometheus_poll_timeout} msg=Metric polling timeout is not available + Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Check VIM-based Metric Exceeds Threshold Get VDUs After Auto-scaling - Sleep 2 minutes Wait for auto-scale to take place - @{vdur_list}= Get Vnf Vdur Names ${vnf_id} - Log List ${vdur_list} - ${vdurs}= Get Length ${vdur_list} - Run Keyword Unless ${vdurs} > 1 Fail msg=There is no new VDU after auto-scaling + Sleep 2 minutes Wait for auto-scale to take place + @{vdur_list}= Get Vnf Vdur Names ${vnf_id} + Log List ${vdur_list} + ${vdurs}= Get Length ${vdur_list} + Run Keyword Unless ${vdurs} > 1 Fail msg=There is no new VDU after auto-scaling Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name} + Delete VNFD ${vnfd_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} Check VIM-based Metric Exceeds Threshold - [Documentation] Auxiliar keyword to check if metric exceeds threshold + [Documentation] Auxiliar keyword to check if metric exceeds threshold - Variable Should Exist ${prometheus_host} msg=Prometheus address is not available - Variable Should Exist ${prometheus_port} msg=Prometheus port is not available - Variable Should Exist ${metric_name} msg=Prometheus metric name is not available - ${metric_value}= Get Metric ${prometheus_host} ${prometheus_port} ${metric_name} - Run Keyword Unless ${metric_value} > ${metric_threshold} Fail msg=The metric '${metric_name}' value is '${metric_value}' which is lower than '${metric_threshold}' + Variable Should Exist ${prometheus_host} msg=Prometheus address is not available + Variable Should Exist ${prometheus_port} msg=Prometheus port is not available + Variable Should Exist ${metric_name} msg=Prometheus metric name is not available + ${metric_value}= Get Metric ${prometheus_host} ${prometheus_port} ${metric_name} + Run Keyword Unless ${metric_value} > ${metric_threshold} Fail msg=The metric '${metric_name}' value is '${metric_value}' which is lower than '${metric_threshold}' diff --git a/robot-systest/testsuite/sa_07-alarms_from_sa-related_vnfs.robot b/robot-systest/testsuite/sa_07-alarms_from_sa-related_vnfs.robot index 6323817..bc09c1c 100644 --- a/robot-systest/testsuite/sa_07-alarms_from_sa-related_vnfs.robot +++ b/robot-systest/testsuite/sa_07-alarms_from_sa-related_vnfs.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [SA-07] Events or alarms coming from SA-related VNFs in the NS. +Documentation [SA-07] Events or alarms coming from SA-related VNFs in the NS. Library OperatingSystem Library String @@ -47,30 +47,30 @@ ${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } *** Test Cases *** Create Webhook Service VNF Descriptor - Create VNFD '%{PACKAGES_FOLDER}/${ws_vnfd_pkg}' + Create VNFD '%{PACKAGES_FOLDER}/${ws_vnfd_pkg}' Create Webhook Service NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${ws_nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${ws_nsd_pkg}' Instantiate Webhook Service Network Service - ${id}= Create Network Service ${ws_nsd_name} %{VIM_TARGET} ${ws_ns_name} ${ns_config} ${publickey} - Set Suite Variable ${ws_ns_id} ${id} + ${id}= Create Network Service ${ws_nsd_name} %{VIM_TARGET} ${ws_ns_name} ${ns_config} ${publickey} + Set Suite Variable ${ws_ns_id} ${id} Get Webhook Service VNF IP Address - ${ip_addr}= Get Vnf Management Ip Address ${ws_ns_id} ${vnf_member_index} + ${ip_addr}= Get Vnf Management Ip Address ${ws_ns_id} ${vnf_member_index} log ${ip_addr} Set Suite Variable ${ws_vnf_ip_addr} ${ip_addr} Start Webhook Service - Variable Should Exist ${privatekey} msg=SSH private key not available + Variable Should Exist ${privatekey} msg=SSH private key not available Sleep 40 seconds Wait for SSH daemon to be up ${stdout}= Execute Remote Command Check Rc Return Output ${ws_vnf_ip_addr} ${username} ${password} ${privatekey} while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; test; } | nc -l '${ws_port}'; done > '${ws_log_file}' 2>&1 & @@ -80,87 +80,87 @@ Create VNF Descriptor ${rc} ${stdout}= Run and Return RC and Output mkdir '%{PACKAGES_FOLDER}/${new_vnfd_pkg}' && WEBHOOK_URL="http://${ws_vnf_ip_addr}:${ws_port}" envsubst < '%{PACKAGES_FOLDER}/${vnfd_pkg}'/'${vnfd_file}' > '%{PACKAGES_FOLDER}/${new_vnfd_pkg}'/'${vnfd_file}' log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} - Create VNFD '%{PACKAGES_FOLDER}/${new_vnfd_pkg}' + Create VNFD '%{PACKAGES_FOLDER}/${new_vnfd_pkg}' Create NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate Network Service - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} - Set Suite Variable ${ns_id} ${id} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} + Set Suite Variable ${ns_id} ${id} Get Alarm Metric - Variable Should Exist ${prometheus_poll_retries} msg=Metric polling retries is not available - Variable Should Exist ${prometheus_poll_timeout} msg=Metric polling timeout is not available - Variable Should Exist ${prometheus_host} msg=Prometheus address is not available - Variable Should Exist ${prometheus_port} msg=Prometheus port is not available - Variable Should Exist ${metric_name} msg=Prometheus metric name is not available - ${metric_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${metric_name} - Run Keyword Unless ${metric_value} > 0 Fail msg=The metric '${metric_name}' value is '${metric_value}' + Variable Should Exist ${prometheus_poll_retries} msg=Metric polling retries is not available + Variable Should Exist ${prometheus_poll_timeout} msg=Metric polling timeout is not available + Variable Should Exist ${prometheus_host} msg=Prometheus address is not available + Variable Should Exist ${prometheus_port} msg=Prometheus port is not available + Variable Should Exist ${metric_name} msg=Prometheus metric name is not available + ${metric_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${metric_name} + Run Keyword Unless ${metric_value} > 0 Fail msg=The metric '${metric_name}' value is '${metric_value}' Check Alarms Were Received - Wait Until Keyword Succeeds 6 times 40 seconds Execute Remote Command Check Rc Return Output ${ws_vnf_ip_addr} ${username} ${password} ${privatekey} cat '${ws_log_file}' | grep '${alarm_msg}' | grep '${ns_name}' + Wait Until Keyword Succeeds 6 times 40 seconds Execute Remote Command Check Rc Return Output ${ws_vnf_ip_addr} ${username} ${password} ${privatekey} cat '${ws_log_file}' | grep '${alarm_msg}' | grep '${ns_name}' Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name} + Delete VNFD ${vnfd_name} Delete Webhook Service NS Instance [Tags] cleanup - Delete NS ${ws_ns_name} + Delete NS ${ws_ns_name} Delete Webhook Service NS Descriptor [Tags] cleanup - Delete NSD ${ws_nsd_name} + Delete NSD ${ws_nsd_name} Delete Webhook Service VNF Descriptor [Tags] cleanup - Delete VNFD ${ws_vnfd_name} + Delete VNFD ${ws_vnfd_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} - Run Keyword If Any Tests Failed Delete NS ${ws_ns_name} - Run Keyword If Any Tests Failed Delete NSD ${ws_nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${ws_vnfd_name} - Delete Temporary Descriptor Folder '%{PACKAGES_FOLDER}/${new_vnfd_pkg}' + Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete NS ${ws_ns_name} + Run Keyword If Any Tests Failed Delete NSD ${ws_nsd_name} + Run Keyword If Any Tests Failed Delete VNFD ${ws_vnfd_name} + Delete Temporary Descriptor Folder '%{PACKAGES_FOLDER}/${new_vnfd_pkg}' Delete Temporary Descriptor Folder - [Documentation] Removes the temporary package folder created for the test + [Documentation] Removes the temporary package folder created for the test [Arguments] ${folder_name} ${rc} ${stdout}= Run and Return RC and Output rm -rf '${folder_name}' log ${stdout} diff --git a/robot-systest/testsuite/sa_08-vnf_with_vnf_indicators_snmp.robot b/robot-systest/testsuite/sa_08-vnf_with_vnf_indicators_snmp.robot index 7cb6f6a..959e2ee 100644 --- a/robot-systest/testsuite/sa_08-vnf_with_vnf_indicators_snmp.robot +++ b/robot-systest/testsuite/sa_08-vnf_with_vnf_indicators_snmp.robot @@ -11,7 +11,7 @@ # limitations under the License. *** Settings *** -Documentation [SA-08] VNF with VNF-based indicators through SNMP. +Documentation [SA-08] VNF with VNF-based indicators through SNMP. Library OperatingSystem Library String @@ -37,54 +37,54 @@ ${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } *** Test Cases *** Create VNF Descriptor - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' Create NS Descriptor - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' Instantiate Network Service - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${EMPTY} - Set Suite Variable ${ns_id} ${id} + ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${EMPTY} + Set Suite Variable ${ns_id} ${id} Get VNF SNMP Metrics - Variable Should Exist ${prometheus_host} msg=Prometheus address is not available - Variable Should Exist ${prometheus_port} msg=Prometheus port is not available - Variable Should Exist ${metric_1_name} msg=Prometheus first metric name is not available - Variable Should Exist ${metric_2_name} msg=Prometheus second metric name is not available - ${metric_1_value}= Wait Until Keyword Succeeds 6 times 1 minutes Get Metric ${prometheus_host} ${prometheus_port} ${metric_1_name} ${metric_1_filter} - Run Keyword Unless ${metric_1_value} > 0 Fail msg=The metric '${metric_1_name}' value is '${metric_1_value}' - ${metric_2_value}= Wait Until Keyword Succeeds 6 times 1 minutes Get Metric ${prometheus_host} ${prometheus_port} ${metric_2_name} ${metric_2_filter} - Run Keyword Unless ${metric_2_value} > 0 Fail msg=The metric '${metric_2_name}' value is '${metric_2_value}' + Variable Should Exist ${prometheus_host} msg=Prometheus address is not available + Variable Should Exist ${prometheus_port} msg=Prometheus port is not available + Variable Should Exist ${metric_1_name} msg=Prometheus first metric name is not available + Variable Should Exist ${metric_2_name} msg=Prometheus second metric name is not available + ${metric_1_value}= Wait Until Keyword Succeeds 6 times 1 minutes Get Metric ${prometheus_host} ${prometheus_port} ${metric_1_name} ${metric_1_filter} + Run Keyword Unless ${metric_1_value} > 0 Fail msg=The metric '${metric_1_name}' value is '${metric_1_value}' + ${metric_2_value}= Wait Until Keyword Succeeds 6 times 1 minutes Get Metric ${prometheus_host} ${prometheus_port} ${metric_2_name} ${metric_2_filter} + Run Keyword Unless ${metric_2_value} > 0 Fail msg=The metric '${metric_2_name}' value is '${metric_2_value}' Delete NS Instance [Tags] cleanup - Delete NS ${ns_name} + Delete NS ${ns_name} Delete NS Descriptor [Tags] cleanup - Delete NSD ${nsd_name} + Delete NSD ${nsd_name} Delete VNF Descriptor [Tags] cleanup - Delete VNFD ${vnfd_name} + Delete VNFD ${vnfd_name} *** Keywords *** Suite Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance + [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - Run Keyword If Any Tests Failed Delete NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete NS ${ns_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/slice_01-network_slicing.robot b/robot-systest/testsuite/slice_01-network_slicing.robot index 04111a2..8f666d1 100644 --- a/robot-systest/testsuite/slice_01-network_slicing.robot +++ b/robot-systest/testsuite/slice_01-network_slicing.robot @@ -13,7 +13,7 @@ # limitations under the License. *** Settings *** -Documentation [SLICE-01] Network Slicing. +Documentation [SLICE-01] Network Slicing. Library OperatingSystem Library String @@ -98,7 +98,7 @@ Get Middle Vnf Management Ip ${middle_ns_id}= Run and Return RC and Output osm ns-list | grep ${middle_ns_name} | awk '{print $4}' 2>&1 ${vnf_ip} Get Vnf Management Ip Address ${middle_ns_id}[1] ${vnf_member_index} - Run Keyword If '${vnf_ip}' == '${EMPTY}' Fatal Error Variable \$\{ vnf_ip\} Empty + Run Keyword If '${vnf_ip}' == '${EMPTY}' Fatal Error Variable \$\{ vnf_ip\} Empty Set Suite Variable ${mgmt_vnf_ip} ${vnf_ip} @@ -106,16 +106,16 @@ Get Slice Vnf Ip Addresses [Documentation] Obtains the list of IPs addresses in the slice and sets the list as a suite variable (slice_vnfs_ips) # Get all the ns_id in the slice except the middle one to avoid self ping - @{slice_ns_list} Get Slice Ns List Except One ${slice_name} ${middle_ns_name} + @{slice_ns_list} Get Slice Ns List Except One ${slice_name} ${middle_ns_name} log many @{slice_ns_list} - @{temp_list}= Create List + @{temp_list}= Create List # For each ns_id in the list, get all the vnf_id and their IP addresses FOR ${ns_id} IN @{slice_ns_list} log ${ns_id} @{vnf_id_list} Get Ns Vnf List ${ns_id} # For each vnf_id in the list, get all its IP addresses @{ns_ip_list} Get Ns Ip List @{vnf_id_list} - @{temp_list}= Combine Lists ${temp_list} ${ns_ip_list} + @{temp_list}= Combine Lists ${temp_list} ${ns_ip_list} END Log List ${temp_list} Set Suite Variable ${slice_vnfs_ips} ${temp_list} @@ -126,22 +126,22 @@ Test Middle Ns Ping Sleep 60s Waiting for the network to be up # Ping to the middle VNF - log ${mgmt_vnf_ip} - Test Connectivity ${mgmt_vnf_ip} + log ${mgmt_vnf_ip} + Test Connectivity ${mgmt_vnf_ip} Test Middle Vnf SSH Access [Documentation] SSH access to the slice middle vnf (mgmt_vnf_ip) with the credentials provided in the variables file Sleep 30s Waiting ssh daemon to be up - Test SSH Connection ${mgmt_vnf_ip} ${username} ${password} ${privatekey} + Test SSH Connection ${mgmt_vnf_ip} ${username} ${password} ${privatekey} Test Slice Connectivity [Documentation] SSH access to the slice middle vnf (mgmt_vnf_ip) with the credentials provided in the variables file - ... and pings all the IP addresses in the list (slice_vnfs_ips) + ... and pings all the IP addresses in the list (slice_vnfs_ips) - Ping Many ${mgmt_vnf_ip} ${username} ${password} ${privatekey} @{slice_vnfs_ips} + Ping Many ${mgmt_vnf_ip} ${username} ${password} ${privatekey} @{slice_vnfs_ips} Delete Slice Instance @@ -176,17 +176,17 @@ Delete VNF Descriptors *** Keywords *** Suite Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptors, instance and template + [Documentation] Test Suit Cleanup: Deleting Descriptors, instance and template - Run Keyword If Any Tests Failed Delete NSI ${slice_name} + Run Keyword If Any Tests Failed Delete NSI ${slice_name} - Run Keyword If Any Tests Failed Delete NST ${nst_name} + Run Keyword If Any Tests Failed Delete NST ${nst_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd1_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd2_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd1_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd2_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd1_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd2_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd1_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd2_name} diff --git a/robot-systest/testsuite/slice_02-shared_network_slicing.robot b/robot-systest/testsuite/slice_02-shared_network_slicing.robot index 6ee4987..ed165f5 100644 --- a/robot-systest/testsuite/slice_02-shared_network_slicing.robot +++ b/robot-systest/testsuite/slice_02-shared_network_slicing.robot @@ -13,7 +13,7 @@ # limitations under the License. *** Settings *** -Documentation [SLICE-02] Shared Network Slicing. +Documentation [SLICE-02] Shared Network Slicing. Library OperatingSystem Library String @@ -98,10 +98,10 @@ Network Slice First Instance Network Slice Second Instance - [Documentation] Instantiates the Second NST recently onboarded (nst2_name) and sets the instantiation id as a suite variable (nsi2_id) + [Documentation] Instantiates the Second NST recently onboarded (nst2_name) and sets the instantiation id as a suite variable (nsi2_id) ... The slice contains 2 NS (1 shared) - ${id}= Create Network Slice ${nst2_name} %{VIM_TARGET} ${slice2_name} ${nst_config} ${publickey} + ${id}= Create Network Slice ${nst2_name} %{VIM_TARGET} ${slice2_name} ${nst_config} ${publickey} Set Suite Variable ${nsi2_id} ${id} @@ -119,7 +119,7 @@ Get Middle Vnf Management Ip ${middle_ns_id}= Run and Return RC and Output osm ns-list | grep ${middle_ns_name} | awk '{print $4}' 2>&1 ${vnf_ip} Get Vnf Management Ip Address ${middle_ns_id}[1] ${vnf_member_index} - Run Keyword If '${vnf_ip}' == '${EMPTY}' Fatal Error Variable \$\{ vnf_ip\} Empty + Run Keyword If '${vnf_ip}' == '${EMPTY}' Fatal Error Variable \$\{ vnf_ip\} Empty Set Suite Variable ${mgmt_vnf_ip} ${vnf_ip} @@ -137,21 +137,21 @@ Test Middle Ns Ping Sleep 60s Waiting for the network to be up # Ping to the middle VNF - Test Connectivity ${mgmt_vnf_ip} + Test Connectivity ${mgmt_vnf_ip} Test Middle Vnf SSH Access [Documentation] SSH access to the slice middle vnf (mgmt_vnf_ip) with the credentials provided in the variables file Sleep 30s Waiting ssh daemon to be up - Test SSH Connection ${mgmt_vnf_ip} ${username} ${password} ${privatekey} + Test SSH Connection ${mgmt_vnf_ip} ${username} ${password} ${privatekey} Test First Slice Connectivity [Documentation] SSH access to the slice middle vnf (mgmt_vnf_ip) with the credentials provided in the variables file - ... and pings all the IP addresses in the list (slice1_vnfs_ips) + ... and pings all the IP addresses in the list (slice1_vnfs_ips) - Ping Many ${mgmt_vnf_ip} ${username} ${password} ${privatekey} @{slice1_vnfs_ips} + Ping Many ${mgmt_vnf_ip} ${username} ${password} ${privatekey} @{slice1_vnfs_ips} Delete Slice One Instance @@ -181,9 +181,9 @@ Get Second Slice Vnf IPs Test Second Slice Connectivity [Documentation] SSH access to the slice middle vnf (mgmt_vnf_ip) with the credentials provided in the variables file - ... and pings all the IP addresses in the list (slice2_vnfs_ips) + ... and pings all the IP addresses in the list (slice2_vnfs_ips) - Ping Many ${mgmt_vnf_ip} ${username} ${password} ${privatekey} @{slice2_vnfs_ips} + Ping Many ${mgmt_vnf_ip} ${username} ${password} ${privatekey} @{slice2_vnfs_ips} Delete Slice Two Instance @@ -230,19 +230,18 @@ Delete VNF Descriptors *** Keywords *** Suite Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptors, instance and templates + [Documentation] Test Suit Cleanup: Deleting Descriptors, instance and templates - Run Keyword If Any Tests Failed Delete NSI ${slice_name} - Run Keyword If Any Tests Failed Delete NSI ${slice2_name} + Run Keyword If Any Tests Failed Delete NSI ${slice_name} + Run Keyword If Any Tests Failed Delete NSI ${slice2_name} - Run Keyword If Any Tests Failed Delete NST ${nst_name} - Run Keyword If Any Tests Failed Delete NST ${nst2_name} + Run Keyword If Any Tests Failed Delete NST ${nst_name} + Run Keyword If Any Tests Failed Delete NST ${nst2_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd1_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd2_name} - - Run Keyword If Any Tests Failed Delete VNFD ${vnfd1_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd2_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd1_name} + Run Keyword If Any Tests Failed Delete NSD ${nsd2_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd1_name} + Run Keyword If Any Tests Failed Delete VNFD ${vnfd2_name} diff --git a/robot-systest/testsuite/sol003_01-vnf-lifecycle-management.robot b/robot-systest/testsuite/sol003_01-vnf-lifecycle-management.robot index 295ad3b..18801a1 100644 --- a/robot-systest/testsuite/sol003_01-vnf-lifecycle-management.robot +++ b/robot-systest/testsuite/sol003_01-vnf-lifecycle-management.robot @@ -11,158 +11,158 @@ # limitations under the License *** 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 RequestsLibrary -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/vim_lib.robot +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 RequestsLibrary +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/vim_lib.robot *** Variables *** -${vnfd_pkg} hackfest_basic_metrics_vnf -${vnfd_name} hackfest_basic_metrics-vnf +${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 - ${id}= Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' - Set Suite Variable ${vnfid} ${id} - ${created_vim_account_id}= Get VIM Target ID %{VIM_TARGET} - Set Suite Variable ${created_vim_account_id} + [Documentation] Test case to create a VNF Identifier + ${id}= Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' + Set Suite Variable ${vnfid} ${id} + ${created_vim_account_id}= Get VIM Target ID %{VIM_TARGET} + Set Suite Variable ${created_vim_account_id} 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'][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} - 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]} + ${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} + 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]} Instantiate VNF - [Documentation] Test case to Instantiate a VNF + [Documentation] Test case to Instantiate a VNF 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} - 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 + ${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} + 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 Query VNF Instances - [Documentation] Test case to query VNF Instance + [Documentation] Test case to query VNF Instance Get Auth Token - Get Api Request ${vnf_instance_uri} - ${value}= Get ID nsState - Should Be Equal ${value} INSTANTIATED - 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 ${Queryid} ${id[0]} + Get Api Request ${vnf_instance_uri} + ${value}= Get ID nsState + Should Be Equal ${value} INSTANTIATED + 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 ${Queryid} ${id[0]} Query VNF Instance ID - [Documentation] Test case to query Vnf instance ID + [Documentation] Test case to query Vnf instance ID Get Auth Token - Get Api Request ${vnf_instance_uri}/${Queryid} - ${value}= Get ID nsState - Should Be Equal ${value} INSTANTIATED - Should Be Equal As Strings ${RequestResponse.status_code} 200 - ${id}= Get Value From Json ${request_response.json()} $.._id - Set Suite Variable ${Instanceid} ${id[0]} + Get Api Request ${vnf_instance_uri}/${Queryid} + ${value}= Get ID nsState + Should Be Equal ${value} INSTANTIATED + Should Be Equal As Strings ${RequestResponse.status_code} 200 + ${id}= Get Value From Json ${request_response.json()} $.._id + Set Suite Variable ${Instanceid} ${id[0]} Query VNF LCM Ops - [Documentation] Test case to Query VNF LCM operation + [Documentation] Test case to Query VNF LCM operation Get Auth Token - Get Api Request ${vnf_instance_lcm_ops} - ${ID1}= Get Value From Json ${request_response.json()} $.._id - Set Suite Variable ${lcmops} ${ID1[0]} - FOR ${Index} IN RANGE 0 15 - Get Api Request ${vnf_instance_lcm_ops} - ${value}= Get ID operationState - ${status}= Run Keyword And Return Status Should Be Equal ${value} COMPLETED - Run Keyword If ${status} Exit For Loop - ... ELSE Sleep 10s + Get Api Request ${vnf_instance_lcm_ops} + ${ID1}= Get Value From Json ${request_response.json()} $.._id + Set Suite Variable ${lcmops} ${ID1[0]} + FOR ${Index} IN RANGE 0 15 + Get Api Request ${vnf_instance_lcm_ops} + ${value}= Get ID operationState + ${status}= Run Keyword And Return Status Should Be Equal ${value} COMPLETED + Run Keyword If ${status} Exit For Loop + ... ELSE Sleep 10s END Query VNF LCM Ops ID Get Auth Token - Get Api Request ${vnf_instance_lcm_ops}/${lcmops} - ${ID1}= Get Value From Json ${request_response.json()} $.._id - Set Suite Variable ${lcmopsid} ${ID1[0]} - FOR ${Index} IN RANGE 0 15 - Get Api Request ${vnf_instance_lcm_ops}/${lcmops} - ${value}= Get ID operationState - ${status}= Run Keyword And Return Status Should Be Equal ${value} COMPLETED - Run Keyword If ${status} Exit For Loop - ... ELSE Sleep 10s + Get Api Request ${vnf_instance_lcm_ops}/${lcmops} + ${ID1}= Get Value From Json ${request_response.json()} $.._id + Set Suite Variable ${lcmopsid} ${ID1[0]} + FOR ${Index} IN RANGE 0 15 + Get Api Request ${vnf_instance_lcm_ops}/${lcmops} + ${value}= Get ID operationState + ${status}= Run Keyword And Return Status Should Be Equal ${value} COMPLETED + Run Keyword If ${status} Exit For Loop + ... ELSE Sleep 10s END Scale VNF - [Documentation] Test case to Scale out VNF + [Documentation] Test case to Scale out VNF Get Auth Token - ${json_path}= Read Directory - ${updated_json_obj}= Load JSON From File ${json_path}/sol003_01-vnf-lifecycle-management.json - ${updated_json_obj}= Get Variable Value ${updated_json_obj['data'][2]} - Set Test Variable ${updated_json_obj} - Post API Request ${vnf_instance_uri}/${createid}/scale - ${value}= Get ID id - ${ID1}= Get Value From Json ${request_response.json()} $..id - Set Suite Variable ${scaleoutid} ${ID1[0]} - Get Api Request ${vnf_instance_lcm_ops}/${scaleoutid} - ${LcmopsScale}= Get Value From Json ${request_response.json()} $.._id - Set Suite Variable ${lcmopsscaleid} ${LcmopsScale[0]} - FOR ${Index} IN RANGE 0 15 - Get Api Request ${vnf_instance_lcm_ops}/${scaleoutid} - ${value}= Get ID operationState - ${status}= Run Keyword And Return Status Should Be Equal ${value} COMPLETED - Run Keyword If ${status} Exit For Loop - ... ELSE Sleep 10s + ${json_path}= Read Directory + ${updated_json_obj}= Load JSON From File ${json_path}/sol003_01-vnf-lifecycle-management.json + ${updated_json_obj}= Get Variable Value ${updated_json_obj['data'][2]} + Set Test Variable ${updated_json_obj} + Post API Request ${vnf_instance_uri}/${createid}/scale + ${value}= Get ID id + ${ID1}= Get Value From Json ${request_response.json()} $..id + Set Suite Variable ${scaleoutid} ${ID1[0]} + Get Api Request ${vnf_instance_lcm_ops}/${scaleoutid} + ${LcmopsScale}= Get Value From Json ${request_response.json()} $.._id + Set Suite Variable ${lcmopsscaleid} ${LcmopsScale[0]} + FOR ${Index} IN RANGE 0 15 + Get Api Request ${vnf_instance_lcm_ops}/${scaleoutid} + ${value}= Get ID operationState + ${status}= Run Keyword And Return Status Should Be Equal ${value} COMPLETED + Run Keyword If ${status} Exit For Loop + ... ELSE Sleep 10s END - Pass Execution If ${request_response.status_code} in ${success_status_code_list} Scale VNF instance completed + Pass Execution If ${request_response.status_code} in ${success_status_code_list} Scale VNF instance completed Terminate VNF - [Documentation] Test case to terminate the VNF + [Documentation] Test case to terminate the VNF Get Auth Token - ${json_path}= Read Directory - ${updated_json_obj}= Load JSON From File ${json_path}/sol003_01-vnf-lifecycle-management.json - ${updated_json_obj}= Get Variable Value ${updated_json_obj['data'][3]} - Set Suite Variable ${updated_json_obj} + ${json_path}= Read Directory + ${updated_json_obj}= Load JSON From File ${json_path}/sol003_01-vnf-lifecycle-management.json + ${updated_json_obj}= Get Variable Value ${updated_json_obj['data'][3]} + Set Suite Variable ${updated_json_obj} Post API Request ${vnf_instance_uri}/${createid}/terminate - ${id}= Get Value From Json ${request_response.json()} $..id - Set Suite Variable ${terminateid} ${id[0]} - Get Api Request ${vnf_instance_lcm_ops}/${terminateid} - ${LcmopsTerminate}= Get Value From Json ${request_response.json()} $.._id - Set Suite Variable ${lcmopsscaleid} ${LcmopsTerminate[0]} - FOR ${Index} IN RANGE 0 15 - Get Api Request ${vnf_instance_lcm_ops}/${terminateid} - ${value}= Get ID operationState - ${status}= Run Keyword And Return Status Should Be Equal ${value} COMPLETED - Run Keyword If ${status} Exit For Loop - ... ELSE Sleep 10s + ${id}= Get Value From Json ${request_response.json()} $..id + Set Suite Variable ${terminateid} ${id[0]} + Get Api Request ${vnf_instance_lcm_ops}/${terminateid} + ${LcmopsTerminate}= Get Value From Json ${request_response.json()} $.._id + Set Suite Variable ${lcmopsscaleid} ${LcmopsTerminate[0]} + FOR ${Index} IN RANGE 0 15 + Get Api Request ${vnf_instance_lcm_ops}/${terminateid} + ${value}= Get ID operationState + ${status}= Run Keyword And Return Status Should Be Equal ${value} COMPLETED + Run Keyword If ${status} Exit For Loop + ... ELSE Sleep 10s END - Pass Execution If ${request_response.status_code} in ${success_status_code_list} Terminate VNF instance completed + Pass Execution If ${request_response.status_code} in ${success_status_code_list} Terminate VNF instance completed Delete VNF - [Documentation] Test case to delete VNF + [Documentation] Test case to delete VNF Get Auth Token - Create Session APISession ${HOST} - &{Headers} Create Dictionary Content-Type=application/json Accept=application/json Authorization=Bearer ${AccessToken} - ${resp}= DELETE On Session APISession ${vnf_instance_uri}/${createid} headers=${Headers} - Pass Execution If ${resp.status_code} in ${success_status_code_list} Delete VNF Instance completed + Create Session APISession ${HOST} + &{Headers} Create Dictionary Content-Type=application/json Accept=application/json Authorization=Bearer ${AccessToken} + ${resp}= DELETE On Session APISession ${vnf_instance_uri}/${createid} headers=${Headers} + Pass Execution If ${resp.status_code} in ${success_status_code_list} Delete VNF Instance completed Delete VNF Descriptor Test [Tags] cleanup @@ -171,6 +171,6 @@ Delete VNF Descriptor Test *** Keywords *** Suite Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptor + [Documentation] Test Suit Cleanup: Deleting Descriptor Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name}