X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=robot-systest%2Flib%2Fopenstack_lib.robot;h=bdf49aa09a29069a6b1b4177f52b65148d54bfc8;hb=4a94affec35c3d9624c1c1574036d8b02bcbc8e7;hp=1f1020d0a2ed7700c582379c0e801096da83cdd5;hpb=8ceaee06848023c31ec4a18becff9ab8ff5d517f;p=osm%2Ftests.git diff --git a/robot-systest/lib/openstack_lib.robot b/robot-systest/lib/openstack_lib.robot index 1f1020d..bdf49aa 100644 --- a/robot-systest/lib/openstack_lib.robot +++ b/robot-systest/lib/openstack_lib.robot @@ -64,7 +64,7 @@ Get Project Quota [Arguments] ${field} Should Not Be Empty ${field} - ${rc} ${stdout}= Run and Return RC and Output openstack quota show -c ${field} -f value + ${rc} ${stdout}= Run and Return RC and Output openstack quota show -f yaml | yq '.[] | select(.Resource=="${field}") | .Limit' Log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} [Return] ${stdout} @@ -147,6 +147,17 @@ Delete Volume [Return] ${stdout} +Get Subnet + [Documentation] Get subnet information in JSON format + [Arguments] ${subnet_id} + + Should Not Be Empty ${subnet_id} + ${rc} ${stdout}= Run and Return RC and Output openstack subnet show ${subnet_id} -f json + Log ${stdout} + Should Be Equal As Integers ${rc} ${success_return_code} + [Return] ${stdout} + + Stop Server [Documentation] Stop a server [Arguments] ${server_id} @@ -180,3 +191,23 @@ Delete Server [Return] ${stdout} +Create Flavor + [Documentation] Create a Flavor + [Arguments] ${flavor_name} ${cpu}=1 ${ram}=1024 ${disk}=10 + + Should Not Be Empty ${flavor_name} + ${rc} ${flavor_id}= Run and Return RC and Output openstack flavor create ${flavor_name} --ram ${ram} --disk ${disk} --vcpus ${cpu} -f yaml | yq '.id' | tr -d \\" + Log ${flavor_id} + Should Be Equal As Integers ${rc} ${success_return_code} + [Return] ${flavor_id} + + +Delete Flavor + [Documentation] Delete a Flavor + [Arguments] ${flavor_id} + + Should Not Be Empty ${flavor_id} + ${rc} ${stdout}= Run and Return RC and Output openstack flavor delete ${flavor_id} + Log ${stdout} + Should Be Equal As Integers ${rc} ${success_return_code} + [Return] ${stdout}