Update Robot Framework format - step 6
[integration/test.git] / csit / suites / genius / ITM_Direct_Tunnels.robot
index ccf21d1302b54e542fb8df351233fd3cf1aac675..25c0c326b65e9b620b2d0a851e641a88616c988c 100644 (file)
@@ -1,26 +1,27 @@
 *** Settings ***
-Documentation     This test suite is to by-pass interface manager and create/delete the tunnels between the switches directly inorder for ITM to scale and build mesh among more number of switches.
-Suite Setup       ITM Direct Tunnels Start Suite
-Suite Teardown    ITM Direct Tunnels Stop Suite
-Test Setup        Genius Test Setup
-Test Teardown     Genius Test Teardown    ${data_models}
-Library           Collections
-Library           OperatingSystem
-Library           RequestsLibrary
-Library           String
-Resource          ../../libraries/ClusterManagement.robot
-Resource          ../../libraries/DataModels.robot
-Resource          ../../libraries/Genius.robot
-Resource          ../../libraries/KarafKeywords.robot
-Resource          ../../variables/netvirt/Variables.robot
-Resource          ../../libraries/OVSDB.robot
-Resource          ../../libraries/ToolsSystem.robot
-Resource          ../../libraries/Utils.robot
-Resource          ../../libraries/VpnOperations.robot
-Resource          ../../variables/Variables.robot
-Variables         ../../variables/genius/Modules.py
+Documentation       This test suite is to by-pass interface manager and create/delete the tunnels between the switches directly inorder for ITM to scale and build mesh among more number of switches.
+
+Library             Collections
+Library             OperatingSystem
+Library             RequestsLibrary
+Library             String
+Resource            ../../libraries/ClusterManagement.robot
+Resource            ../../libraries/DataModels.robot
+Resource            ../../libraries/Genius.robot
+Resource            ../../libraries/KarafKeywords.robot
+Resource            ../../variables/netvirt/Variables.robot
+Resource            ../../libraries/OVSDB.robot
+Resource            ../../libraries/ToolsSystem.robot
+Resource            ../../libraries/Utils.robot
+Resource            ../../libraries/VpnOperations.robot
+Resource            ../../variables/Variables.robot
+Variables           ../../variables/genius/Modules.py
+
+Suite Setup         ITM Direct Tunnels Start Suite
+Suite Teardown      ITM Direct Tunnels Stop Suite
+Test Setup          Genius Test Setup
+Test Teardown       Genius Test Teardown    ${data_models}
 
-*** Variables ***
 
 *** Test Cases ***
 Create and Verify VTEP
@@ -46,7 +47,11 @@ Verify VTEP After Restarting Controller
     BuiltIn.Wait Until Keyword Succeeds    30    3    Genius.Verify Tunnel Status As Up
     ClusterManagement.Stop_Members_From_List_Or_All
     ClusterManagement.Start_Members_From_List_Or_All
-    BuiltIn.Wait Until Keyword Succeeds    60    3    ClusterManagement.Check Status Of Services Is OPERATIONAL    @{GENIUS_DIAG_SERVICES}
+    BuiltIn.Wait Until Keyword Succeeds
+    ...    60
+    ...    3
+    ...    ClusterManagement.Check Status Of Services Is OPERATIONAL
+    ...    @{GENIUS_DIAG_SERVICES}
     BuiltIn.Wait Until Keyword Succeeds    30    3    Genius.Verify Tunnel Status As Up
 
 Verify Tunnels By Enabling/Disabling BFD
@@ -60,25 +65,35 @@ Delete and Verify VTEP
     [Documentation]    This Delete testcase , deletes the ITM tunnel created between 2 dpns.
     ${tunnel_list} =    Genius.Get Tunnels List
     FOR    ${dpn_id}    IN    @{DPN_ID_LIST}
-        CompareStream.Run_Keyword_If_Less_Than_Sodium    Utils.Remove All Elements At URI And Verify    ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/subnets/${SUBNET}%2F16/vteps/${dpn_id}/${port_name}
-        CompareStream.Run_Keyword_If_At_Least_Sodium    Utils.Remove All Elements At URI And Verify    ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/vteps/${dpn_id}
+        CompareStream.Run_Keyword_If_Less_Than_Sodium
+        ...    Utils.Remove All Elements At URI And Verify
+        ...    ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/subnets/${SUBNET}%2F16/vteps/${dpn_id}/${port_name}
+        CompareStream.Run_Keyword_If_At_Least_Sodium
+        ...    Utils.Remove All Elements At URI And Verify
+        ...    ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/vteps/${dpn_id}
     END
     ${output} =    KarafKeywords.Issue Command On Karaf Console    ${TEP_SHOW}
     BuiltIn.Should Not Contain    ${output}    ${itm_created[0]}
     Utils.Remove All Elements At URI And Verify    ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/
     ${resp} =    Utils.Get Data From URI    session    ${CONFIG_API}/itm:transport-zones/
     BuiltIn.Should Not Contain    ${resp}    ${itm_created[0]}
-    BuiltIn.Wait Until Keyword Succeeds    40    10    Genius.Verify Deleted Tunnels On OVS    ${tunnel_list}    ${resp}
+    BuiltIn.Wait Until Keyword Succeeds
+    ...    40
+    ...    10
+    ...    Genius.Verify Deleted Tunnels On OVS
+    ...    ${tunnel_list}
+    ...    ${resp}
     BuiltIn.Wait Until Keyword Succeeds    40    10    Genius.Check Tunnel Delete On OVS    ${tunnel_list}
 
+
 *** Keywords ***
 Enable_Tunnel_Monitoring
     [Documentation]    In this we will enable tunnel monitoring by tep:enable command running in karaf console
     KarafKeywords.Issue_Command_On_Karaf_Console    tep:enable-tunnel-monitor true
 
 Verify Tunnel State After OVS Restart
-    [Arguments]    ${TOOLS_SYSTEM_IP}
     [Documentation]    In this we will Verify Tunnel State by Stopping/Starting Switch
+    [Arguments]    ${TOOLS_SYSTEM_IP}
     OVSDB.Stop OVS    ${TOOLS_SYSTEM_IP}
     BuiltIn.Wait Until Keyword Succeeds    2min    20 sec    Verify Tunnel Down
     OVSDB.Start OVS    ${TOOLS_SYSTEM_IP}
@@ -86,7 +101,7 @@ Verify Tunnel State After OVS Restart
 
 Verify Tunnel Down
     [Documentation]    In this we will check whether tunnel is in down or not
-    ${output}=    KarafKeywords.Issue_Command_On_Karaf_Console    ${TEP_SHOW_STATE}
+    ${output} =    KarafKeywords.Issue_Command_On_Karaf_Console    ${TEP_SHOW_STATE}
     BuiltIn.Should Contain    ${output}    DOWN
 
 Disable_Tunnel_Monitoring
@@ -95,8 +110,10 @@ Disable_Tunnel_Monitoring
 
 Verify Tunnels By Enabling BFD
     [Documentation]    Verify tunnel creation by enabling BFD monitoring.
-    ${result} =    BuiltIn.Run Keyword And Return Status    Genius.Verify Tunnel Monitoring Status    ${TUNNEL_MONITOR_ON}
-    BuiltIn.Run Keyword If    '${result}' == 'False'    Enable_Tunnel_monitoring
+    ${result} =    BuiltIn.Run Keyword And Return Status
+    ...    Genius.Verify Tunnel Monitoring Status
+    ...    ${TUNNEL_MONITOR_ON}
+    IF    '${result}' == 'False'    Enable_Tunnel_monitoring
     FOR    ${tools_ip}    IN    @{TOOLS_SYSTEM_ALL_IPS}
         Verify Tunnel State After OVS Restart    ${tools_ip}
     END
@@ -104,7 +121,7 @@ Verify Tunnels By Enabling BFD
 Verify Tunnels By Disabling BFD
     [Documentation]    Verify tunnel creation by disabling BFD monitoring.
     ${result} =    Run Keyword And Return Status    Genius.Verify Tunnel Monitoring Status    ${TUNNEL_MONITOR_ON}
-    BuiltIn.Run Keyword If    '${result}' == 'True'    Disable_Tunnel_Monitoring
+    IF    '${result}' == 'True'    Disable_Tunnel_Monitoring
     ${tunnels_on_OVS} =    Genius.Get Tunnels On OVS    ${TOOLS_SYSTEM_ALL_CONN_IDS[0]}
     OVSDB.Stop OVS    ${TOOLS_SYSTEM_IP}
     BuiltIn.Wait Until Keyword Succeeds    10s    1s    Genius.Verify Tunnel Status    UNKNOWN    ${tunnels_on_OVS}