exit 1
}
+check_spaces_eol () {
+ folder="$1"
+ spaces_eol="y"
+ ! grep -ri " $" ${folder} && spaces_eol=""
+ [ -n "${spaces_eol}" ] && \
+ echo "Some files in ${folder} have spaces at the end of some lines" && \
+ echo "Use this command to change it:" && \
+ echo " sed -i 's/ *$//g' <FILENAME>" && \
+ exit 1
+}
+
echo "Checking tabs in robot files. No tabs should be present"
check_tabs robot-systest/testsuite
check_tabs robot-systest/lib
check_crlf_terminators robot-systest/lib
echo "No presence of CRLF terminators in robot files. Correct!"
+echo "Checking spaces at the end of lines in robot files. No spaces at EOL should be found"
+check_spaces_eol robot-systest/testsuite
+check_spaces_eol robot-systest/lib
+echo "No presence of spaces at EOL in robot files. Correct!"
+
echo "SUCCESS"
exit 0
*** Keywords ***
-Package Build
+Package Build
[Documentation] Build the package NS, VNF given the package_folder
[Arguments] ${pkg_folder} ${skip_charm_build}=${EMPTY}
# TODO: Check Initial Config Primitives Status
-Delete NS
+Delete NS
[Tags] cleanup
Delete NS ${ns_name}
${ns_name} basic_19
${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
-# SSH keys and username to be used
+# SSH keys and username to be used
${publickey} %{HOME}/.ssh/id_rsa.pub
${username} ubuntu
Check Vnf IPs
- Variable Should Exist ${vnf_id} msg=VNF is not available
+ 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}
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
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
Test SSH Access
${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
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}
+ ${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}
[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
Second Network Slice Ns Count
[Documentation] Counts the NS in both slice instances and should be equal to 2
-
+
${slice1_count}= Get Slice Ns Count ${slice_name}
${slice2_count}= Get Slice Ns Count ${slice2_name}
${together}= Evaluate ${slice1_count} + ${slice2_count}