BASIC21 test: added persistent volume checking
Added check on the presence of the persistent volume in Openstack. Created new keywords in openstack_lib.robot for that.
Fix bug in vnf_lib.robot.
Change-Id: I0b4cc8f81d2f1cddcd90d1664a69dafae23e70cb
Signed-off-by: aguilard <e.dah.tid@telefonica.com>
diff --git a/robot-systest/lib/openstack_lib.robot b/robot-systest/lib/openstack_lib.robot
index c72892e..884ec4f 100644
--- a/robot-systest/lib/openstack_lib.robot
+++ b/robot-systest/lib/openstack_lib.robot
@@ -58,3 +58,36 @@
Should Be Equal As Integers ${rc} ${success_return_code}
[Return] ${stdout}
+
+Get Server Property
+ [Documentation] Get a field (flavor, image, volumes_attached, etc.) from a server.
+ [Arguments] ${server_id} ${field}
+
+ Should Not Be Empty ${server_id}
+ Should Not Be Empty ${field}
+ ${rc} ${stdout}= Run and Return RC and Output openstack server show ${server_id} -c ${field} -f value
+ log ${stdout}
+ Should Be Equal As Integers ${rc} ${success_return_code}
+ [Return] ${stdout}
+
+
+Check If Volume Exists
+ [Documentation] Checks if a volume id exists
+ [Arguments] ${volume_id}
+
+ Should Not Be Empty ${volume_id}
+ ${rc} ${stdout}= Run and Return RC and Output openstack volume list | grep ${volume_id} | wc -l
+ log ${stdout}
+ Should Be Equal As Integers ${rc} ${success_return_code}
+ [Return] ${stdout}
+
+
+Delete Volume
+ [Documentation] Delete a volume by its identifier
+ [Arguments] ${volume_id}
+
+ Should Not Be Empty ${volume_id}
+ ${rc} ${stdout}= Run and Return RC and Output openstack volume delete ${volume_id}
+ log ${stdout}
+ Should Be Equal As Integers ${rc} ${success_return_code}
+ [Return] ${stdout}