Updated basic_21 test
Added checking on the number of disks in the VDU.
Change-Id: I915d1fcbe616c8880a616fb1289daa6fd2c14c42
Signed-off-by: aguilard <e.dah.tid@telefonica.com>
diff --git a/robot-systest/testsuite/basic_21-persistent_volumes.robot b/robot-systest/testsuite/basic_21-persistent_volumes.robot
index 8073b36..bc957d3 100644
--- a/robot-systest/testsuite/basic_21-persistent_volumes.robot
+++ b/robot-systest/testsuite/basic_21-persistent_volumes.robot
@@ -50,6 +50,7 @@
${ns_id} ${EMPTY}
${vnf_member_index} vnf-several-volumes
${vnf_ip_addr} ${EMPTY}
+${success_return_code} 0
*** Test Cases ***
@@ -58,6 +59,15 @@
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}'
@@ -80,8 +90,11 @@
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}
+ ${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