Add check of spaces at EOL in stage-test 66/12266/2
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Sat, 25 Jun 2022 16:12:53 +0000 (18:12 +0200)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Mon, 8 Aug 2022 09:12:04 +0000 (11:12 +0200)
Change-Id: I5d4ebc92eded762475a7a33f6a61acf870c8413d
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
devops-stages/stage-test.sh
robot-systest/lib/packages_lib.robot
robot-systest/testsuite/basic_12-ns_primitives.robot
robot-systest/testsuite/basic_19-vnf_ip_profile.robot
robot-systest/testsuite/fail_01-insufficient_resources.robot
robot-systest/testsuite/hackfest_basic.robot
robot-systest/testsuite/hackfest_multivdu.robot
robot-systest/testsuite/k8s_01-create_k8s_cluster.robot
robot-systest/testsuite/slice_01-network_slicing.robot
robot-systest/testsuite/slice_02-shared_network_slicing.robot

index 00c8981..0fcf210 100755 (executable)
@@ -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' <FILENAME>" && \
+    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
 
index c53cc4d..9111544 100644 (file)
@@ -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}
index 154ed6c..84a9128 100644 (file)
@@ -76,7 +76,7 @@ Instantiate NS
 
 # TODO: Check Initial Config Primitives Status
 
-Delete NS 
+Delete NS
     [Tags]   cleanup
 
     Delete NS   ${ns_name}
index 8922b49..4949a3b 100644 (file)
@@ -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
index e15e1d9..1df7d30 100644 (file)
@@ -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
index 092074a..ee079f9 100644 (file)
@@ -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
index 229e9e6..2344563 100644 (file)
@@ -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
index 210b772..23bf8ee 100644 (file)
@@ -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}
 
 
index 8f666d1..33d3bab 100644 (file)
@@ -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
index ed165f5..869eb45 100644 (file)
@@ -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}