Update Robot Framework format - step 6
[integration/test.git] / csit / suites / genius / ID_manager.robot
index 58b1ea78d9445b6af80e6cdfcfd2bd0d213a55b5..f648ed8e825b470b72ca3f208b6571505d804703 100644 (file)
@@ -1,36 +1,44 @@
 *** Settings ***
-Documentation     Test Suite for IdManager
-Suite Setup       Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}    timeout=5
-Suite Teardown    Delete All Sessions
-Test Setup        Genius Test Setup
-Test Teardown     Get Model Dump    ${ODL_SYSTEM_IP}    ${idmanager_data_models}
-Library           OperatingSystem
-Library           String
-Library           RequestsLibrary
-Library           Collections
-Library           re
-Variables         ../../variables/genius/Modules.py
-Resource          ../../libraries/DataModels.robot
-Resource          ../../libraries/Utils.robot
-Resource          ../../libraries/Genius.robot
-Resource          ../../variables/Variables.robot
+Documentation       Test Suite for IdManager
+
+Library             OperatingSystem
+Library             String
+Library             RequestsLibrary
+Library             Collections
+Library             re
+Variables           ../../variables/genius/Modules.py
+Resource            ../../libraries/DataModels.robot
+Resource            ../../libraries/Utils.robot
+Resource            ../../libraries/Genius.robot
+Resource            ../../variables/Variables.robot
+
+Suite Setup         Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}    timeout=5
+Suite Teardown      Delete All Sessions
+Test Setup          Genius Test Setup
+Test Teardown       Get Model Dump    ${ODL_SYSTEM_IP}    ${idmanager_data_models}
+
 
 *** Variables ***
-${genius_config_dir}    ${CURDIR}/../../variables/genius
-${pool-name}      test-pool
-@{test_keys}      test-key1    test-key2    test-key3
-${create_json}    createIdpool.json
-${allocaterange_json}    allocateIdRange.json
-${OPERATIONS_API}    /restconf/operations
+${genius_config_dir}        ${CURDIR}/../../variables/genius
+${pool-name}                test-pool
+@{test_keys}                test-key1    test-key2    test-key3
+${create_json}              createIdpool.json
+${allocaterange_json}       allocateIdRange.json
+${OPERATIONS_API}           /restconf/operations
+
 
 *** Test Cases ***
 Create ID pool in range 10:20
     [Documentation]    This testcase creates Id pool in range 10 to 20.
-    Utils.Post Elements To URI From File    ${OPERATIONS_API}/id-manager:createIdPool    ${genius_config_dir}/${create_json}
+    Utils.Post Elements To URI From File
+    ...    ${OPERATIONS_API}/id-manager:createIdPool
+    ...    ${genius_config_dir}/${create_json}
     @{poolrange} =    BuiltIn.Create list    ${pool-name}    10    20
     Utils.Check For Elements At URI    ${CONFIG_API}/id-manager:id-pools/id-pool/${pool-name}/    ${poolrange}
     @{availiable_pool} =    BuiltIn.Create list    10    20    10
-    Utils.Check For Elements At URI    ${CONFIG_API}/id-manager:id-pools/id-pool/${pool-name}/available-ids-holder/    ${availiable_pool}
+    Utils.Check For Elements At URI
+    ...    ${CONFIG_API}/id-manager:id-pools/id-pool/${pool-name}/available-ids-holder/
+    ...    ${availiable_pool}
 
 Allocate Ids from pool created within size as 5
     [Documentation]    This testcase allocated IDs of specified size for the pool created in 1st testcase.
@@ -47,18 +55,23 @@ Neg_Allocate ids of size 10 from the same pool
     ${body} =    String.Replace String    ${body}    5    6
     ${body} =    String.Replace String    ${body}    test-key    ${test_keys[1]}
     BuiltIn.Log    ${body}
-    ${resp} =    RequestsLibrary.Post Request    session    ${OPERATIONS_API}/id-manager:allocateIdRange    data=${body}
+    ${resp} =    RequestsLibrary.Post Request
+    ...    session
+    ...    ${OPERATIONS_API}/id-manager:allocateIdRange
+    ...    data=${body}
     BuiltIn.Log    ${resp.content}
     BuiltIn.Should Be Equal As Strings    ${resp.status_code}    500
 
 Allocate IDs of size 3 from the pool
     [Documentation]    This testcase allocates 3 Ids from the created pool in test case 1
-    ${body}=    OperatingSystem.Get File    ${genius_config_dir}/${allocaterange_json}
+    ${body} =    OperatingSystem.Get File    ${genius_config_dir}/${allocaterange_json}
     ${body} =    String.Replace string    ${body}    test-key    ${test_keys[2]}
     ${body} =    String.Replace string    ${body}    5    3
     BuiltIn.Log    ${body}
     Utils.Post Elements To URI    ${OPERATIONS_API}/id-manager:allocateIdRange    ${body}
-    ${get_resp} =    RequestsLibrary.Get Request    session    ${CONFIG_API}/id-manager:id-pools/id-pool/${pool-name}/available-ids-holder/
+    ${get_resp} =    RequestsLibrary.Get Request
+    ...    session
+    ...    ${CONFIG_API}/id-manager:id-pools/id-pool/${pool-name}/available-ids-holder/
     ${respjson} =    RequestsLibrary.To Json    ${get_resp.content}    pretty_print=True
     BuiltIn.Log    ${respjson}
     BuiltIn.Should Contain    ${get_resp.text}    17
@@ -76,7 +89,9 @@ Release a block of IDs allocated using releaseIds RPC
     BuiltIn.Should Be Equal As Strings    ${get_resp.status_code}    200
     ${child-pool-name} =    BuiltIn.Should Match Regexp    ${get_resp.text}    ${pool-name}\.[-]?[0-9]+
     BuiltIn.Log    ${child-pool-name}
-    ${get_releasedIds} =    RequestsLibrary.Get Request    session    ${CONFIG_API}/id-manager:id-pools/id-pool/${child-pool-name}/released-ids-holder/
+    ${get_releasedIds} =    RequestsLibrary.Get Request
+    ...    session
+    ...    ${CONFIG_API}/id-manager:id-pools/id-pool/${child-pool-name}/released-ids-holder/
     ${respjson} =    RequestsLibrary.To Json    ${get_releasedIds.text}    pretty_print=True
     BuiltIn.Log    ${respjson}
     Should Be Equal As Strings    ${get_releasedIds.status_code}    200
@@ -91,10 +106,13 @@ Delete the ID Pool using deleteIdPool RPC
     Utils.Post Elements To URI    ${OPERATIONS_API}/id-manager:deleteIdPool    ${body}
     Utils.No Content From URI    session    ${CONFIG_API}/id-manager:id-pools/id-pool/${pool-name}/
 
+
 *** Keywords ***
 get Id pool
     [Documentation]    This keyword checks the created ID pool by doing GET.
-    ${get_resp} =    RequestsLibrary.Get Request    session    ${CONFIG_API}/id-manager:id-pools/id-pool/${pool-name}/available-ids-holder/
+    ${get_resp} =    RequestsLibrary.Get Request
+    ...    session
+    ...    ${CONFIG_API}/id-manager:id-pools/id-pool/${pool-name}/available-ids-holder/
     ${respjson} =    RequestsLibrary.To Json    ${get_resp.content}    pretty_print=True
     BuiltIn.Log    ${respjson}
     BuiltIn.Should Contain    ${get_resp.text}    14