Refactor Genius 47/69747/4
authorSathwik Boggarapu <b.sathwik@ericsson.com>
Wed, 21 Mar 2018 10:36:35 +0000 (16:06 +0530)
committerSathwik Boggarapu <b.sathwik@ericsson.com>
Fri, 23 Mar 2018 06:25:07 +0000 (11:55 +0530)
Removing unnecessary logging statements and global varibales

Change-Id: I14039c972463a40783b66e9e42da49900a40fdd8
Signed-off-by: Sathwik Boggarapu <b.sathwik@ericsson.com>
csit/libraries/Genius.robot
csit/suites/genius/BFD_monitoring.robot
csit/suites/genius/Configure_ITM.robot
csit/suites/genius/Interface_manager.robot

index fd2323da8bad6a7fe6a6e7a3422ae4dd1a487fb1..c0bc37f9340a787e88da4f19ec9c53e761fb2f35 100644 (file)
@@ -32,7 +32,7 @@ Genius Suite Teardown
 
 Start Suite
     [Documentation]    Initial setup for Genius test suites
-    Run_Keyword_If_At_Least_Oxygen    Check Service Status    ACTIVE    OPERATIONAL
+    Run_Keyword_If_At_Least_Oxygen    Wait Until Keyword Succeeds    10    1    Check Service Status    ACTIVE    OPERATIONAL
     Log    Start the tests
     ${conn_id_1}=    Open Connection    ${TOOLS_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=30s
     Set Global Variable    ${conn_id_1}
index 8758cac81b30c4f0a21511c9a5e6cc4ad5aee048..7296defe13f586e1aa7101ad04c61de7795d4ec2 100644 (file)
@@ -58,7 +58,6 @@ BFD_TC01 Verify by default BFD monitoring is enabled on Controller
 BFD_TC02 Verify that BFD tunnel monitoring interval is set with appropriate default value i.e.,1000
     [Documentation]    This will verify BFD tunnel monitoring default interval
     ${output}=    Issue Command On Karaf Console    ${TEP_SHOW}
-    Log    ${output}
     Should Contain    ${output}    ${DEFAULT_MONITORING_INTERVAL}
     Wait Until Keyword Succeeds    10s    2s    Verify Config Ietf Interface Output    ${INTERFACE_DS_MONI_TRUE}    ${INTERFACE_DS_MONI_INT_1000}    ${TUNNEL_MONI_PROTO}
 
@@ -70,11 +69,9 @@ BFD_TC04 Verify that in controller tunnel status is up when ITM tunnel interface
 
 BFD_TC05 Verify BFD tunnel monitoring interval can be changed.
     [Documentation]    Verify BFD tunnel monitoring interval can be changed.
-    Log    "Value of BFD monitoring interval before updating with new value"
     ${oper_int}    RequestsLibrary.Get Request    session    ${OPERATIONAL_API}/itm-config:tunnel-monitor-interval/
     ${respjson}    RequestsLibrary.To Json    ${oper_int.content}    pretty_print=True
     Log    ${respjson}
-    Log    "Value of BFD monitoring interval is getting updated"
     ${oper_int}    RequestsLibrary.Put Request    session    ${CONFIG_API}/itm-config:tunnel-monitor-interval/    data=${INTERVAL_5000}
     ${Bfd_updated_value}=    Create List    5000
     Wait Until Keyword Succeeds    30s    10s    Check For Elements At Uri    ${OPERATIONAL_API}/itm-config:tunnel-monitor-interval/    ${Bfd_updated_value}
@@ -93,18 +90,14 @@ BFD_TC05 Verify BFD tunnel monitoring interval can be changed.
 
 BFD_TC06 Verify that the tunnel state goes to UNKNOWN when DPN is disconnected
     [Documentation]    Verify that the tunnel state goes to UNKNOWN when DPN is disconnected
-    ${output}=    Issue Command On Karaf Console    ${TEP_SHOW}
-    Log    ${output}
-    ${output}=    Issue Command On Karaf Console    ${TEP_SHOW_STATE}
-    Log    ${output}
+    Issue Command On Karaf Console    ${TEP_SHOW}
+    Issue Command On Karaf Console    ${TEP_SHOW_STATE}
     SSHLibrary.Switch Connection    ${conn_id_1}
     Execute Command    sudo ovs-vsctl del-controller BR1
     SSHLibrary.Switch Connection    ${conn_id_2}
     Execute Command    sudo ovs-vsctl del-controller BR2
-    ${output}=    Issue Command On Karaf Console    ${TEP_SHOW}
-    Log    ${output}
-    ${output}=    Issue Command On Karaf Console    ${TEP_SHOW_STATE}
-    Log    ${output}
+    Issue Command On Karaf Console    ${TEP_SHOW}
+    Issue Command On Karaf Console    ${TEP_SHOW_STATE}
     Wait Until Keyword Succeeds    10s    1s    Verify Tunnel Status as UNKNOWN
     Wait Until Keyword Succeeds    10s    2s    Verify Config Ietf Interface Output    ${INTERFACE_DS_MONI_TRUE}    ${INTERFACE_DS_MONI_INT_5000}    ${TUNNEL_MONI_PROTO}
     SSHLibrary.Switch Connection    ${conn_id_1}
@@ -112,10 +105,8 @@ BFD_TC06 Verify that the tunnel state goes to UNKNOWN when DPN is disconnected
     SSHLibrary.Switch Connection    ${conn_id_2}
     Execute Command    sudo ovs-vsctl set-controller BR2 tcp:${ODL_SYSTEM_IP}:${ODL_OF_PORT}
     Log    "After connecting CSS with controller"
-    ${output}=    Issue Command On Karaf Console    ${TEP_SHOW}
-    Log    ${output}
-    ${output}=    Issue Command On Karaf Console    ${TEP_SHOW_STATE}
-    Log    ${output}
+    Issue Command On Karaf Console    ${TEP_SHOW}
+    Issue Command On Karaf Console    ${TEP_SHOW_STATE}
     Wait Until Keyword Succeeds    10s    1s    Verify Tunnel Status as UP
     Wait Until Keyword Succeeds    10s    2s    Verify Config Ietf Interface Output    ${INTERFACE_DS_MONI_TRUE}    ${INTERFACE_DS_MONI_INT_5000}    ${TUNNEL_MONI_PROTO}
 
@@ -125,12 +116,9 @@ BFD_TC07 Verify that BFD monitoring is disabled on Controller
     Should Be Equal As Strings    ${resp.status_code}    201
     Wait Until Keyword Succeeds    10s    2s    Verify Tunnel Monitoring Params    ${TUNNEL_MONI_PARAMS_FALSE}
     ${output}=    Issue Command On Karaf Console    ${TEP_SHOW}
-    Log    ${output}
     Should Contain    ${output}    ${TUNNEL_MONITOR_OFF}
     Wait Until Keyword Succeeds    10s    2s    Verify Config Ietf Interface Output    ${INTERFACE_DS_MONI_FALSE}    ${INTERFACE_DS_MONI_INT_5000}    ${TUNNEL_MONI_PROTO}
-    Log    "Verifying tunnel is UP after BFD is disabled"
     Wait Until Keyword Succeeds    10s    1s    Verify Tunnel Status as UP
-    Log    "Enabling tunnel monitoring once again"
     ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_API}/itm-config:tunnel-monitor-params/    data=${ENABLE_MONITORING}
     Should Be Equal As Strings    ${resp.status_code}    200
     Wait Until Keyword Succeeds    10s    2s    Verify Tunnel Monitoring Params    ${TUNNEL_MONI_PARAMS_TRUE}
index ee52337a07e00d97cb120ded535a41a74e25d4d7..c4398b3a007b1ade85615d08b46de9bdf56906dd 100644 (file)
@@ -30,45 +30,34 @@ Create and Verify VTEP -No Vlan
     Genius.Create Vteps    ${Dpn_id_1}    ${Dpn_id_2}    ${TOOLS_SYSTEM_IP}    ${TOOLS_SYSTEM_2_IP}    ${vlan}    ${gateway-ip}
     Wait Until Keyword Succeeds    40    10    Get ITM    ${itm_created[0]}    ${subnet}    ${vlan}
     ...    ${Dpn_id_1}    ${TOOLS_SYSTEM_IP}    ${Dpn_id_2}    ${TOOLS_SYSTEM_2_IP}
-    ${type}    set variable    odl-interface:tunnel-type-vxlan
+    ${type}    Set Variable    odl-interface:tunnel-type-vxlan
     ${tunnel-1}    Wait Until Keyword Succeeds    40    20    Get Tunnel    ${Dpn_id_1}    ${Dpn_id_2}
     ...    ${type}
-    Set Global Variable    ${tunnel-1}
     ${tunnel-2}    Wait Until Keyword Succeeds    40    20    Get Tunnel    ${Dpn_id_2}    ${Dpn_id_1}
     ...    ${type}
-    Set Global Variable    ${tunnel-2}
     ${tunnel-type}=    Set Variable    type: vxlan
     Wait Until Keyword Succeeds    40    5    Get Data From URI    session    ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${Dpn_id_1}/
     Wait Until Keyword Succeeds    40    5    Get Data From URI    session    ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${Dpn_id_2}/
-    Log    >>>>OVS Validation in Switch 1 for Tunnel Created<<<<<
     Wait Until Keyword Succeeds    40    10    Genius.Ovs Verification For 2 Dpn    ${conn_id_1}    ${TOOLS_SYSTEM_IP}    ${TOOLS_SYSTEM_2_IP}
     ...    ${tunnel-1}    ${tunnel-type}
-    Log    >>>>OVS Validation in Switch 2 for Tunnel Created<<<<<
     Wait Until Keyword Succeeds    40    10    Genius.Ovs Verification For 2 Dpn    ${conn_id_2}    ${TOOLS_SYSTEM_2_IP}    ${TOOLS_SYSTEM_IP}
     ...    ${tunnel-2}    ${tunnel-type}
-    Log    >>>> Getting Network Topology Operational <<<<<<
     ${resp}    Wait Until Keyword Succeeds    40    10    Get Network Topology with Tunnel    ${Bridge-1}    ${Bridge-2}
     ...    ${tunnel-1}    ${tunnel-2}    ${OPERATIONAL_TOPO_API}
-    Log    >>>>Validating Interface 1 & 2 states<<<<
     ${return}    Validate interface state    ${tunnel-1}    ${Dpn_id_1}    ${tunnel-2}    ${Dpn_id_2}
     log    ${return}
     ${lower-layer-if-1}    Get from List    ${return}    0
     ${port-num-1}    Get From List    ${return}    1
     ${lower-layer-if-2}    Get from List    ${return}    2
     ${port-num-2}    Get From List    ${return}    3
-    Log    >>>>>Verify Oper data base of Interface state<<<<<
     ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_API}/ietf-interfaces:interfaces-state/
     ${respjson}    RequestsLibrary.To Json    ${resp.content}    pretty_print=True
     Log    ${respjson}
     Should Be Equal As Strings    ${resp.status_code}    200
     Should Contain    ${resp.content}    ${Dpn_id_1}    ${tunnel-1}
     Should Contain    ${resp.content}    ${Dpn_id_2}    ${tunnel-2}
-    Log    >>>>> Checking Entry in table 0 on OVS 1<<<<<
-    ${check-3}    Wait Until Keyword Succeeds    40    10    Genius.Check Table0 Entry For 2 Dpn    ${conn_id_1}    ${Bridge-1}
-    ...    ${port-num-1}
-    Log    >>>>> Checking Entry in table 0 on OVS 2<<<<<
-    ${check-4}    Wait Until Keyword Succeeds    40    10    Genius.Check Table0 Entry For 2 Dpn    ${conn_id_2}    ${Bridge-2}
-    ...    ${port-num-2}
+    Wait Until Keyword Succeeds    40    10    Genius.Check Table0 Entry For 2 Dpn    ${conn_id_1}    ${Bridge-1}    ${port-num-1}
+    Wait Until Keyword Succeeds    40    10    Genius.Check Table0 Entry For 2 Dpn    ${conn_id_2}    ${Bridge-2}    ${port-num-2}
     ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_API}/opendaylight-inventory:nodes/
     ${respjson}    RequestsLibrary.To Json    ${resp.content}    pretty_print=True
     Log    ${respjson}
@@ -77,11 +66,16 @@ Create and Verify VTEP -No Vlan
 
 Delete and Verify VTEP -No Vlan
     [Documentation]    This Delete testcase , deletes the ITM tunnel created between 2 dpns.
+    ${Dpn_id_1}    Genius.Get Dpn Ids    ${conn_id_1}
+    ${Dpn_id_2}    Genius.Get Dpn Ids    ${conn_id_2}
+    ${type}    Set Variable    odl-interface:tunnel-type-vxlan
+    ${tunnel-1}    Get_Tunnel    ${Dpn_id_1}    ${Dpn_id_2}    ${type}
+    ${tunnel-2}    Get_Tunnel    ${Dpn_id_2}    ${Dpn_id_1}    ${type}
     Remove All Elements At URI And Verify    ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/
     ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_API}/itm-state:tunnels_state/
     Should Not Contain    ${resp}    ${tunnel-1}    ${tunnel-2}
-    ${Ovs-del-1}    Wait Until Keyword Succeeds    40    10    Genius.Check Tunnel Delete On OVS    ${conn_id_1}    ${tunnel-1}
-    ${Ovs-del-2}    Wait Until Keyword Succeeds    40    10    Genius.Check Tunnel Delete On OVS    ${conn_id_2}    ${tunnel-2}
+    Wait Until Keyword Succeeds    40    10    Genius.Check Tunnel Delete On OVS    ${conn_id_1}    ${tunnel-1}
+    Wait Until Keyword Succeeds    40    10    Genius.Check Tunnel Delete On OVS    ${conn_id_2}    ${tunnel-2}
 
 Create and Verify VTEP IPv6 - No Vlan
     [Documentation]    This testcase creates a Internal Transport Manager - ITM tunnel between 2 DPNs without VLAN and Gateway configured in Json.
@@ -94,33 +88,33 @@ Create and Verify VTEP IPv6 - No Vlan
     Create Vteps IPv6    ${Dpn_id_1}    ${Dpn_id_2}    ${TOOLS_SYSTEM_IP}    ${TOOLS_SYSTEM_2_IP}    ${vlan}    ${gateway-ip}
     Wait Until Keyword Succeeds    40    10    Get ITM    ${itm_created[0]}    ${subnet}    ${vlan}
     ...    ${Dpn_id_1}    ${TOOLS_SYSTEM_IP}    ${Dpn_id_2}    ${TOOLS_SYSTEM_2_IP}
-    ${type}    set variable    odl-interface:tunnel-type-vxlan
+    ${type}    Set Variable    odl-interface:tunnel-type-vxlan
     ${tunnel-1}    Wait Until Keyword Succeeds    40    10    Get Tunnel    ${Dpn_id_1}    ${Dpn_id_2}
     ...    ${type}
-    Set Global Variable    ${tunnel-1}
     ${tunnel-2}    Wait Until Keyword Succeeds    40    10    Get Tunnel    ${Dpn_id_2}    ${Dpn_id_1}
     ...    ${type}
-    Set Global Variable    ${tunnel-2}
     ${tunnel-type}=    Set Variable    type: vxlan
     Wait Until Keyword Succeeds    40    5    Get Data From URI    session    ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${Dpn_id_1}/    headers=${ACCEPT_XML}
     Wait Until Keyword Succeeds    40    5    Get Data From URI    session    ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${Dpn_id_2}/    headers=${ACCEPT_XML}
-    Log    >>>>OVS Validation in Switch 1 for Tunnel Created<<<<<
     Wait Until Keyword Succeeds    40    10    Genius.Ovs Verification For 2 Dpn    ${conn_id_1}    ${TOOLS_SYSTEM_IP}    ${TOOLS_SYSTEM_2_IP}
     ...    ${tunnel-1}    ${tunnel-type}
-    Log    >>>>OVS Validation in Switch 2 for Tunnel Created<<<<<
     Wait Until Keyword Succeeds    40    10    Genius.Ovs Verification For 2 Dpn    ${conn_id_2}    ${TOOLS_SYSTEM_2_IP}    ${TOOLS_SYSTEM_IP}
     ...    ${tunnel-2}    ${tunnel-type}
-    Log    >>>> Getting Network Topology Operational <<<<<<
     ${resp}    Wait Until Keyword Succeeds    40    10    Get Network Topology with Tunnel    ${Bridge-1}    ${Bridge-2}
     ...    ${tunnel-1}    ${tunnel-2}    ${OPERATIONAL_TOPO_API}
 
 Delete and Verify VTEP IPv6 -No Vlan
     [Documentation]    This Delete testcase , deletes the ITM tunnel created between 2 dpns.
+    ${Dpn_id_1}    Genius.Get Dpn Ids    ${conn_id_1}
+    ${Dpn_id_2}    Genius.Get Dpn Ids    ${conn_id_2}
+    ${type}    Set Variable    odl-interface:tunnel-type-vxlan
+    ${tunnel-1}    Get_Tunnel    ${Dpn_id_1}    ${Dpn_id_2}    ${type}
+    ${tunnel-2}    Get_Tunnel    ${Dpn_id_2}    ${Dpn_id_1}    ${type}
     Remove All Elements At URI And Verify    ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/
     ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_API}/itm-state:tunnels_state/
     Should Not Contain    ${resp}    ${tunnel-1}    ${tunnel-2}
-    ${Ovs-del-1}    Wait Until Keyword Succeeds    40    10    Genius.Check Tunnel Delete On OVS    ${conn_id_1}    ${tunnel-1}
-    ${Ovs-del-2}    Wait Until Keyword Succeeds    40    10    Genius.Check Tunnel Delete On OVS    ${conn_id_2}    ${tunnel-2}
+    Wait Until Keyword Succeeds    40    10    Genius.Check Tunnel Delete On OVS    ${conn_id_1}    ${tunnel-1}
+    Wait Until Keyword Succeeds    40    10    Genius.Check Tunnel Delete On OVS    ${conn_id_2}    ${tunnel-2}
 
 Create and Verify VTEP-Vlan
     [Documentation]    This testcase creates a Internal Transport Manager - ITM tunnel between 2 DPNs with VLAN and \ without Gateway configured in Json.
@@ -132,43 +126,33 @@ Create and Verify VTEP-Vlan
     ${get}    Wait Until Keyword Succeeds    40    10    Get ITM    ${itm_created[0]}    ${subnet}
     ...    ${vlan}    ${Dpn_id_1}    ${TOOLS_SYSTEM_IP}    ${Dpn_id_2}    ${TOOLS_SYSTEM_2_IP}
     Log    ${get}
-    ${type}    set variable    odl-interface:tunnel-type-vxlan
-    ${tunnel-3}    Wait Until Keyword Succeeds    40    10    Get Tunnel    ${Dpn_id_1}    ${Dpn_id_2}
+    ${type}    Set Variable    odl-interface:tunnel-type-vxlan
+    ${tunnel-1}    Wait Until Keyword Succeeds    40    10    Get Tunnel    ${Dpn_id_1}    ${Dpn_id_2}
     ...    ${type}
-    log    ${tunnel-3}
-    Set Global Variable    ${tunnel-3}
-    ${tunnel-4}    Wait Until Keyword Succeeds    40    10    Get Tunnel    ${Dpn_id_2}    ${Dpn_id_1}
+    ${tunnel-2}    Wait Until Keyword Succeeds    40    10    Get Tunnel    ${Dpn_id_2}    ${Dpn_id_1}
     ...    ${type}
-    log    ${tunnel-4}
-    Set Global Variable    ${tunnel-4}
     ${tunnel-type}=    Set Variable    type: vxlan
     Wait Until Keyword Succeeds    40    5    Get Data From URI    session    ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${Dpn_id_1}/
     Wait Until Keyword Succeeds    40    5    Get Data From URI    session    ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${Dpn_id_2}/
-    Log    >>>>OVS Validation in Switch 1 for Tunnel Created<<<<<
     Wait Until Keyword Succeeds    40    10    Genius.Ovs Verification For 2 Dpn    ${conn_id_1}    ${TOOLS_SYSTEM_IP}    ${TOOLS_SYSTEM_2_IP}
-    ...    ${tunnel-3}    ${tunnel-type}
-    Log    >>>>OVS Validation in Switch 2 for Tunnel Created<<<<<
+    ...    ${tunnel-1}    ${tunnel-type}
     Wait Until Keyword Succeeds    40    10    Genius.Ovs Verification For 2 Dpn    ${conn_id_2}    ${TOOLS_SYSTEM_2_IP}    ${TOOLS_SYSTEM_IP}
-    ...    ${tunnel-4}    ${tunnel-type}
-    Log    >>>>> Checking Network opertional Topology <<<<<<
-    ${url_2}    set variable    ${OPERATIONAL_API}/network-topology:network-topology/
-    Wait Until Keyword Succeeds    40    10    Get Network Topology with Tunnel    ${Bridge-1}    ${Bridge-2}    ${tunnel-3}
-    ...    ${tunnel-4}    ${url_2}
-    ${return}    Validate interface state    ${tunnel-3}    ${Dpn_id_1}    ${tunnel-4}    ${Dpn_id_2}
+    ...    ${tunnel-2}    ${tunnel-type}
+    ${url_2}    Set Variable    ${OPERATIONAL_API}/network-topology:network-topology/
+    Wait Until Keyword Succeeds    40    10    Get Network Topology with Tunnel    ${Bridge-1}    ${Bridge-2}    ${tunnel-1}
+    ...    ${tunnel-2}    ${url_2}
+    ${return}    Validate interface state    ${tunnel-1}    ${Dpn_id_1}    ${tunnel-2}    ${Dpn_id_2}
     log    ${return}
     ${lower-layer-if-1}    Get from List    ${return}    0
     ${port-num-1}    Get From List    ${return}    1
     ${lower-layer-if-2}    Get from List    ${return}    2
     ${port-num-2}    Get From List    ${return}    3
-    Log    >>>>>Verify Oper data base of Interface state<<<<<
     ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_API}/ietf-interfaces:interfaces-state/
     ${respjson}    RequestsLibrary.To Json    ${resp.content}    pretty_print=True
     Log    ${respjson}
-    Should Contain    ${resp.content}    ${Dpn_id_1}    ${tunnel-3}
-    Should Contain    ${resp.content}    ${Dpn_id_2}    ${tunnel-4}
-    Log    >>>>> Checking Entry in table 0 on OVS 1<<<<<
+    Should Contain    ${resp.content}    ${Dpn_id_1}    ${tunnel-1}
+    Should Contain    ${resp.content}    ${Dpn_id_2}    ${tunnel-2}
     Wait Until Keyword Succeeds    40    10    Genius.Check Table0 Entry For 2 Dpn    ${conn_id_1}    ${Bridge-1}    ${port-num-1}
-    Log    >>>>> Checking Entry in table 0 on OVS \ 2<<<<<
     Wait Until Keyword Succeeds    40    10    Genius.Check Table0 Entry For 2 Dpn    ${conn_id_2}    ${Bridge-2}    ${port-num-2}
     ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_API}/opendaylight-inventory:nodes/
     ${respjson}    RequestsLibrary.To Json    ${resp.content}    pretty_print=True
@@ -178,10 +162,15 @@ Create and Verify VTEP-Vlan
 
 Delete and Verify VTEP -Vlan
     [Documentation]    This Delete testcase , deletes the ITM tunnel created between 2 dpns.
+    ${Dpn_id_1}    Genius.Get Dpn Ids    ${conn_id_1}
+    ${Dpn_id_2}    Genius.Get Dpn Ids    ${conn_id_2}
+    ${type}    Set Variable    odl-interface:tunnel-type-vxlan
+    ${tunnel-1}    Get_Tunnel    ${Dpn_id_1}    ${Dpn_id_2}    ${type}
+    ${tunnel-2}    Get_Tunnel    ${Dpn_id_2}    ${Dpn_id_1}    ${type}
     Remove All Elements At URI And Verify    ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/
-    Wait Until Keyword Succeeds    40    10    Genius.Check ITM Tunnel State    ${tunnel-3}    ${tunnel-4}
-    ${Ovs-del-1}    Wait Until Keyword Succeeds    40    10    Genius.Check Tunnel Delete On OVS    ${conn_id_1}    ${tunnel-3}
-    ${Ovs-del-2}    Wait Until Keyword Succeeds    40    10    Genius.Check Tunnel Delete On OVS    ${conn_id_2}    ${tunnel-4}
+    Wait Until Keyword Succeeds    40    10    Genius.Check ITM Tunnel State    ${tunnel-1}    ${tunnel-2}
+    Wait Until Keyword Succeeds    40    10    Genius.Check Tunnel Delete On OVS    ${conn_id_1}    ${tunnel-1}
+    Wait Until Keyword Succeeds    40    10    Genius.Check Tunnel Delete On OVS    ${conn_id_2}    ${tunnel-2}
 
 Create VTEP - Vlan and Gateway
     [Documentation]    This testcase creates a Internal Transport Manager - ITM tunnel between 2 DPNs with VLAN and Gateway configured in Json.
@@ -195,29 +184,22 @@ Create VTEP - Vlan and Gateway
     Genius.Create Vteps    ${Dpn_id_1}    ${Dpn_id_2}    ${TOOLS_SYSTEM_IP}    ${TOOLS_SYSTEM_2_IP}    ${vlan}    ${gateway-ip}
     Wait Until Keyword Succeeds    40    10    Get ITM    ${itm_created[0]}    ${subnet}    ${vlan}
     ...    ${Dpn_id_1}    ${TOOLS_SYSTEM_IP}    ${Dpn_id_2}    ${TOOLS_SYSTEM_2_IP}
-    ${type}    set variable    odl-interface:tunnel-type-vxlan
-    ${tunnel-5}    Wait Until Keyword Succeeds    40    10    Get Tunnel    ${Dpn_id_1}    ${Dpn_id_2}
+    ${type}    Set Variable    odl-interface:tunnel-type-vxlan
+    ${tunnel-1}    Wait Until Keyword Succeeds    40    10    Get Tunnel    ${Dpn_id_1}    ${Dpn_id_2}
     ...    ${type}
-    log    ${tunnel-5}
-    Set Global Variable    ${tunnel-5}
-    ${tunnel-6}    Wait Until Keyword Succeeds    40    10    Get Tunnel    ${Dpn_id_2}    ${Dpn_id_1}
+    ${tunnel-2}    Wait Until Keyword Succeeds    40    10    Get Tunnel    ${Dpn_id_2}    ${Dpn_id_1}
     ...    ${type}
-    log    ${tunnel-6}
-    Set Global Variable    ${tunnel-6}
     ${tunnel-type}=    Set Variable    type: vxlan
     Wait Until Keyword Succeeds    40    5    Get Data From URI    session    ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${Dpn_id_1}/
     Wait Until Keyword Succeeds    40    5    Get Data From URI    session    ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${Dpn_id_2}/
-    Log    >>>>OVS Validation in Switch 1 for Tunnel Created<<<<<
-    ${check-1}    Wait Until Keyword Succeeds    40    10    Genius.Ovs Verification For 2 Dpn    ${conn_id_1}    ${TOOLS_SYSTEM_IP}
-    ...    ${TOOLS_SYSTEM_2_IP}    ${tunnel-5}    ${tunnel-type}
-    Log    ${check-1}
-    ${check-2}    Wait Until Keyword Succeeds    40    10    Genius.Ovs Verification For 2 Dpn    ${conn_id_2}    ${TOOLS_SYSTEM_2_IP}
-    ...    ${TOOLS_SYSTEM_IP}    ${tunnel-6}    ${tunnel-type}
-    Log    ${check-2}
+    Wait Until Keyword Succeeds    40    10    Genius.Ovs Verification For 2 Dpn    ${conn_id_1}    ${TOOLS_SYSTEM_IP}    ${TOOLS_SYSTEM_2_IP}
+    ...    ${tunnel-1}    ${tunnel-type}
+    Wait Until Keyword Succeeds    40    10    Genius.Ovs Verification For 2 Dpn    ${conn_id_2}    ${TOOLS_SYSTEM_2_IP}    ${TOOLS_SYSTEM_IP}
+    ...    ${tunnel-2}    ${tunnel-type}
     ${resp}    Wait Until Keyword Succeeds    40    10    Get Network Topology with Tunnel    ${Bridge-1}    ${Bridge-2}
-    ...    ${tunnel-5}    ${tunnel-6}    ${OPERATIONAL_TOPO_API}
+    ...    ${tunnel-1}    ${tunnel-2}    ${OPERATIONAL_TOPO_API}
     Log    ${resp}
-    ${return}    Validate interface state    ${tunnel-5}    ${Dpn_id_1}    ${tunnel-6}    ${Dpn_id_2}
+    ${return}    Validate interface state    ${tunnel-1}    ${Dpn_id_1}    ${tunnel-2}    ${Dpn_id_2}
     log    ${return}
     ${lower-layer-if-1}    Get from List    ${return}    0
     ${port-num-1}    Get From List    ${return}    1
@@ -226,14 +208,10 @@ Create VTEP - Vlan and Gateway
     ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_API}/ietf-interfaces:interfaces-state/
     ${respjson}    RequestsLibrary.To Json    ${resp.content}    pretty_print=True
     Log    ${respjson}
-    Should Contain    ${resp.content}    ${Dpn_id_1}    ${tunnel-5}
-    Should Contain    ${resp.content}    ${Dpn_id_2}    ${tunnel-6}
-    ${check-3}    Wait Until Keyword Succeeds    40    10    Genius.Check Table0 Entry For 2 Dpn    ${conn_id_1}    ${Bridge-1}
-    ...    ${port-num-1}
-    Log    ${check-3}
-    ${check-4}    Wait Until Keyword Succeeds    40    10    Genius.Check Table0 Entry For 2 Dpn    ${conn_id_2}    ${Bridge-2}
-    ...    ${port-num-2}
-    Log    ${check-4}
+    Should Contain    ${resp.content}    ${Dpn_id_1}    ${tunnel-1}
+    Should Contain    ${resp.content}    ${Dpn_id_2}    ${tunnel-2}
+    Wait Until Keyword Succeeds    40    10    Genius.Check Table0 Entry For 2 Dpn    ${conn_id_1}    ${Bridge-1}    ${port-num-1}
+    Wait Until Keyword Succeeds    40    10    Genius.Check Table0 Entry For 2 Dpn    ${conn_id_2}    ${Bridge-2}    ${port-num-2}
     ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_API}/opendaylight-inventory:nodes/
     ${respjson}    RequestsLibrary.To Json    ${resp.content}    pretty_print=True
     Log    ${respjson}
@@ -242,10 +220,15 @@ Create VTEP - Vlan and Gateway
 
 Delete VTEP -Vlan and gateway
     [Documentation]    This testcase deletes the ITM tunnel created between 2 dpns.
+    ${Dpn_id_1}    Genius.Get Dpn Ids    ${conn_id_1}
+    ${Dpn_id_2}    Genius.Get Dpn Ids    ${conn_id_2}
+    ${type}    Set Variable    odl-interface:tunnel-type-vxlan
+    ${tunnel-1}    Get_Tunnel    ${Dpn_id_1}    ${Dpn_id_2}    ${type}
+    ${tunnel-2}    Get_Tunnel    ${Dpn_id_2}    ${Dpn_id_1}    ${type}
     Remove All Elements At URI And Verify    ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/
-    Wait Until Keyword Succeeds    40    10    Genius.Check ITM Tunnel State    ${tunnel-5}    ${tunnel-6}
-    ${Ovs-del-1}    Wait Until Keyword Succeeds    40    10    Genius.Check Tunnel Delete On OVS    ${conn_id_1}    ${tunnel-5}
-    ${Ovs-del-2}    Wait Until Keyword Succeeds    40    10    Genius.Check Tunnel Delete On OVS    ${conn_id_2}    ${tunnel-6}
+    Wait Until Keyword Succeeds    40    10    Genius.Check ITM Tunnel State    ${tunnel-1}    ${tunnel-2}
+    Wait Until Keyword Succeeds    40    10    Genius.Check Tunnel Delete On OVS    ${conn_id_1}    ${tunnel-1}
+    Wait Until Keyword Succeeds    40    10    Genius.Check Tunnel Delete On OVS    ${conn_id_2}    ${tunnel-2}
 
 *** Keywords ***
 Create Vteps IPv6
@@ -353,7 +336,7 @@ Check Interface Status
 Verify Data Base after Delete
     [Arguments]    ${Dpn_id_1}    ${Dpn_id_2}    ${tunnel-1}    ${tunnel-2}
     [Documentation]    Verifies the config database after the Tunnel deletion is done.
-    ${type}    set variable    odl-interface:tunnel-type-vxlan
+    ${type}    Set Variable    odl-interface:tunnel-type-vxlan
     No Content From URI    session    ${CONFIG_API}/itm-state:tunnel-list/internal-tunnel/${Dpn_id_1}/${Dpn_id_2}/${type}/
     No Content From URI    session    ${CONFIG_API}/itm-state:tunnel-list/internal-tunnel/${Dpn_id_2}/${Dpn_id_1}/${type}/
     No Content From URI    session    ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${Dpn_id_1}/
@@ -364,11 +347,8 @@ Verify Data Base after Delete
     ${resp_8}    Wait Until Keyword Succeeds    40    10    Get Network Topology without Tunnel    ${CONFIG_TOPO_API}    ${tunnel-1}
     ...    ${tunnel-2}
     Log    ${resp_8}
-    ${Ovs-del-1}    Wait Until Keyword Succeeds    40    10    check-Tunnel-delete-on-ovs    ${conn_id_1}    ${tunnel-1}
-    Log    ${Ovs-del-1}
-    ${Ovs-del-2}    Wait Until Keyword Succeeds    40    10    check-Tunnel-delete-on-ovs    ${conn_id_2}    ${tunnel-2}
-    Log    ${Ovs-del-2}
-    Log    >>>>>>> Getting Network Topology Config without Tunnels<<<<<<<
+    Wait Until Keyword Succeeds    40    10    check-Tunnel-delete-on-ovs    ${conn_id_1}    ${tunnel-1}
+    Wait Until Keyword Succeeds    40    10    check-Tunnel-delete-on-ovs    ${conn_id_2}    ${tunnel-2}
     Wait Until Keyword Succeeds    40    10    Get Network Topology without Tunnel    ${OPERATIONAL_TOPO_API}    ${tunnel-1}    ${tunnel-2}
     Wait Until Keyword Succeeds    40    10    Validate interface state Delete    ${tunnel-1}
     Wait Until Keyword Succeeds    40    10    Validate interface state Delete    ${tunnel-2}
index 861124f092643b3fe6c480ac0d46826c463354f1..9a07e9be25d8ebf0d9902658081facb396e8c36c 100644 (file)
@@ -24,14 +24,11 @@ ${trunk_member_json}    l2vlan_member.json
 *** Test Cases ***
 Create l2vlan transparent interface
     [Documentation]    This testcase creates a l2vlan transparent interface between 2 dpns.
-    Log    >>>> Creating L2vlan interface <<<<<
     Create Interface    ${trunk_json}    transparent
-    Log    >>>> Get interface config <<<<<
     @{l2vlan}    create list    l2vlan-trunk    l2vlan    transparent    l2vlan    true
     Check For Elements At URI    ${CONFIG_API}/ietf-interfaces:interfaces/    ${l2vlan}
-    Log    >>>>> Get interface operational state<<<<
     Wait Until Keyword Succeeds    50    5    get operational interface    ${interface_name}
-    ${ovs-check}    Wait Until Keyword Succeeds    40    10    table0 entry    ${conn_id_1}    ${bridgename}
+    Wait Until Keyword Succeeds    40    10    table0 entry    ${conn_id_1}    ${bridgename}
 
 Delete l2vlan transparent interface
     [Documentation]    This testcase deletes the l2vlan transparent interface created between 2 dpns.
@@ -41,35 +38,27 @@ Delete l2vlan transparent interface
 
 Create l2vlan trunk interface
     [Documentation]    This testcase creates a l2vlan trunk interface between 2 DPNs.
-    Log    >>>> Getting file for posting json <<<<<<<
     Create Interface    ${trunk_json}    trunk
-    Log    >>>> Get interface config <<<<<
     @{l2vlan}    create list    l2vlan-trunk    l2vlan    trunk    tap8ed70586-6c    true
     Check For Elements At URI    ${CONFIG_API}/ietf-interfaces:interfaces/    ${l2vlan}
-    Log    >>>>> Get interface operational state<<<<
     Wait Until Keyword Succeeds    50    5    get operational interface    ${interface_name}
     Wait Until Keyword Succeeds    30    10    table0 entry    ${conn_id_1}    ${bridgename}
 
 Create l2vlan Trunk member interface
     [Documentation]    This testcase creates a l2vlan Trunk member interface for the l2vlan trunk interface created in 1st testcase.
-    Log    >>>> Creating L2vlan member interface <<<<<
-    Log    >>>> Getting file for posting json <<<<<<<
     ${body}    OperatingSystem.Get File    ${genius_config_dir}/l2vlan_member.json
     ${post_resp}    RequestsLibrary.Post Request    session    ${CONFIG_API}/ietf-interfaces:interfaces/    data=${body}
     Log    ${post_resp.content}
     Log    ${post_resp.status_code}
     Should Be Equal As Strings    ${post_resp.status_code}    204
-    Log    >>>> Get interface config <<<<<
     @{l2vlan}    create list    l2vlan-trunk1    l2vlan    trunk-member    1000    l2vlan-trunk
     ...    true
     Check For Elements At URI    ${CONFIG_API}/ietf-interfaces:interfaces/    ${l2vlan}
-    Log    >>>>> Get interface operational state<<<<
     Wait Until Keyword Succeeds    10    5    get operational interface    ${l2vlan[0]}
     Wait Until Keyword Succeeds    40    10    ovs check for member interface creation    ${conn_id_1}    ${bridgename}
 
 Bind service on Interface
     [Documentation]    This testcase binds service to the interface created .
-    Log    >>>> Getting file for posting json <<<<<<<
     ${body}    OperatingSystem.Get File    ${genius_config_dir}/bind_service.json
     ${body}    replace string    ${body}    service1    VPN
     ${body}    replace string    ${body}    service2    elan
@@ -79,35 +68,30 @@ Bind service on Interface
     log    ${post_resp.content}
     log    ${post_resp.status_code}
     Should Be Equal As Strings    ${post_resp.status_code}    204
-    Log    >>>>> Verifying Binded interface <<<<<
     @{bind_array}    create list    2    3    VPN    elan    50
     ...    21
     Check For Elements At URI    ${CONFIG_API}/interface-service-bindings:service-bindings/services-info/${interface_name}/${service_mode}/    ${bind_array}
-    Log    >>>>> OVS check for table enteries <<<<
-    ${command}    set variable    sudo ovs-ofctl -O OpenFlow13 dump-flows ${bridgename}
+    ${command}    Set Variable    sudo ovs-ofctl -O OpenFlow13 dump-flows ${bridgename}
     Wait Until Keyword Succeeds    40    10    table entry    ${command}
 
 unbind service on interface
     [Documentation]    This testcase Unbinds the service which is binded by the 3rd testcase.
-    Log    >>>>>>Unbinding the service on interface <<<<
-    ${service-priority-1}    set variable    3
-    ${service-priority-2}    set variable    4
+    ${service-priority-1}    Set Variable    3
+    ${service-priority-2}    Set Variable    4
     ${service_mode}    Set Variable    interface-service-bindings:service-mode-ingress
     Remove All Elements At URI And Verify    ${CONFIG_API}/interface-service-bindings:service-bindings/services-info/${interface_name}/${service_mode}/bound-services/${service-priority-1}/
-    log    >>>> Ovs check for table 21 absence <<<
-    ${table-id}    set variable    21
+    ${table-id}    Set Variable    21
     Wait Until Keyword Succeeds    10    2    no goto_table entry    ${table-id}
     Remove All Elements At URI And Verify    ${CONFIG_API}/interface-service-bindings:service-bindings/services-info/${interface_name}/${service_mode}/bound-services/${service-priority-2}/
     No Content From URI    session    ${CONFIG_API}/interface-service-bindings:service-bindings/services-info/${interface_name}/${service_mode}/bound-services/${service-priority-2}/
-    log    >>>> Ovs check for table 50 absence <<<
-    ${table-id}    set variable    50
+    ${table-id}    Set Variable    50
     Wait Until Keyword Succeeds    10    2    no goto_table entry    ${table-id}
 
 Delete l2vlan trunk interface
     [Documentation]    Deletion of l2vlan trunk interface is done.
     Remove All Elements At URI And Verify    ${CONFIG_API}/ietf-interfaces:interfaces/
     No Content From URI    session    ${OPERATIONAL_API}/ietf-interfaces:interfaces/
-    ${resp}    Wait Until Keyword Succeeds    30    10    no table0 entry
+    Wait Until Keyword Succeeds    30    10    no table0 entry
 
 *** Keywords ***
 get operational interface
@@ -134,7 +118,7 @@ table entry
 no table0 entry
     [Documentation]    After Deleting trunk interface, checking for absence of table 0 in the flow dumps
     switch connection    ${conn_id_1}
-    ${bridgename}    set variable    BR1
+    ${bridgename}    Set Variable    BR1
     ${ovs-check}    execute command    sudo ovs-ofctl -O OpenFlow13 dump-flows ${bridgename}
     log    ${ovs-check}
     should not contain    ${ovs-check}    table=0