... return ${value_if_false} otherwise.
BuiltIn.Run_Keyword_And_Return Set_Variable_If_At_Least neon ${value_if_true} ${value_if_false}
+Set_Variable_If_At_Least_Sodium
+ [Arguments] ${value_if_true} ${value_if_false}
+ [Documentation] Compare neon to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at least sodium,
+ ... return ${value_if_false} otherwise.
+ BuiltIn.Run_Keyword_And_Return Set_Variable_If_At_Least soduim ${value_if_true} ${value_if_false}
+
Set_Variable_If_At_Most_Carbon
[Arguments] ${value_if_true} ${value_if_false}
[Documentation] Compare carbon to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at most carbon,
... return ${value_if_false} otherwise.
BuiltIn.Run_Keyword_And_Return Set_Variable_If_At_Most neon ${value_if_true} ${value_if_false}
+Set_Variable_If_At_Most_Sodium
+ [Arguments] ${value_if_true} ${value_if_false}
+ [Documentation] Compare neon to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at most sodium,
+ ... return ${value_if_false} otherwise.
+ BuiltIn.Run_Keyword_And_Return Set_Variable_If_At_Most sodium ${value_if_true} ${value_if_false}
+
CompareStream__Convert_Input
[Arguments] @{arguments}
[Documentation] Splits arguments into args and kwargs is used in Run_Keyword_If_At_Least_Else and Run_Keyword_If_At_Most_Else.
... run ${kw_name} @{varargs} &{kwargs} and return its value.
BuiltIn.Run_Keyword_And_Return Run_Keyword_If_At_Least neon ${kw_name} @{varargs} &{kwargs}
+Run_Keyword_If_At_Least_Sodium
+ [Arguments] ${kw_name} @{varargs} &{kwargs}
+ [Documentation] Compare sodium to ${ODL_STREAM} and in case ${ODL_STREAM} is at least sodium,
+ ... run ${kw_name} @{varargs} &{kwargs} and return its value.
+ BuiltIn.Run_Keyword_And_Return Run_Keyword_If_At_Least sodium ${kw_name} @{varargs} &{kwargs}
+
Run_Keyword_If_At_Most_Carbon
[Arguments] ${kw_name} @{varargs} &{kwargs}
[Documentation] Compare carbon to ${ODL_STREAM} and in case ${ODL_STREAM} is at most carbon,
... run ${kw_name} @{varargs} &{kwargs} and return its value.
BuiltIn.Run_Keyword_And_Return Run_Keyword_If_At_Most neon ${kw_name} @{varargs} &{kwargs}
+Run_Keyword_If_At_Most_Sodium
+ [Arguments] ${kw_name} @{varargs} &{kwargs}
+ [Documentation] Compare sodium to ${ODL_STREAM} and in case ${ODL_STREAM} is at most sodium,
+ ... run ${kw_name} @{varargs} &{kwargs} and return its value.
+ BuiltIn.Run_Keyword_And_Return Run_Keyword_If_At_Most sodium ${kw_name} @{varargs} &{kwargs}
+
Run_Keyword_If_More_Than_Carbon
[Arguments] ${kw_name} @{varargs} &{kwargs}
[Documentation] Compare carbon to ${ODL_STREAM} and in case ${ODL_STREAM} is more than carbon,
Run_Keyword_If_More_Than_Neon
[Arguments] ${kw_name} @{varargs} &{kwargs}
- [Documentation] Compare fluorine to ${ODL_STREAM} and in case ${ODL_STREAM} is more than neon,
+ [Documentation] Compare neon to ${ODL_STREAM} and in case ${ODL_STREAM} is more than neon,
... run ${kw_name} @{varargs} &{kwargs} and return its value.
BuiltIn.Run_Keyword_And_Return Run_Keyword_If_More_Than neon ${kw_name} @{varargs} &{kwargs}
+Run_Keyword_If_More_Than_Sodium
+ [Arguments] ${kw_name} @{varargs} &{kwargs}
+ [Documentation] Compare sodium to ${ODL_STREAM} and in case ${ODL_STREAM} is more than sodium,
+ ... run ${kw_name} @{varargs} &{kwargs} and return its value.
+ BuiltIn.Run_Keyword_And_Return Run_Keyword_If_More_Than sodium ${kw_name} @{varargs} &{kwargs}
+
Run_Keyword_If_Less_Than_Carbon
[Arguments] ${kw_name} @{varargs} &{kwargs}
[Documentation] Compare carbon to ${ODL_STREAM} and in case ${ODL_STREAM} is less than carbon,
Run_Keyword_If_Less_Than_Neon
[Arguments] ${kw_name} @{varargs} &{kwargs}
- [Documentation] Compare fluorine to ${ODL_STREAM} and in case ${ODL_STREAM} is less than neon,
+ [Documentation] Compare neon to ${ODL_STREAM} and in case ${ODL_STREAM} is less than neon,
... run ${kw_name} @{varargs} &{kwargs} and return its value.
BuiltIn.Run_Keyword_And_Return Run_Keyword_If_Less_Than neon ${kw_name} @{varargs} &{kwargs}
+
+Run_Keyword_If_Less_Than_Sodium
+ [Arguments] ${kw_name} @{varargs} &{kwargs}
+ [Documentation] Compare sodium to ${ODL_STREAM} and in case ${ODL_STREAM} is less than sodium,
+ ... run ${kw_name} @{varargs} &{kwargs} and return its value.
+ BuiltIn.Run_Keyword_And_Return Run_Keyword_If_Less_Than sodium ${kw_name} @{varargs} &{kwargs}
${DEFAULT_TRANSPORT_ZONE} default-transport-zone
${SET_LOCAL_IP} sudo ovs-vsctl set O . other_config:local_ip=
${REMOVE_LOCAL_IP} sudo ovs-vsctl remove O . other_config local_ip
+${odl_stream_check } &{Stream_dict}[${ODL_STREAM}] <= &{Stream_dict}[neon]
*** Keywords ***
Genius Suite Setup
Create Vteps
[Arguments] ${vlan_id} ${gateway_ip}
[Documentation] This keyword creates VTEPs between OVS
- ${body} = OperatingSystem.Get File ${genius_config_dir}/Itm_creation_no_vlan.json
${body} = Genius.Set Json ${vlan_id} ${gateway_ip} ${SUBNET} @{TOOLS_SYSTEM_ALL_IPS}
${resp} = RequestsLibrary.Put Request session ${CONFIG_API}/itm:transport-zones/transport-zone/TZA data=${body}
BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Set Json
[Arguments] ${vlan} ${gateway_ip} ${subnet} @{tools_ips}
[Documentation] Sets Json with the values passed for it.
- ${body} = OperatingSystem.Get File ${genius_config_dir}/Itm_creation_no_vlan.json
- ${body} = String.Replace String ${body} 1.1.1.1 ${subnet}
+ ${body} = BuiltIn.Run Keyword If ${odl_stream_check } OperatingSystem.Get File ${genius_config_dir}/Itm_creation_no_vlan_below_sodium.json
+ ... ELSE OperatingSystem.Get File ${genius_config_dir}/Itm_creation_no_vlan_sodium_and_above.json
+ ${body} = BuiltIn.Run Keyword If ${odl_stream_check } String.Replace String ${body} 1.1.1.1 ${subnet}
+ ... ELSE BuiltIn.Set Variable ${body}
+ ${body} = BuiltIn.Run Keyword If ${odl_stream_check } String.Replace String ${body} "vlan-id": 0 "vlan-id": ${vlan}
+ ... ELSE BuiltIn.Set Variable ${body}
+ ${body} = BuiltIn.Run Keyword If ${odl_stream_check } String.Replace String ${body} "gateway-ip": "0.0.0.0" "gateway-ip": "${gateway_ip}"
+ ... ELSE BuiltIn.Set Variable ${body}
: FOR ${tool_system_index} IN RANGE ${NUM_TOOLS_SYSTEM}
\ ${body} String.Replace String ${body} "dpn-id": 10${tool_system_index} "dpn-id": ${DPN_ID_LIST[${tool_system_index}]}
\ ${body} String.Replace String ${body} "ip-address": "${tool_system_index+2}.${tool_system_index+2}.${tool_system_index+2}.${tool_system_index+2}" "ip-address": "@{tools_ips}[${tool_system_index}]"
- ${body} = String.Replace String ${body} "vlan-id": 0 "vlan-id": ${vlan}
- ${body} = String.Replace String ${body} "gateway-ip": "0.0.0.0" "gateway-ip": "${gateway_ip}"
BuiltIn.Log ${body}
[Return] ${body} # returns complete json that has been updated
\ Genius.Ovs Verification For Each Dpn ${tools_ip} ${TOOLS_SYSTEM_ALL_IPS}
Get ITM
- [Arguments] ${itm_created[0]} ${subnet} ${vlan} ${switch_data}=${SWITCH_DATA}
+ [Arguments] ${itm_created[0]} ${switch_data}=${SWITCH_DATA}
[Documentation] It returns the created ITM Transport zone with the passed values during the creation is done.
- @{Itm-no-vlan} = BuiltIn.Create List ${itm_created[0]} ${subnet} ${vlan}
- @{Itm-no-vlan} = Collections.Combine Lists ${Itm-no-vlan} ${switch_data}
- Utils.Check For Elements At URI ${TUNNEL_TRANSPORTZONE}/transport-zone/${itm_created[0]} ${Itm-no-vlan}
+ Collections.Append To List ${switch_data} ${itm_created[0]}
+ Utils.Check For Elements At URI ${TUNNEL_TRANSPORTZONE}/transport-zone/${itm_created[0]} ${switch_data}
Check Tunnel Delete On OVS
[Arguments] ${tunnel_list}
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.
Genius.Create Vteps ${NO_VLAN} ${gateway_ip}
- BuiltIn.Wait Until Keyword Succeeds 40 10 Genius.Get ITM ${itm_created[0]} ${SUBNET} ${NO_VLAN}
+ 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
[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}
- \ 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_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}
${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]}/
${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]} ${SUBNET_IPV6} ${NO_VLAN}
+ 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}
[Documentation] This Delete testcase , deletes the ITM tunnel created between 2 dpns.
${type} = BuiltIn.Set Variable odl-interface:tunnel-type-vxlan
${tunnel_list} = Genius.Get Tunnels List
- : FOR ${dpn} IN @{DPN_ID_LIST}
- \ Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/subnets/${SUBNET_IPV6}%2F16/vteps/${dpn}/${port_name}
+ : 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}
${output} = KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW}
BuiltIn.Should Not Contain ${output} ${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]}/
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.
Genius.Create Vteps ${VLAN} ${gateway_ip}
- BuiltIn.Wait Until Keyword Succeeds 40 10 Genius.Get ITM ${itm_created[0]} ${SUBNET} ${VLAN}
+ 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
${type} = BuiltIn.Set Variable odl-interface:tunnel-type-vxlan
${tunnel_list} = Genius.Get Tunnels List
: FOR ${dpn_id} IN @{DPN_ID_LIST}
- \ 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_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}
${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]}/
${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]} ${SUBNET} ${VLAN}
+ 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
${type} = BuiltIn.Set Variable odl-interface:tunnel-type-vxlan
${tunnel_list} = Genius.Get Tunnels List
: FOR ${dpn_id} IN @{DPN_ID_LIST}
- \ 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_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}
${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]}/
Create Vteps IPv6
[Arguments] ${vlan} ${gateway_ip} ${tools_ips}
[Documentation] This keyword creates VTEPs between IPV6 ip's
- ${body} = OperatingSystem.Get File ${genius_config_dir}/Itm_creation_no_vlan.json
${substr} = BuiltIn.Should Match Regexp @{tools_ips}[0] ${gateway_regex_IPV6}
${SUBNET_IPV6} = BuiltIn.Catenate ${substr}0
BuiltIn.Set Suite Variable ${SUBNET_IPV6}
Utils.Check For Elements At URI ${url} ${network_topology_list}
Get ITM IPV6
- [Arguments] ${itm_created[0]} ${subnet} ${vlan}
+ [Arguments] ${itm_created[0]}
[Documentation] It returns the created ITM Transport zone with the passed values during the creation is done.
- @{Itm-no-vlan} = BuiltIn.Create List ${itm_created[0]} ${subnet} ${vlan} ${Bridge}
- @{Itm-no-vlan} = Collections.Combine Lists ${Itm-no-vlan} ${TOOLS_SYSTEM_IPV6_LIST} ${DPN_ID_LIST}
- BuiltIn.Log Many @{Itm-no-vlan}
+ @{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
Create and Verify VTEP
[Documentation] This testcase creates a Internal Transport Manager - ITM tunnel between 2 DPNs
Genius.Create Vteps ${NO_VLAN} ${gateway_ip}
- BuiltIn.Wait Until Keyword Succeeds 40 10 Genius.Get ITM ${itm_created[0]} ${SUBNET} ${NO_VLAN}
+ 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} dpn-teps-state
Genius.Verify Response Code Of Dpn Endpointconfig API
[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}
- \ 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_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}
${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]}/
[Arguments] ${dpn_id_list} ${tools_ip_list}
[Documentation] Verify if OFT VTEPs are created successfully or not for given Tools IPs and DPN-IDs.
${switch_data} = BuiltIn.Create List @{dpn_id_list} @{tools_ip_list}
- BuiltIn.Wait Until Keyword Succeeds 60 5 Genius.Get ITM ${DEFAULT_TRANSPORT_ZONE} 255.255.255.255/32 ${NO_VLAN}
- ... ${switch_data}
+ BuiltIn.Wait Until Keyword Succeeds 60 5 Genius.Get ITM ${DEFAULT_TRANSPORT_ZONE} ${switch_data}
${tep_show_output} = BuiltIn.Wait Until Keyword Succeeds 60 5 KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW}
BuiltIn.Should Contain Any ${tep_show_output} ${DEFAULT_TRANSPORT_ZONE} VXLAN @{switch_data}
BuiltIn.Wait Until Keyword Succeeds 60 5 Genius.Update Dpn id List And Get Tunnels odl-interface:tunnel-type-vxlan dpn-teps-state ${dpn_id_list}
--- /dev/null
+{
+ "transport-zone": [
+ {
+ "tunnel-type": "odl-interface:tunnel-type-vxlan",
+ "vteps": [
+ {
+ "dpn-id": 100,
+ "ip-address": "2.2.2.2",
+ "option-of-tunnel": false
+ },
+ {
+ "dpn-id": 101,
+ "ip-address": "3.3.3.3",
+ "option-of-tunnel": false
+ },
+ {
+ "dpn-id": 102,
+ "ip-address": "4.4.4.4",
+ "option-of-tunnel": false
+ }
+ ],
+ "zone-name": "TZA"
+ }
+ ]
+}