Feature 10975: Modify heal_02 to test instantiation, scaling and healing using an...
[osm/tests.git] / robot-systest / lib / openstack_lib.robot
index b95b0c3..bdf49aa 100644 (file)
@@ -191,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}