From 61bbf92c1b2a4563f1636f053a4846b669161714 Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Sat, 25 Jun 2022 18:12:53 +0200 Subject: [PATCH] Add check of spaces at EOL in stage-test Change-Id: I5d4ebc92eded762475a7a33f6a61acf870c8413d Signed-off-by: garciadeblas --- devops-stages/stage-test.sh | 16 ++++++++++++++++ robot-systest/lib/packages_lib.robot | 2 +- .../testsuite/basic_12-ns_primitives.robot | 2 +- .../testsuite/basic_19-vnf_ip_profile.robot | 6 +++--- .../fail_01-insufficient_resources.robot | 2 +- robot-systest/testsuite/hackfest_basic.robot | 2 +- robot-systest/testsuite/hackfest_multivdu.robot | 2 +- .../testsuite/k8s_01-create_k8s_cluster.robot | 2 +- .../testsuite/slice_01-network_slicing.robot | 2 +- .../slice_02-shared_network_slicing.robot | 2 +- 10 files changed, 27 insertions(+), 11 deletions(-) diff --git a/devops-stages/stage-test.sh b/devops-stages/stage-test.sh index 00c8981..0fcf210 100755 --- a/devops-stages/stage-test.sh +++ b/devops-stages/stage-test.sh @@ -57,6 +57,17 @@ check_crlf_terminators () { 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' " && \ + exit 1 +} + echo "Checking tabs in robot files. No tabs should be present" check_tabs robot-systest/testsuite check_tabs robot-systest/lib @@ -77,6 +88,11 @@ check_crlf_terminators robot-systest/testsuite 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 diff --git a/robot-systest/lib/packages_lib.robot b/robot-systest/lib/packages_lib.robot index c53cc4d..9111544 100644 --- a/robot-systest/lib/packages_lib.robot +++ b/robot-systest/lib/packages_lib.robot @@ -22,7 +22,7 @@ ${success_return_code} 0 *** Keywords *** -Package Build +Package Build [Documentation] Build the package NS, VNF given the package_folder [Arguments] ${pkg_folder} ${skip_charm_build}=${EMPTY} diff --git a/robot-systest/testsuite/basic_12-ns_primitives.robot b/robot-systest/testsuite/basic_12-ns_primitives.robot index 154ed6c..84a9128 100644 --- a/robot-systest/testsuite/basic_12-ns_primitives.robot +++ b/robot-systest/testsuite/basic_12-ns_primitives.robot @@ -76,7 +76,7 @@ Instantiate NS # TODO: Check Initial Config Primitives Status -Delete NS +Delete NS [Tags] cleanup Delete NS ${ns_name} diff --git a/robot-systest/testsuite/basic_19-vnf_ip_profile.robot b/robot-systest/testsuite/basic_19-vnf_ip_profile.robot index 8922b49..4949a3b 100644 --- a/robot-systest/testsuite/basic_19-vnf_ip_profile.robot +++ b/robot-systest/testsuite/basic_19-vnf_ip_profile.robot @@ -39,7 +39,7 @@ ${nsd_name} ipprofile_2vm-ns ${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 @@ -80,14 +80,14 @@ Get Vnf Info 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 diff --git a/robot-systest/testsuite/fail_01-insufficient_resources.robot b/robot-systest/testsuite/fail_01-insufficient_resources.robot index e15e1d9..1df7d30 100644 --- a/robot-systest/testsuite/fail_01-insufficient_resources.robot +++ b/robot-systest/testsuite/fail_01-insufficient_resources.robot @@ -96,7 +96,7 @@ Delete NS Instance And Check VIM 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 diff --git a/robot-systest/testsuite/hackfest_basic.robot b/robot-systest/testsuite/hackfest_basic.robot index 092074a..ee079f9 100644 --- a/robot-systest/testsuite/hackfest_basic.robot +++ b/robot-systest/testsuite/hackfest_basic.robot @@ -79,7 +79,7 @@ Test Ping 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 diff --git a/robot-systest/testsuite/hackfest_multivdu.robot b/robot-systest/testsuite/hackfest_multivdu.robot index 229e9e6..2344563 100644 --- a/robot-systest/testsuite/hackfest_multivdu.robot +++ b/robot-systest/testsuite/hackfest_multivdu.robot @@ -83,7 +83,7 @@ Test Ping 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 diff --git a/robot-systest/testsuite/k8s_01-create_k8s_cluster.robot b/robot-systest/testsuite/k8s_01-create_k8s_cluster.robot index 210b772..23bf8ee 100644 --- a/robot-systest/testsuite/k8s_01-create_k8s_cluster.robot +++ b/robot-systest/testsuite/k8s_01-create_k8s_cluster.robot @@ -92,7 +92,7 @@ Create K8s Cluster NS Descriptor 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} diff --git a/robot-systest/testsuite/slice_01-network_slicing.robot b/robot-systest/testsuite/slice_01-network_slicing.robot index 8f666d1..33d3bab 100644 --- a/robot-systest/testsuite/slice_01-network_slicing.robot +++ b/robot-systest/testsuite/slice_01-network_slicing.robot @@ -134,7 +134,7 @@ 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 diff --git a/robot-systest/testsuite/slice_02-shared_network_slicing.robot b/robot-systest/testsuite/slice_02-shared_network_slicing.robot index ed165f5..869eb45 100644 --- a/robot-systest/testsuite/slice_02-shared_network_slicing.robot +++ b/robot-systest/testsuite/slice_02-shared_network_slicing.robot @@ -164,7 +164,7 @@ Delete Slice One Instance 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} -- 2.25.1