Library OperatingSystem
Library RequestsLibrary
Library String
-Library re
-Variables ../../variables/genius/Modules.py
Resource ../../libraries/DataModels.robot
Resource ../../libraries/Genius.robot
Resource ../../libraries/KarafKeywords.robot
+Resource ../../libraries/ToolsSystem.robot
Resource ../../libraries/Utils.robot
Resource ../../variables/netvirt/Variables.robot
Resource ../../variables/Variables.robot
+Variables ../../variables/genius/Modules.py
*** Variables ***
-@{itm_created} TZA
-${genius_config_dir} ${CURDIR}/../../variables/genius
-@{VLAN} 0 100 101
+${gateway_regex_IPV4} [0-9]\{1,3}\.[0-9]\{1,3}\.[0-9]\{1,3}\.
+${gateway_regex_IPV6} [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}:
*** Test Cases ***
Create and Verify VTEP -No Vlan
[Documentation] This testcase creates a Internal Transport Manager - ITM tunnel between 2 DPNs without VLAN and Gateway configured in Json.
- ${Dpn_id_1} Genius.Get Dpn Ids ${conn_id_1}
- ${Dpn_id_2} Genius.Get Dpn Ids ${conn_id_2}
- ${gateway-ip}= Set Variable 0.0.0.0
- Genius.Create Vteps ${Dpn_id_1} ${Dpn_id_2} ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_2_IP} @{VLAN}[0] ${gateway-ip}
- Wait Until Keyword Succeeds 40 10 Get ITM ${itm_created[0]} ${subnet} @{VLAN}[0]
- ... ${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 20 Get Tunnel ${Dpn_id_1} ${Dpn_id_2}
- ... ${type}
- ${tunnel-2} Wait Until Keyword Succeeds 40 20 Get Tunnel ${Dpn_id_2} ${Dpn_id_1}
- ... ${type}
- ${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}/
- 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} ${tunnel-1}
- ... ${tunnel-2} ${OPERATIONAL_TOPO_API}
- ${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
- ${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}
- Wait Until Keyword Succeeds 40 10 Genius.Check Table0 Entry For 2 Dpn ${conn_id_1} ${Bridge} ${port-num-1}
- Wait Until Keyword Succeeds 40 10 Genius.Check Table0 Entry For 2 Dpn ${conn_id_2} ${Bridge} ${port-num-2}
- ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_API}/opendaylight-inventory:nodes/
- ${respjson} RequestsLibrary.To Json ${resp.content} pretty_print=True
- Log ${respjson}
- Should Be Equal As Strings ${resp.status_code} 200
- Should Contain ${resp.content} ${lower-layer-if-1} ${lower-layer-if-2}
+ Genius.Create Vteps ${NO_VLAN} ${gateway_ip}
+ BuiltIn.Wait Until Keyword Succeeds 40 10 Genius.Get ITM ${itm_created[0]}
+ ${type} = BuiltIn.Set Variable odl-interface:tunnel-type-vxlan
+ Genius.Update Dpn id list and get tunnels ${type}
+ Genius.Verify Response Code Of Dpn Endpointconfig API
+ BuiltIn.Wait Until Keyword Succeeds 40 10 Genius.Ovs Interface Verification
+ BuiltIn.Wait Until Keyword Succeeds 60 5 Genius.Verify Tunnel Status As Up
+ Verify Network Topology
+ Verify Ietf Interface State
+ BuiltIn.Wait Until Keyword Succeeds 40 10 Genius.Verify Table0 Entry After fetching Port Number
+ ${resp} = RequestsLibrary.Get Request session ${OPERATIONAL_NODES_API}
+ ${respjson} = RequestsLibrary.To Json ${resp.content} pretty_print=True
+ BuiltIn.Log ${respjson}
+ BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
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}
- ${cmd} Set Variable tep:delete ${Dpn_id_1} ${port_name} @{VLAN}[0] ${TOOLS_SYSTEM_IP} ${subnet}/24 null ${itm_created[0]}
- ${cmd2} Set Variable tep:delete ${Dpn_id_2} ${port_name} @{VLAN}[0] ${TOOLS_SYSTEM_2_IP} ${subnet}/24 null ${itm_created[0]}
- KarafKeywords.Issue Command On Karaf Console ${cmd}
- KarafKeywords.Issue Command On Karaf Console tep:commit
- KarafKeywords.Issue Command On Karaf Console ${cmd2}
- KarafKeywords.Issue Command On Karaf Console tep:commit
- ${output} KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW}
+ ${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}
+ END
+ ${output} = KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW}
BuiltIn.Should Not Contain ${output} ${itm_created[0]}
- BuiltIn.Run Keyword And Ignore Error 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}
- 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}
- ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_API}/itm:not-hosted-transport-zones/
- ${respjson} RequestsLibrary.To Json ${resp.content} pretty_print=True
- Log ${respjson}
- BuiltIn.Should Not Contain ${resp.content} ${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.Check Tunnel Delete On OVS ${tunnel_list}
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.
- ${Dpn_id_1} Genius.Get Dpn Ids ${conn_id_1}
- ${Dpn_id_2} Genius.Get Dpn Ids ${conn_id_2}
- ${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 ${Dpn_id_1} ${Dpn_id_2} ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_2_IP} @{VLAN}[0] ${gateway-ip}
- Wait Until Keyword Succeeds 40 10 Get ITM ${itm_created[0]} ${subnet} @{VLAN}[0]
- ... ${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}
- ${tunnel-2} Wait Until Keyword Succeeds 40 10 Get Tunnel ${Dpn_id_2} ${Dpn_id_1}
- ... ${type}
- ${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}
- 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} ${tunnel-1}
- ... ${tunnel-2} ${OPERATIONAL_TOPO_API}
+ ${gateway_ip} = BuiltIn.Set Variable ::
+ Build Tools System IPV6 List
+ Create Vteps IPv6 ${NO_VLAN} ${gateway_ip} ${TOOLS_SYSTEM_IPV6_LIST}
+ BuiltIn.Wait Until Keyword Succeeds 40 10 Get ITM IPV6 ${itm_created[0]}
+ ${type} = BuiltIn.Set Variable odl-interface:tunnel-type-vxlan
+ Genius.Update Dpn id list and get tunnels ${type}
+ FOR ${dpn} IN @{DPN_ID_LIST}
+ BuiltIn.Wait Until Keyword Succeeds 40 5 Utils.Get Data From URI session ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${dpn}/
+ ... headers=${ACCEPT_XML}
+ END
+ BuiltIn.Wait Until Keyword Succeeds 40 10 OVS Verification Between IPV6
+ @{all_tunnels} = BuiltIn.Create List
+ FOR ${conn_id} IN @{TOOLS_SYSTEM_ALL_CONN_IDS}
+ ${tun_names} = Genius.Get Tunnels On OVS ${conn_id}
+ Collections.Append To List ${all_tunnels} @{tun_names}
+ END
+ @{network_topology_list} = BuiltIn.Create List @{all_tunnels}
+ @{network_topology_list} = Collections.Append To List ${network_topology_list} ${Bridge}
+ ${resp} = BuiltIn.Wait Until Keyword Succeeds 40 10 Get Network Topology with Tunnel ${OPERATIONAL_TOPO_API} ${network_topology_list}
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
- ${ipv6_1} Set Variable fd96:2a25:4ad3:3c7d:0:0:0:1000
- ${ipv6_2} Set Variable fd96:2a25:4ad3:3c7d:0:0:0:2000
- ${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]}/subnets/${subnet}%2F24/vteps/${Dpn_id_1}/${port_name}
- Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/subnets/${subnet}%2F24/vteps/${Dpn_id_2}/${port_name}
- ${output} KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW}
+ ${type} = BuiltIn.Set Variable odl-interface:tunnel-type-vxlan
+ ${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_IPV6}%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]}
- BuiltIn.Run Keyword And Ignore Error 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}
- 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}
- ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_API}/itm:not-hosted-transport-zones/
- ${respjson} RequestsLibrary.To Json ${resp.content} pretty_print=True
- Log ${respjson}
- BuiltIn.Should Not Contain ${resp.content} ${itm_created[0]}
+ BuiltIn.Run Keyword And Ignore Error 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.Check Tunnel Delete On OVS ${tunnel_list}
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.
- ${Dpn_id_1} Genius.Get Dpn Ids ${conn_id_1}
- ${Dpn_id_2} Genius.Get Dpn Ids ${conn_id_2}
- ${gateway-ip}= Set Variable 0.0.0.0
- Genius.Create Vteps ${Dpn_id_1} ${Dpn_id_2} ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_2_IP} @{VLAN}[1] ${gateway-ip}
- ${get} Wait Until Keyword Succeeds 40 10 Get ITM ${itm_created[0]} ${subnet}
- ... @{VLAN}[1] ${Dpn_id_1} ${TOOLS_SYSTEM_IP} ${Dpn_id_2} ${TOOLS_SYSTEM_2_IP}
- Log ${get}
- ${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}
- ${tunnel-2} Wait Until Keyword Succeeds 40 10 Get Tunnel ${Dpn_id_2} ${Dpn_id_1}
- ... ${type}
- ${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}/
- 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}
- ${url_2} Set Variable ${OPERATIONAL_API}/network-topology:network-topology/
- Wait Until Keyword Succeeds 40 10 Get Network Topology with Tunnel ${Bridge} ${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
- ${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-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} ${port-num-1}
- Wait Until Keyword Succeeds 40 10 Genius.Check Table0 Entry For 2 Dpn ${conn_id_2} ${Bridge} ${port-num-2}
- ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_API}/opendaylight-inventory:nodes/
- ${respjson} RequestsLibrary.To Json ${resp.content} pretty_print=True
- Log ${respjson}
- Should Be Equal As Strings ${resp.status_code} 200
- Should Contain ${resp.content} ${lower-layer-if-2} ${lower-layer-if-1}
+ [Documentation] This testcase creates a Internal Transport Manager - ITM tunnel between 2 DPNs with VLAN and without Gateway configured in Json.
+ Genius.Create Vteps ${VLAN} ${gateway_ip}
+ BuiltIn.Wait Until Keyword Succeeds 40 10 Genius.Get ITM ${itm_created[0]}
+ ${type} = BuiltIn.Set Variable odl-interface:tunnel-type-vxlan
+ Genius.Update Dpn id list and get tunnels ${type}
+ Genius.Verify Response Code Of Dpn Endpointconfig API
+ BuiltIn.Wait Until Keyword Succeeds 40 10 Genius.Ovs Interface Verification
+ Verify Network Topology
+ Verify Ietf Interface State
+ BuiltIn.Wait Until Keyword Succeeds 40 10 Genius.Verify Table0 Entry After fetching Port Number
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}
- ${cmd1} Set Variable tep:delete ${Dpn_id_1} ${port_name} @{VLAN}[1] ${TOOLS_SYSTEM_IP} ${subnet}/24 null ${itm_created[0]}
- ${cmd2} Set Variable tep:delete ${Dpn_id_2} ${port_name} @{VLAN}[1] ${TOOLS_SYSTEM_2_IP} ${subnet}/24 null ${itm_created[0]}
- KarafKeywords.Issue Command On Karaf Console ${cmd1}
- KarafKeywords.Issue Command On Karaf Console tep:commit
- KarafKeywords.Issue Command On Karaf Console ${cmd2}
- KarafKeywords.Issue Command On Karaf Console tep:commit
- ${output} KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW}
+ ${type} = BuiltIn.Set Variable odl-interface:tunnel-type-vxlan
+ ${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}
+ END
+ ${output} = KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW}
BuiltIn.Should Not Contain ${output} ${itm_created[0]}
- BuiltIn.Run Keyword And Ignore Error 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-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}
- ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_API}/itm:not-hosted-transport-zones/
- ${respjson} RequestsLibrary.To Json ${resp.content} pretty_print=True
- Log ${respjson}
- BuiltIn.Should Not Contain ${resp.content} ${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.Check Tunnel Delete On OVS ${tunnel_list}
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.
- ${Dpn_id_1} Genius.Get Dpn Ids ${conn_id_1}
- ${Dpn_id_2} Genius.Get Dpn Ids ${conn_id_2}
- ${substr} Should Match Regexp ${TOOLS_SYSTEM_IP} [0-9]\{1,3}\.[0-9]\{1,3}\.[0-9]\{1,3}\.
- ${subnet} Catenate ${substr}0
- ${gateway-ip} Catenate ${substr}1
- Set Suite Variable ${GATEWAY_IP} ${gateway-ip}
- Log ${subnet}
- Genius.Create Vteps ${Dpn_id_1} ${Dpn_id_2} ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_2_IP} @{VLAN}[2] ${gateway-ip}
- Wait Until Keyword Succeeds 40 10 Get ITM ${itm_created[0]} ${subnet} @{VLAN}[2]
- ... ${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}
- ${tunnel-2} Wait Until Keyword Succeeds 40 10 Get Tunnel ${Dpn_id_2} ${Dpn_id_1}
- ... ${type}
- ${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}/
- 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} ${tunnel-1}
- ... ${tunnel-2} ${OPERATIONAL_TOPO_API}
- Log ${resp}
- ${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
- ${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-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} ${port-num-1}
- Wait Until Keyword Succeeds 40 10 Genius.Check Table0 Entry For 2 Dpn ${conn_id_2} ${Bridge} ${port-num-2}
- ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_API}/opendaylight-inventory:nodes/
- ${respjson} RequestsLibrary.To Json ${resp.content} pretty_print=True
- Log ${respjson}
- Should Be Equal As Strings ${resp.status_code} 200
- Should Contain ${resp.content} ${lower-layer-if-2} ${lower-layer-if-1}
+ ${substr} = BuiltIn.Should Match Regexp ${TOOLS_SYSTEM_IP} ${gateway_regex_IPV4}
+ ${gateway_ip} = BuiltIn.Catenate ${substr}1
+ Genius.Create Vteps ${VLAN} ${gateway_ip}
+ BuiltIn.Wait Until Keyword Succeeds 40 10 Genius.Get ITM ${itm_created[0]}
+ ${type} = BuiltIn.Set Variable odl-interface:tunnel-type-vxlan
+ Genius.Update Dpn id list and get tunnels ${type}
+ ${tunnel-type} = BuiltIn.Set Variable type: vxlan
+ Genius.Verify Response Code Of Dpn Endpointconfig API
+ BuiltIn.Wait Until Keyword Succeeds 40 10 Genius.Ovs Interface Verification
+ BuiltIn.Wait Until Keyword Succeeds 60 5 Genius.Verify Tunnel Status As Up
+ Verify Network Topology
+ Verify Ietf Interface State
+ BuiltIn.Wait Until Keyword Succeeds 40 10 Genius.Verify Table0 Entry After fetching Port Number
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}
- ${cmd1} Set Variable tep:delete ${Dpn_id_1} ${port_name} @{VLAN}[2] ${TOOLS_SYSTEM_IP} ${subnet}/24 ${GATEWAY_IP} ${itm_created[0]}
- ${cmd2} Set Variable tep:delete ${Dpn_id_2} ${port_name} @{VLAN}[2] ${TOOLS_SYSTEM_2_IP} ${subnet}/24 ${GATEWAY_IP} ${itm_created[0]}
- KarafKeywords.Issue Command On Karaf Console ${cmd1}
- KarafKeywords.Issue Command On Karaf Console tep:commit
- KarafKeywords.Issue Command On Karaf Console ${cmd2}
- KarafKeywords.Issue Command On Karaf Console tep:commit
- ${output} KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW}
+ ${type} = BuiltIn.Set Variable odl-interface:tunnel-type-vxlan
+ ${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}
+ END
+ ${output} = KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW}
BuiltIn.Should Not Contain ${output} ${itm_created[0]}
- BuiltIn.Run Keyword And Ignore Error 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-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}
- ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_API}/itm:not-hosted-transport-zones/
- ${respjson} RequestsLibrary.To Json ${resp.content} pretty_print=True
- Log ${respjson}
- BuiltIn.Should Not Contain ${resp.content} ${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.Check Tunnel Delete On OVS ${tunnel_list}
*** Keywords ***
Create Vteps IPv6
- [Arguments] ${Dpn_id_1} ${Dpn_id_2} ${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}
- ${gateway-ip}= Set Variable ${gateway-ip}
- ${body} Genius.Set Json ${Dpn_id_1} ${Dpn_id_2} ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_2_IP} ${vlan}
- ... ${gateway-ip} ${subnet}
- Post Log Check ${CONFIG_API}/itm:transport-zones/ ${body} 204
-
-Get Tunnel
- [Arguments] ${src} ${dst} ${type}
- [Documentation] This Keyword Gets the Tunnel /Interface name which has been created between 2 DPNS by passing source , destination DPN Ids along with the type of tunnel which is configured.
- ${resp} RequestsLibrary.Get Request session ${CONFIG_API}/itm-state:tunnel-list/internal-tunnel/${src}/${dst}/${type}/
- log ${resp.content}
- Log ${CONFIG_API}/itm-state:tunnel-list/internal-tunnel/${src}/${dst}/
- ${respjson} RequestsLibrary.To Json ${resp.content} pretty_print=True
- Log ${respjson}
- Should Be Equal As Strings ${resp.status_code} 200
- Should Contain ${resp.content} ${src} ${dst}
- ${json}= evaluate json.loads('''${resp.content}''') json
- log to console \nOriginal JSON:\n${json}
- ${return} Run Keyword And Return Status Should contain ${resp.content} tunnel-interface-names
- log ${return}
- ${ret} Run Keyword If '${return}'=='True' Check Interface Name ${json["internal-tunnel"][0]} tunnel-interface-names
- [Return] ${ret}
-
-Validate interface state
- [Arguments] ${tunnel-1} ${dpid-1} ${tunnel-2} ${dpid-2}
- [Documentation] Validates the created Interface Tunnel by checking its Operational status as UP/DOWN from the dump.
- Log ${tunnel-1},${dpid-1},${tunnel-2},${dpid-2}
- ${data1-2} Wait Until Keyword Succeeds 40 10 Check Interface Status ${tunnel-1} ${dpid-1}
- ${data2-1} Wait Until Keyword Succeeds 40 10 Check Interface Status ${tunnel-2} ${dpid-2}
- @{data} combine lists ${data1-2} ${data2-1}
- log ${data}
- [Return] ${data}
-
-Get ITM
- [Arguments] ${itm_created[0]} ${subnet} ${vlan} ${Dpn_id_1} ${TOOLS_SYSTEM_IP} ${Dpn_id_2}
- ... ${TOOLS_SYSTEM_2_IP}
- [Documentation] It returns the created ITM Transport zone with the passed values during the creation is done.
- Log ${itm_created[0]},${subnet}, ${vlan}, ${Dpn_id_1},${TOOLS_SYSTEM_IP}, ${Dpn_id_2}, ${TOOLS_SYSTEM_2_IP}
- @{Itm-no-vlan} Create List ${itm_created[0]} ${subnet} ${vlan} ${Dpn_id_1} ${port_name}
- ... ${TOOLS_SYSTEM_IP} ${Dpn_id_2} ${port_name} ${TOOLS_SYSTEM_2_IP}
- Check For Elements At URI ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]} ${Itm-no-vlan}
+ [Arguments] ${vlan} ${gateway_ip} ${tools_ips}
+ [Documentation] This keyword creates VTEPs between IPV6 ip's
+ ${substr} = BuiltIn.Should Match Regexp @{tools_ips}[0] ${gateway_regex_IPV6}
+ ${SUBNET_IPV6} = BuiltIn.Catenate ${substr}0
+ BuiltIn.Set Suite Variable ${SUBNET_IPV6}
+ ${body} = Genius.Set Json ${vlan} ${gateway_ip} ${SUBNET_IPV6} @{TOOLS_SYSTEM_IPV6_LIST}
+ Utils.Post Log Check ${CONFIG_API}/itm:transport-zones/ ${body} status_codes=${204}
Get Network Topology with Tunnel
- [Arguments] ${Bridge} ${tunnel-1} ${tunnel-2} ${url}
+ [Arguments] ${url} ${network_topology_list}
[Documentation] Returns the Network topology with Tunnel info in it.
- @{bridges} Create List ${Bridge} ${tunnel-1} ${tunnel-2}
- Check For Elements At URI ${url} ${bridges}
+ Utils.Check For Elements At URI ${url} ${network_topology_list}
-Get Network Topology without Tunnel
- [Arguments] ${url} ${tunnel-1} ${tunnel-2}
- [Documentation] Returns the Network Topology after Deleting of ITM transport zone is done , which wont be having any TUNNEL info in it.
- @{tunnels} create list ${tunnel-1} ${tunnel-2}
- Check For Elements Not At URI ${url} ${tunnels}
-
-Validate interface state Delete
- [Arguments] ${tunnel}
- [Documentation] Check for the Tunnel / Interface absence in OPERATIONAL data base of IETF interface after ITM transport zone is deleted.
- Log ${tunnel}
- ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_API}/ietf-interfaces:interfaces-state/interface/${tunnel}/
- ${respjson} RequestsLibrary.To Json ${resp.content} pretty_print=True
- Log ${respjson}
- Should Be Equal As Strings ${resp.status_code} 404
- Should not contain ${resp.content} ${tunnel}
-
-check-Tunnel-delete-on-ovs
- [Arguments] ${connection-id} ${tunnel}
- [Documentation] Verifies the Tunnel is deleted from OVS
- Log ${tunnel}
- Switch Connection ${connection-id}
- Log ${connection-id}
- ${return} Execute Command sudo ovs-vsctl show
- Log ${return}
- Should Not Contain ${return} ${tunnel}
- [Return] ${return}
-
-Check Interface Status
- [Arguments] ${tunnel} ${dpid}
- [Documentation] Verifies the operational state of the interface .
- ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_API}/ietf-interfaces:interfaces-state/interface/${tunnel}/
- Log ${OPERATIONAL_API}/ietf-interfaces:interfaces-state/interface/${tunnel}/
- ${respjson} RequestsLibrary.To Json ${resp.content} pretty_print=True
- Log ${respjson}
- Should Be Equal As Strings ${resp.status_code} 200
- Should not contain ${resp.content} down
- Should Contain ${resp.content} ${tunnel} up up
- ${result-1} re.sub <.*?> , ${resp.content}
- Log ${result-1}
- ${lower_layer_if} Should Match Regexp ${result-1} openflow:${dpid}:[0-9]+
- log ${lower_layer_if}
- @{resp_array} Split String ${lower_layer_if} :
- ${port-num} Get From List ${resp_array} 2
- Log ${port-num}
- [Return] ${lower_layer_if} ${port-num}
-
-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
- 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}/
- No Content From URI session ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${Dpn_id_2}/
- ${resp_7} RequestsLibrary.Get Request session ${CONFIG_API}/ietf-interfaces:interfaces/
- Run Keyword if '${resp_7.content}'=='404' Response is 404
- Run Keyword if '${resp_7.content}'=='200' Response is 200
- ${resp_8} Wait Until Keyword Succeeds 40 10 Get Network Topology without Tunnel ${CONFIG_TOPO_API} ${tunnel-1}
- ... ${tunnel-2}
- Log ${resp_8}
- 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}
-
-Check Interface Name
- [Arguments] ${json} ${expected_tunnel_interface_name}
- [Documentation] This keyword Checks the Tunnel interface name is tunnel-interface-names in the output or not .
- ${Tunnels} Collections.Get From Dictionary ${json} ${expected_tunnel_interface_name}
- Log ${Tunnels}
- [Return] ${Tunnels[0]}
+Get ITM IPV6
+ [Arguments] ${itm_created[0]}
+ [Documentation] It returns the created ITM Transport zone with the passed values during the creation is done.
+ @{Itm-no-vlan} = Collections.Combine Lists ${TOOLS_SYSTEM_IPV6_LIST} ${DPN_ID_LIST}
+ Collections.Append To List ${Itm-no-vlan} ${itm_created[0]}
+ Utils.Check For Elements At URI ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]} ${Itm-no-vlan}
+
+OVS Verification Between IPV6
+ [Documentation] This keyword will verify tunnels available on ovs
+ FOR ${tools_ip} IN @{TOOLS_SYSTEM_ALL_IPS}
+ Genius.Ovs Verification For Each Dpn ${tools_ip} ${TOOLS_SYSTEM_IPV6_LIST}
+ END
+
+Verify Network Topology
+ [Documentation] This keyword will verify whether all tunnels and bridges are populated in network topology
+ ${all_tunnels} = Genius.Get Tunnels List
+ @{network_topology_list} = BuiltIn.Create List
+ @{network_topology_list} = Collections.Append To List ${network_topology_list} ${Bridge}
+ @{network_topology_list} = Collections.Combine Lists ${network_topology_list} ${all_tunnels}
+ ${resp} = BuiltIn.Wait Until Keyword Succeeds 40 10 Get Network Topology with Tunnel ${OPERATIONAL_TOPO_API} ${network_topology_list}
+
+Verify Ietf Interface State
+ Utils.Check For Elements At URI ${OPERATIONAL_API}/ietf-interfaces:interfaces-state/ ${DPN_ID_LIST} session True
+ ${all_tunnels} = Genius.Get Tunnels List
+ Utils.Check For Elements At URI ${OPERATIONAL_API}/ietf-interfaces:interfaces-state/ ${all_tunnels} session True
+
+Build Tools System IPV6 List
+ [Documentation] Create a list of tools system ips with IPV6.
+ @{TOOLS_SYSTEM_IPV6_LIST} = BuiltIn.Create List
+ FOR ${tool_system_index} IN RANGE ${NUM_TOOLS_SYSTEM}
+ Collections.Append To List ${TOOLS_SYSTEM_IPV6_LIST} fd96:2a25:4ad3:3c7d:0:0:${tool_system_index}:1000
+ END
+ BuiltIn.Set Suite Variable @{TOOLS_SYSTEM_IPV6_LIST}