Updated basic_21 test 08/11308/1 release-v11.0-start
authoraguilard <e.dah.tid@telefonica.com>
Fri, 5 Nov 2021 13:26:42 +0000 (14:26 +0100)
committeraguilard <e.dah.tid@telefonica.com>
Fri, 5 Nov 2021 13:26:42 +0000 (14:26 +0100)
Added checking on the number of disks in the VDU.

Change-Id: I915d1fcbe616c8880a616fb1289daa6fd2c14c42
Signed-off-by: aguilard <e.dah.tid@telefonica.com>
robot-systest/testsuite/basic_21-persistent_volumes.robot

index 8073b36..bc957d3 100644 (file)
@@ -50,6 +50,7 @@ ${password}   ${EMPTY}
 ${ns_id}   ${EMPTY}
 ${vnf_member_index}   vnf-several-volumes
 ${vnf_ip_addr}   ${EMPTY}
 ${ns_id}   ${EMPTY}
 ${vnf_member_index}   vnf-several-volumes
 ${vnf_ip_addr}   ${EMPTY}
+${success_return_code}   0
 
 
 *** Test Cases ***
 
 
 *** Test Cases ***
@@ -58,6 +59,15 @@ Create VNF Descriptor
     Create VNFD   '%{PACKAGES_FOLDER}/${vnfd_pkg}'
 
 
     Create VNFD   '%{PACKAGES_FOLDER}/${vnfd_pkg}'
 
 
+Get Volumes From VNF
+
+    ${rc}  ${stdout}=  Run and Return RC and Output  osm vnfpkg-show ${vnfd_name} --literal | yq '."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}
+
+
 Create NS Descriptor
 
     Create NSD   '%{PACKAGES_FOLDER}/${nsd_pkg}'
 Create NS Descriptor
 
     Create NSD   '%{PACKAGES_FOLDER}/${nsd_pkg}'
@@ -80,8 +90,11 @@ Check Vdu disks
 
     Variable Should Exist  ${vnf_ip_addr}  msg=VNF is not available
     Sleep   30 seconds   Wait for SSH daemon to be up
 
     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 -fm
+    ${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})
 
 
 Delete NS Instance Test
 
 
 Delete NS Instance Test