Add IPv6 tunnel test to Genius CSIT 83/51183/27
authorYakir Dorani <yakir.dorani@hpe.com>
Mon, 30 Jan 2017 13:16:58 +0000 (15:16 +0200)
committerJamo Luhrsen <jluhrsen@redhat.com>
Tue, 7 Mar 2017 21:26:09 +0000 (21:26 +0000)
This test creates a vxlan tunnel between two endpoints with IPv6 addresses and checks
that the network topology configuration is updated accordingly.

I did a configuration check and not an full check with OVS because the OVS version doesn't
support IPv6 vxlan tunnels.

This tests change https://git.opendaylight.org/gerrit/#/c/49542/

Change-Id: I6d40d0e5b7a73ac934261e45a4239c156fb5c9b9
Signed-off-by: Yakir Dorani <yakir.dorani@hpe.com>
csit/suites/genius/03_Configure_ITM.robot [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index eb39a38..4b270d5
@@ -45,9 +45,8 @@ Create and Verify VTEP -No Vlan
     Wait Until Keyword Succeeds    40    10    Ovs Verification 2 Dpn    ${conn_id_2}    ${TOOLS_SYSTEM_2_IP}    ${TOOLS_SYSTEM_IP}
     ...    ${tunnel-2}    ${tunnel-type}
     Log    >>>> Getting Network Topology Operational <<<<<<
-    ${url-2}=    Set Variable    ${OPERATIONAL_API}/network-topology:network-topology/
     ${resp}    Wait Until Keyword Succeeds    40    10    Get Network Topology with Tunnel    ${Bridge-1}    ${Bridge-2}
-    ...    ${tunnel-1}    ${tunnel-2}    ${url-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}
@@ -78,6 +77,47 @@ Delete and Verify VTEP -No Vlan
     Wait Until Keyword Succeeds    40    10    Verify Data Base after Delete    ${Dpn_id_1}    ${Dpn_id_2}    ${tunnel-1}
     ...    ${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.
+    Pass Execution If    "${ODL_STREAM}" == "boron"    IPV6 support is not available in boron or before
+    ${Dpn_id_1}    Get Dpn Ids    ${conn_id_1}
+    ${Dpn_id_2}    Get Dpn Ids    ${conn_id_2}
+    Set Global Variable    ${Dpn_id_1}
+    Set Global Variable    ${Dpn_id_2}
+    ${vlan}=    Set Variable    0
+    ${gateway-ip}=    Set Variable    ::
+    ${TOOLS_SYSTEM_IP}    Set Variable    fd96:2a25:4ad3:3c7d:0:0:0:1000
+    ${TOOLS_SYSTEM_2_IP}    Set Variable    fd96:2a25:4ad3:3c7d:0:0:0:2000
+    Create Vteps IPv6    ${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-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
+    Get Data From URI    session    ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${Dpn_id_1}/    headers=${ACCEPT_XML}
+    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    Ovs Verification 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    Ovs Verification 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.
+    Pass Execution If    "${ODL_STREAM}" == "boron"    IPV6 support is not available in boron or before
+    Remove All Elements At URI And Verify    ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/
+    Wait Until Keyword Succeeds    40    10    Verify Data Base after Delete    ${Dpn_id_1}    ${Dpn_id_2}    ${tunnel-1}
+    ...    ${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.
     ${vlan}=    Set Variable    100
@@ -163,9 +203,8 @@ Create VTEP - Vlan and Gateway
     ${check-2}    Wait Until Keyword Succeeds    40    10    Ovs Verification 2 Dpn    ${conn_id_2}    ${TOOLS_SYSTEM_2_IP}
     ...    ${TOOLS_SYSTEM_IP}    ${tunnel-6}    ${tunnel-type}
     Log    ${check-2}
-    ${url-2}=    Set Variable    ${OPERATIONAL_API}/network-topology:network-topology/
     ${resp}    Wait Until Keyword Succeeds    40    10    Get Network Topology with Tunnel    ${Bridge-1}    ${Bridge-2}
-    ...    ${tunnel-5}    ${tunnel-6}    ${url-2}
+    ...    ${tunnel-5}    ${tunnel-6}    ${OPERATIONAL_TOPO_API}
     Log    ${resp}
     ${return}    Validate interface state    ${tunnel-5}    ${Dpn_id_1}    ${tunnel-6}    ${Dpn_id_2}
     log    ${return}
@@ -206,10 +245,20 @@ Create Vteps
     ${vlan}=    Set Variable    ${vlan}
     ${gateway-ip}=    Set Variable    ${gateway-ip}
     ${body}    set json    ${TOOLS_SYSTEM_IP}    ${TOOLS_SYSTEM_2_IP}    ${vlan}    ${gateway-ip}    ${subnet}
-    ${resp}    RequestsLibrary.Post Request    session    ${CONFIG_API}/itm:transport-zones/    data=${body}
-    Log    ${resp.content}
-    Log    ${resp.status_code}
-    should be equal as strings    ${resp.status_code}    204
+    Post Log Check    ${CONFIG_API}/itm:transport-zones/    ${body}    204
+
+Create Vteps IPv6
+    [Arguments]    ${TOOLS_SYSTEM_IP}    ${TOOLS_SYSTEM_2_IP}    ${vlan}    ${gateway-ip}
+    [Documentation]    This keyword creates VTEPs between ${TOOLS_SYSTEM_IP} and ${TOOLS_SYSTEM_2_IP}
+    ${body}    OperatingSystem.Get File    ${genius_config_dir}/Itm_creation_no_vlan.json
+    ${substr}    Should Match Regexp    ${TOOLS_SYSTEM_IP}    [0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:
+    ${subnet}    Catenate    ${substr}0
+    Log    ${subnet}
+    Set Global Variable    ${subnet}
+    ${vlan}=    Set Variable    ${vlan}
+    ${gateway-ip}=    Set Variable    ${gateway-ip}
+    ${body}    set json    ${TOOLS_SYSTEM_IP}    ${TOOLS_SYSTEM_2_IP}    ${vlan}    ${gateway-ip}    ${subnet}
+    Post Log Check    ${CONFIG_API}/itm:transport-zones/    ${body}    204
 
 Get Dpn Ids
     [Arguments]    ${connection_id}
@@ -362,7 +411,6 @@ Verify Data Base after Delete
     ${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<<<<<<<
-    ${url-2}=    Set variable    ${OPERATIONAL_API}/network-topology:network-topology/
-    Wait Until Keyword Succeeds    40    10    Get Network Topology without Tunnel    ${url-2}    ${tunnel-1}    ${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}