From 3da4a81bbd82aeefe15604dc3a72e3908287c0af Mon Sep 17 00:00:00 2001 From: Karthika Panneer Date: Mon, 25 Feb 2019 04:05:51 -0800 Subject: [PATCH] Qualify Keywords in Genius Suite Change-Id: Id2c77861462d29fc5e2ab944ca0b8d8823aad2e0 Signed-off-by: Karthika Panneer --- csit/libraries/Genius.robot | 84 +++++++------- csit/suites/genius/BFD_monitoring.robot | 86 +++++++------- csit/suites/genius/Configure_ITM.robot | 122 ++++++++++---------- csit/suites/genius/ID_manager.robot | 104 ++++++++--------- csit/suites/genius/ITM_Direct_Tunnels.robot | 46 ++++---- csit/suites/genius/Interface_manager.robot | 122 ++++++++++---------- 6 files changed, 282 insertions(+), 282 deletions(-) diff --git a/csit/libraries/Genius.robot b/csit/libraries/Genius.robot index 5e78f0cb43..1fa1aaebe5 100644 --- a/csit/libraries/Genius.robot +++ b/csit/libraries/Genius.robot @@ -31,24 +31,24 @@ ${NO_VLAN} 0 *** Keywords *** Genius Suite Setup [Documentation] Create Rest Session to http://${ODL_SYSTEM_IP}:${RESTCONFPORT} - Start Suite - Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} timeout=5 + Genius.Start Suite + RequestsLibrary.Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} timeout=5 Genius Suite Teardown [Documentation] Delete all sessions - Delete All Sessions - Stop Suite + RequestsLibrary.Delete All Sessions + Genius.Stop Suite Start Suite [Documentation] Initial setup for Genius test suites Run_Keyword_If_At_Least_Oxygen Wait Until Keyword Succeeds 60 2 ClusterManagement.Check Status Of Services Is OPERATIONAL @{GENIUS_DIAG_SERVICES} KarafKeywords.Setup_Karaf_Keywords ToolsSystem.Get Tools System Nodes Data - ${karaf_debug_enabled} BuiltIn.Get_Variable_Value ${KARAF_DEBUG} ${False} + ${karaf_debug_enabled} = BuiltIn.Get_Variable_Value ${KARAF_DEBUG} ${False} BuiltIn.run_keyword_if ${karaf_debug_enabled} KarafKeywords.Execute_Controller_Karaf_Command_On_Background log:set DEBUG org.opendaylight.genius Genius.Set Switch Configuration - ${check} = Wait Until Keyword Succeeds 30 10 Check Port Status Is ESTABLISHED ${ODL_OF_PORT_6653} @{TOOLS_SYSTEM_ALL_IPS} - ${check} = Wait Until Keyword Succeeds 30 10 Check Port Status Is ESTABLISHED ${OVSDBPORT} @{TOOLS_SYSTEM_ALL_IPS} + ${check} = BuiltIn.Wait Until Keyword Succeeds 30 10 Check Port Status Is ESTABLISHED ${ODL_OF_PORT_6653} @{TOOLS_SYSTEM_ALL_IPS} + ${check} = BuiltIn.Wait Until Keyword Succeeds 30 10 Check Port Status Is ESTABLISHED ${OVSDBPORT} @{TOOLS_SYSTEM_ALL_IPS} Genius.Build Dpn List @{SWITCH_DATA} = Collections.Combine Lists ${DPN_ID_LIST} ${TOOLS_SYSTEM_ALL_IPS} BuiltIn.Set Suite Variable @{SWITCH_DATA} @@ -59,11 +59,11 @@ Start Suite Stop Suite [Documentation] stops all connections and deletes all the bridges available on OVS : FOR ${tool_system_index} IN RANGE ${NUM_TOOLS_SYSTEM} - \ Switch Connection @{TOOLS_SYSTEM_ALL_CONN_IDS}[${tool_system_index}] - \ Execute Command sudo ovs-vsctl del-br ${Bridge} - \ Execute Command sudo ovs-vsctl del-manager - \ Write exit - \ Close Connection + \ SSHLibrary.Switch Connection @{TOOLS_SYSTEM_ALL_CONN_IDS}[${tool_system_index}] + \ SSHLibrary.Execute Command sudo ovs-vsctl del-br ${Bridge} + \ SSHLibrary.Execute Command sudo ovs-vsctl del-manager + \ SSHLibrary.Write exit + \ SSHLibrary.Close Connection Check Port Status Is ESTABLISHED [Arguments] ${port} @{tools_ips} @@ -76,7 +76,7 @@ Check Port Status Is ESTABLISHED 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} = 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} @@ -84,19 +84,19 @@ Create Vteps 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} Replace String ${body} 1.1.1.1 ${subnet} + ${body} = OperatingSystem.Get File ${genius_config_dir}/Itm_creation_no_vlan.json + ${body} = String.Replace String ${body} 1.1.1.1 ${subnet} : FOR ${tool_system_index} IN RANGE ${NUM_TOOLS_SYSTEM} - \ ${body} Replace String ${body} "dpn-id": 10${tool_system_index} "dpn-id": ${DPN_ID_LIST[${tool_system_index}]} - \ ${body} 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} Replace String ${body} "vlan-id": 0 "vlan-id": ${vlan} - ${body} Replace String ${body} "gateway-ip": "0.0.0.0" "gateway-ip": "${gateway_ip}" - Log ${body} + \ ${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 Build Dpn List [Documentation] This keyword builds the list of DPN ids after configuring OVS bridges on each of the TOOLS_SYSTEM_IPs. - @{DPN_ID_LIST} BuiltIn.Create List + @{DPN_ID_LIST} = BuiltIn.Create List : FOR ${tools_ip} IN @{TOOLS_SYSTEM_ALL_IPS} \ ${output} Utils.Run Command On Remote System And Log ${tools_ip} sudo ovs-ofctl show -O Openflow13 ${Bridge} | head -1 | awk -F "dpid:" '{ print $2 }' \ ${dpn_id} Utils.Run Command On Remote System And Log ${tools_ip} echo \$\(\(16\#${output}\)\) @@ -105,14 +105,14 @@ Build Dpn List BFD Suite Teardown [Documentation] Run at end of BFD suite - Delete All Vteps - Stop Suite + Genius.Delete All Vteps + Genius.Stop Suite Delete All Vteps [Documentation] This will delete vtep. ${resp} = RequestsLibrary.Delete Request session ${CONFIG_API}/itm:transport-zones/ BuiltIn.Should Be Equal As Strings ${resp.status_code} 200 - BuiltIn.Wait Until Keyword Succeeds 30 5 Verify Tunnel Delete on DS tun + BuiltIn.Wait Until Keyword Succeeds 30 5 Genius.Verify Tunnel Delete on DS tun Genius Test Setup [Documentation] Genius test case setup @@ -128,34 +128,34 @@ Genius Test Teardown Genius Suite Debugs [Arguments] ${data_models} - Genius Test Teardown ${data_models} test_name=${SUITE_NAME} fail=False + Genius.Genius Test Teardown ${data_models} test_name=${SUITE_NAME} fail=False ITM Direct Tunnels Start Suite [Documentation] start suite for itm scalability ClusterManagement.ClusterManagement_Setup ClusterManagement.Stop_Members_From_List_Or_All : FOR ${controller_index} IN RANGE ${NUM_ODL_SYSTEM} - \ Run Command On Remote System And Log ${ODL_SYSTEM_${controller_index+1}_IP} sed -i -- 's/false/true/g' ${GENIUS_IFM_CONFIG_FLAG} + \ Utils.Run Command On Remote System And Log ${ODL_SYSTEM_${controller_index+1}_IP} sed -i -- 's/false/true/g' ${GENIUS_IFM_CONFIG_FLAG} ClusterManagement.Start_Members_From_List_Or_All - Genius Suite Setup + Genius.Genius Suite Setup ITM Direct Tunnels Stop Suite [Documentation] Stop suite for ITM Direct Tunnels. : FOR ${controller_index} IN RANGE ${NUM_ODL_SYSTEM} - \ Run Command On Remote System And Log ${ODL_SYSTEM_${controller_index+1}_IP} sed -i -- 's/true/false/g' ${GENIUS_IFM_CONFIG_FLAG} - Genius Suite Teardown + \ Utils.Run Command On Remote System And Log ${ODL_SYSTEM_${controller_index+1}_IP} sed -i -- 's/true/false/g' ${GENIUS_IFM_CONFIG_FLAG} + Genius.Genius Suite Teardown Ovs Interface Verification [Documentation] Checks whether the created Interface is seen on OVS or not. : FOR ${tools_ip} IN @{TOOLS_SYSTEM_ALL_IPS} - \ Ovs Verification For Each Dpn ${tools_ip} ${TOOLS_SYSTEM_ALL_IPS} + \ Genius.Ovs Verification For Each Dpn ${tools_ip} ${TOOLS_SYSTEM_ALL_IPS} Get ITM [Arguments] ${itm_created[0]} ${subnet} ${vlan} [Documentation] It returns the created ITM Transport zone with the passed values during the creation is done. - @{Itm-no-vlan} Create List ${itm_created[0]} ${subnet} ${vlan} - @{Itm-no-vlan} Collections.Combine Lists ${Itm-no-vlan} ${SWITCH_DATA} - Check For Elements At URI ${TUNNEL_TRANSPORTZONE}/transport-zone/${itm_created[0]} ${Itm-no-vlan} + @{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} Check Tunnel Delete On OVS [Arguments] ${tunnel_list} @@ -175,11 +175,11 @@ Check Table0 Entry In a Dpn Verify Tunnel Status As Up [Arguments] ${no_of_switches}=${NUM_TOOLS_SYSTEM} [Documentation] Verify that the number of tunnels are UP - ${no_of_tunnels} = Issue Command On Karaf Console ${TEP_SHOW_STATE} + ${no_of_tunnels} = KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW_STATE} ${lines_of_state_up} = String.Get Lines Containing String ${no_of_tunnels} ${STATE_UP} ${actual_tunnel_count} = String.Get Line Count ${lines_of_state_up} ${expected_tunnel_count} = BuiltIn.Evaluate ${no_of_switches}*(${no_of_switches}-1) - Should Be Equal As Strings ${actual_tunnel_count} ${expected_tunnel_count} + BuiltIn.Should Be Equal As Strings ${actual_tunnel_count} ${expected_tunnel_count} Verify Tunnel Status [Arguments] ${tunnel_status} ${tunnel_names} @@ -239,18 +239,18 @@ SRM Start Suite Genius Suite Setup Genius.Create Vteps ${NO_VLAN} ${gateway_ip} BuiltIn.Wait Until Keyword Succeeds 60s 5s Genius.Verify Tunnel Status As Up - Genius Suite Debugs ${data_models} + Genius.Genius Suite Debugs ${data_models} SRM Stop Suite [Documentation] Stop suite for service recovery. - Delete All Vteps - Genius Suite Debugs ${data_models} - Genius Suite Teardown + Genius.Delete All Vteps + Genius.Genius Suite Debugs ${data_models} + Genius.Genius Suite Teardown Verify Tunnel Monitoring Status [Arguments] ${tunnel_monitor_status} - ${output}= Issue Command On Karaf Console ${TEP_SHOW} - Should Contain ${output} ${tunnel_monitor_status} + ${output}= KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW} + BuiltIn.Should Contain ${output} ${tunnel_monitor_status} Set Switch Configuration [Documentation] This keyword will set manager,controller,tap port,bridge on each OVS @@ -321,4 +321,4 @@ Update Dpn id List And Get Tunnels \ @{DPN_ID_UPDATED_LIST} = BuiltIn.Create List @{DPN_ID_LIST} \ Collections.Remove Values From List ${DPN_ID_UPDATED_LIST} ${DPN_ID_LIST[${tool_system_index}]} \ BuiltIn.Log Many ${DPN_ID_UPDATED_LIST} - \ ${dpn_id_index_1} = Get Tunnel Between DPNs ${tunnel_type} ${config_api_type} ${dpn_id_index_2} @{DPN_ID_UPDATED_LIST} + \ ${dpn_id_index_1} = Genius.Get Tunnel Between DPNs ${tunnel_type} ${config_api_type} ${dpn_id_index_2} @{DPN_ID_UPDATED_LIST} diff --git a/csit/suites/genius/BFD_monitoring.robot b/csit/suites/genius/BFD_monitoring.robot index c3ed33e287..2a65962bd0 100644 --- a/csit/suites/genius/BFD_monitoring.robot +++ b/csit/suites/genius/BFD_monitoring.robot @@ -40,15 +40,15 @@ ${TUNNEL_MONI_PROTO} tunnel-monitoring-type-bfd BFD_TC00 Create ITM between DPNs [Documentation] Create ITM between DPNs Genius.Create Vteps ${NO_VLAN} ${gateway_ip} - Wait Until Keyword Succeeds 30s 5s Genius.Verify Tunnel Status As Up + BuiltIn.Wait Until Keyword Succeeds 30s 5s Genius.Verify Tunnel Status As Up BFD_TC01 Verify default BFD monitoring status on Controller [Documentation] Verify the default value of BFD monitoring \ on the Controller - CompareStream.Run_Keyword_If_At_Least_Neon Wait Until Keyword Succeeds 10s 2s Verify Tunnel Monitoring Status ${TUNNEL_MONITOR_OFF} - CompareStream.Run_Keyword_If_Less_Than_Neon Wait Until Keyword Succeeds 10s 2s Verify Tunnel Monitoring Status ${TUNNEL_MONITOR_ON} - CompareStream.Run_Keyword_If_At_Least_Neon Wait Until Keyword Succeeds 10s 2s Verify Config Ietf Interface Output ${INTERFACE_DS_MONI_FALSE} ${INTERFACE_DS_MONI_INT_1000} + CompareStream.Run_Keyword_If_At_Least_Neon BuiltIn.Wait Until Keyword Succeeds 10s 2s Genius.Verify Tunnel Monitoring Status ${TUNNEL_MONITOR_OFF} + CompareStream.Run_Keyword_If_Less_Than_Neon BuiltIn.Wait Until Keyword Succeeds 10s 2s Genius.Verify Tunnel Monitoring Status ${TUNNEL_MONITOR_ON} + CompareStream.Run_Keyword_If_At_Least_Neon BuiltIn.Wait Until Keyword Succeeds 10s 2s Verify Config Ietf Interface Output ${INTERFACE_DS_MONI_FALSE} ${INTERFACE_DS_MONI_INT_1000} ... ${TUNNEL_MONI_PROTO} - CompareStream.Run_Keyword_If_Less_Than_Neon Wait Until Keyword Succeeds 10s 2s Verify Config Ietf Interface Output ${INTERFACE_DS_MONI_TRUE} ${INTERFACE_DS_MONI_INT_1000} + CompareStream.Run_Keyword_If_Less_Than_Neon BuiltIn.Wait Until Keyword Succeeds 10s 2s Verify Config Ietf Interface Output ${INTERFACE_DS_MONI_TRUE} ${INTERFACE_DS_MONI_INT_1000} ... ${TUNNEL_MONI_PROTO} BFD_TC02 Enable BFD Monitoring And Verify On Controller @@ -58,23 +58,23 @@ BFD_TC02 Enable BFD Monitoring And Verify On Controller BFD_TC03 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} - ${tunnel_monitoring} = Get Lines Containing String ${output} Tunnel Monitoring Interval - Should Be Equal ${tunnel_monitoring} ${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} + ${output} = KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW} + ${tunnel_monitoring} = String.Get Lines Containing String ${output} Tunnel Monitoring Interval + BuiltIn.Should Be Equal ${tunnel_monitoring} ${DEFAULT_MONITORING_INTERVAL} + BuiltIn.Wait Until Keyword Succeeds 10s 2s Verify Config Ietf Interface Output ${INTERFACE_DS_MONI_TRUE} ${INTERFACE_DS_MONI_INT_1000} ${TUNNEL_MONI_PROTO} BFD_TC04 Verify that in controller tunnel status is up when ITM tunnel interface is brought up. [Documentation] Verify that in controller tunnel status is up when ITM tunnel interface is brought up. - Wait Until Keyword Succeeds 10s 2s Verify Tunnel Monitoring Status ${TUNNEL_MONITOR_ON} - Wait Until Keyword Succeeds 10s 1s Genius.Verify Tunnel Status As Up - Wait Until Keyword Succeeds 10s 2s Verify Config Ietf Interface Output ${INTERFACE_DS_MONI_TRUE} ${INTERFACE_DS_MONI_INT_1000} ${TUNNEL_MONI_PROTO} + BuiltIn.Wait Until Keyword Succeeds 10s 2s Genius.Verify Tunnel Monitoring Status ${TUNNEL_MONITOR_ON} + BuiltIn.Wait Until Keyword Succeeds 10s 1s Genius.Verify Tunnel Status As Up + BuiltIn.Wait Until Keyword Succeeds 10s 2s Verify Config Ietf Interface Output ${INTERFACE_DS_MONI_TRUE} ${INTERFACE_DS_MONI_INT_1000} ${TUNNEL_MONI_PROTO} BFD_TC05 Verify BFD tunnel monitoring interval can be changed. [Documentation] Verify BFD tunnel monitoring interval can be changed. - ${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} - Wait Until Keyword Succeeds 30s 10s Check For Elements At URI ${CONFIG_API}/itm-config:tunnel-monitor-interval/ ${Bfd_updated_value} + ${oper_int} = RequestsLibrary.Put Request session ${CONFIG_API}/itm-config:tunnel-monitor-interval/ data=${INTERVAL_5000} + ${Bfd_updated_value}= BuiltIn.Create List 5000 + Wait Until Keyword Succeeds 30s 10s Utils.Check For Elements At URI ${OPERATIONAL_API}/itm-config:tunnel-monitor-interval/ ${Bfd_updated_value} + Wait Until Keyword Succeeds 30s 10s Utils.Check For Elements At URI ${CONFIG_API}/itm-config:tunnel-monitor-interval/ ${Bfd_updated_value} Wait Until Keyword Succeeds 10s 2s Verify Config Ietf Interface Output ${INTERFACE_DS_MONI_TRUE} ${INTERFACE_DS_MONI_INT_5000} ${TUNNEL_MONI_PROTO} : FOR ${tool_system_index} IN RANGE ${NUM_TOOLS_SYSTEM} \ ${tun_names} Genius.Get Tunnels On OVS ${TOOLS_SYSTEM_ALL_CONN_IDS[${tool_system_index}]} @@ -83,11 +83,11 @@ 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 ToolsSystem.Run Command On All Tools Systems sudo ovs-vsctl del-controller ${Bridge} - 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} + BuiltIn.Wait Until Keyword Succeeds 10s 1s VpnOperations.Verify Tunnel Status as UNKNOWN + BuiltIn.Wait Until Keyword Succeeds 10s 2s Verify Config Ietf Interface Output ${INTERFACE_DS_MONI_TRUE} ${INTERFACE_DS_MONI_INT_5000} ${TUNNEL_MONI_PROTO} ToolsSystem.Run Command On All Tools Systems sudo ovs-vsctl set-controller ${Bridge} tcp:${ODL_SYSTEM_IP}:${ODL_OF_PORT} - Wait Until Keyword Succeeds 10s 1s Genius.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} + BuiltIn.Wait Until Keyword Succeeds 10s 1s Genius.Verify Tunnel Status As Up + BuiltIn.Wait Until Keyword Succeeds 10s 2s Verify Config Ietf Interface Output ${INTERFACE_DS_MONI_TRUE} ${INTERFACE_DS_MONI_INT_5000} ${TUNNEL_MONI_PROTO} BFD_TC07 Set BFD monitoring To Default Value [Documentation] Disable BFD monitoring(setting it to default value) and verify that BFD is disabled on the controller. @@ -98,45 +98,45 @@ BFD_TC07 Set BFD monitoring To Default Value Verify Config Ietf Interface Output [Arguments] ${state} ${interval} ${proto} [Documentation] This keyword will get request from config ietf interface and verifies state, interval and proto are present - ${int_resp} RequestsLibrary.Get Request session ${CONFIG_API}/ietf-interfaces:interfaces/ - ${respjson} RequestsLibrary.To Json ${int_resp.content} pretty_print=True - Should Contain ${respjson} ${state} - Should Contain ${respjson} ${interval} - Should Contain ${respjson} ${proto} + ${int_resp} = RequestsLibrary.Get Request session ${CONFIG_API}/ietf-interfaces:interfaces/ + ${respjson} = RequestsLibrary.To Json ${int_resp.content} pretty_print=True + BuiltIn.Should Contain ${respjson} ${state} + BuiltIn.Should Contain ${respjson} ${interval} + BuiltIn.Should Contain ${respjson} ${proto} Ovs Tunnel Get [Arguments] ${tools_ip} [Documentation] This keyword will return the tunnel name on OVS - ${list_interface} Utils.Run Command On Remote System ${tools_ip} sudo ovs-vsctl list interface - ${tun_line} ${tun_name} Should Match Regexp ${list_interface} name\\s+: "(tun.*)" - log ${tun_name} - Should Not Be Empty ${tun_name} + ${list_interface} = Utils.Run Command On Remote System ${tools_ip} sudo ovs-vsctl list interface + ${tun_line} = ${tun_name} BuiltIn.Should Match Regexp ${list_interface} name\\s+: "(tun.*)" + BuiltIn.Log ${tun_name} + BuiltIn.Should Not Be Empty ${tun_name} [Return] ${tun_name} Verify Tunnel Monitoring Params [Arguments] ${flag} [Documentation] This keyword will verify the tunnel monitoring is true or false - @{checklist} create list ${flag} - Check For Elements At URI ${OPERATIONAL_API}/itm-config:tunnel-monitor-params/ ${checklist} + @{checklist} BuiltIn.Create List ${flag} + Utils.Check For Elements At URI ${OPERATIONAL_API}/itm-config:tunnel-monitor-params/ ${checklist} Enable BFD And Verify [Arguments] ${interface_ds_moni_int} [Documentation] Enable BFD Monitoring And Verify On Controller. - ${resp} RequestsLibrary.Put Request session ${CONFIG_API}/itm-config:tunnel-monitor-params/ data=${ENABLE_MONITORING} - Should Be Equal As Strings ${resp.status_code} 201 - Wait Until Keyword Succeeds 10s 2s Verify Tunnel Monitoring Params ${TUNNEL_MONI_PARAMS_TRUE} - Wait Until Keyword Succeeds 10s 2s Verify Tunnel Monitoring Status ${TUNNEL_MONITOR_ON} - Wait Until Keyword Succeeds 10s 2s Verify Config Ietf Interface Output ${INTERFACE_DS_MONI_TRUE} ${interface_ds_moni_int} ${TUNNEL_MONI_PROTO} - Wait Until Keyword Succeeds 10s 1s Genius.Verify Tunnel Status As Up + ${resp} = RequestsLibrary.Put Request session ${CONFIG_API}/itm-config:tunnel-monitor-params/ data=${ENABLE_MONITORING} + BuiltIn.Should Be Equal As Strings ${resp.status_code} 201 + BuiltIn.Wait Until Keyword Succeeds 10s 2s Verify Tunnel Monitoring Params ${TUNNEL_MONI_PARAMS_TRUE} + BuiltIn.Wait Until Keyword Succeeds 10s 2s Genius.Verify Tunnel Monitoring Status ${TUNNEL_MONITOR_ON} + BuiltIn.Wait Until Keyword Succeeds 10s 2s Verify Config Ietf Interface Output ${INTERFACE_DS_MONI_TRUE} ${interface_ds_moni_int} ${TUNNEL_MONI_PROTO} + BuiltIn.Wait Until Keyword Succeeds 10s 1s Genius.Verify Tunnel Status As Up Disable BFD And Verify [Documentation] Disable BFD Monitoring And Verify On Controller. - ${resp} RequestsLibrary.Put Request session ${CONFIG_API}/itm-config:tunnel-monitor-params/ data=${DISABLE_MONITORING} - Should Be Equal As Strings ${resp.status_code} 200 - Wait Until Keyword Succeeds 10s 2s Verify Tunnel Monitoring Params ${TUNNEL_MONI_PARAMS_FALSE} - Wait Until Keyword Succeeds 10s 2s Verify Tunnel Monitoring Status ${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} - Wait Until Keyword Succeeds 10s 1s Genius.Verify Tunnel Status As Up + ${resp} = RequestsLibrary.Put Request session ${CONFIG_API}/itm-config:tunnel-monitor-params/ data=${DISABLE_MONITORING} + BuiltIn.Should Be Equal As Strings ${resp.status_code} 200 + BuiltIn.Wait Until Keyword Succeeds 10s 2s Verify Tunnel Monitoring Params ${TUNNEL_MONI_PARAMS_FALSE} + BuiltIn.Wait Until Keyword Succeeds 10s 2s Genius.Verify Tunnel Monitoring Status ${TUNNEL_MONITOR_OFF} + BuiltIn.Wait Until Keyword Succeeds 10s 2s Verify Config Ietf Interface Output ${INTERFACE_DS_MONI_FALSE} ${INTERFACE_DS_MONI_INT_5000} ${TUNNEL_MONI_PROTO} + BuiltIn.Wait Until Keyword Succeeds 10s 1s Genius.Verify Tunnel Status As Up Verify ovs-vsctl Output For Each Tunnel [Arguments] ${tun_names} ${tool_system_index} diff --git a/csit/suites/genius/Configure_ITM.robot b/csit/suites/genius/Configure_ITM.robot index 4268636510..9f46189aa6 100644 --- a/csit/suites/genius/Configure_ITM.robot +++ b/csit/suites/genius/Configure_ITM.robot @@ -25,138 +25,138 @@ ${gateway_regex_IPV6} [0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:[0-9 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} - Wait Until Keyword Succeeds 40 10 Genius.Get ITM ${itm_created[0]} ${SUBNET} ${NO_VLAN} - ${type} = Set Variable odl-interface:tunnel-type-vxlan + BuiltIn.Wait Until Keyword Succeeds 40 10 Genius.Get ITM ${itm_created[0]} ${SUBNET} ${NO_VLAN} + ${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 - Wait Until Keyword Succeeds 40 10 Genius.Ovs Interface Verification - Wait Until Keyword Succeeds 60 5 Genius.Verify Tunnel Status As Up + 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 - Wait Until Keyword Succeeds 40 10 Genius.Verify Table0 Entry After fetching Port Number + 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 - Log ${respjson} - Should Be Equal As Strings ${resp.status_code} 200 + 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. ${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} - ${output} KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW} + \ 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} + ${output} = KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW} BuiltIn.Should Not Contain ${output} ${itm_created[0]} - 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]} - Wait Until Keyword Succeeds 40 10 Genius.Verify Deleted Tunnels On OVS ${tunnel_list} ${resp} - Wait Until Keyword Succeeds 40 10 Genius.Check Tunnel Delete On OVS ${tunnel_list} + 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. ${gateway_ip} = BuiltIn.Set Variable :: Build Tools System IPV6 List Create Vteps IPv6 ${NO_VLAN} ${gateway_ip} ${TOOLS_SYSTEM_IPV6_LIST} - Wait Until Keyword Succeeds 40 10 Get ITM IPV6 ${itm_created[0]} ${SUBNET_IPV6} ${NO_VLAN} - ${type} = Set Variable odl-interface:tunnel-type-vxlan + BuiltIn.Wait Until Keyword Succeeds 40 10 Get ITM IPV6 ${itm_created[0]} ${SUBNET_IPV6} ${NO_VLAN} + ${type} = BuiltIn.Set Variable odl-interface:tunnel-type-vxlan Genius.Update Dpn id list and get tunnels ${type} : FOR ${dpn} IN @{DPN_ID_LIST} - \ Wait Until Keyword Succeeds 40 5 Get Data From URI session ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${dpn}/ + \ 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} 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} - @{network_topology_list} BuiltIn.Create List @{all_tunnels} - @{network_topology_list} Collections.Append To List ${network_topology_list} ${Bridge} - ${resp} Wait Until Keyword Succeeds 40 10 Get Network Topology with Tunnel ${OPERATIONAL_TOPO_API} ${network_topology_list} + @{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. ${type} = BuiltIn.Set Variable odl-interface:tunnel-type-vxlan ${tunnel_list} = Genius.Get Tunnels List : FOR ${dpn} IN @{DPN_ID_LIST} - \ 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} - ${output} = Issue Command On Karaf Console ${TEP_SHOW} + \ 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} + ${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]}/ + 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]} - Wait Until Keyword Succeeds 40 10 Genius.Verify Deleted Tunnels On OVS ${tunnel_list} ${resp} - Wait Until Keyword Succeeds 40 10 Genius.Check Tunnel Delete On OVS ${tunnel_list} + 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. Genius.Create Vteps ${VLAN} ${gateway_ip} - Wait Until Keyword Succeeds 40 10 Genius.Get ITM ${itm_created[0]} ${SUBNET} ${VLAN} - ${type} = Set Variable odl-interface:tunnel-type-vxlan + BuiltIn.Wait Until Keyword Succeeds 40 10 Genius.Get ITM ${itm_created[0]} ${SUBNET} ${VLAN} + ${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 - Wait Until Keyword Succeeds 40 10 Genius.Ovs Interface Verification + BuiltIn.Wait Until Keyword Succeeds 40 10 Genius.Ovs Interface Verification Verify Network Topology Verify Ietf Interface State - Wait Until Keyword Succeeds 40 10 Genius.Verify Table0 Entry After fetching Port Number + 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. - ${type} = Set Variable odl-interface:tunnel-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} - ${output} KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW} + \ 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} + ${output} = KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW} BuiltIn.Should Not Contain ${output} ${itm_created[0]} - 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/ + 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]} - Wait Until Keyword Succeeds 40 10 Genius.Verify Deleted Tunnels On OVS ${tunnel_list} ${resp} - Wait Until Keyword Succeeds 40 10 Genius.Check Tunnel Delete On OVS ${tunnel_list} + 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. ${substr} = BuiltIn.Should Match Regexp ${TOOLS_SYSTEM_IP} ${gateway_regex_IPV4} ${gateway_ip} = BuiltIn.Catenate ${substr}1 Genius.Create Vteps ${VLAN} ${gateway_ip} - Wait Until Keyword Succeeds 40 10 Genius.Get ITM ${itm_created[0]} ${SUBNET} ${VLAN} - ${type} Set Variable odl-interface:tunnel-type-vxlan + BuiltIn.Wait Until Keyword Succeeds 40 10 Genius.Get ITM ${itm_created[0]} ${SUBNET} ${VLAN} + ${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 + ${tunnel-type} = BuiltIn.Set Variable type: vxlan Genius.Verify Response Code Of Dpn Endpointconfig API - Wait Until Keyword Succeeds 40 10 Genius.Ovs Interface Verification - Wait Until Keyword Succeeds 60 5 Genius.Verify Tunnel Status As Up + 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 - Wait Until Keyword Succeeds 40 10 Genius.Verify Table0 Entry After fetching Port Number + 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. - ${type} = Set Variable odl-interface:tunnel-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} - ${output} KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW} + ${output} = KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW} BuiltIn.Should Not Contain ${output} ${itm_created[0]} - 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/ + 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]} - Wait Until Keyword Succeeds 40 10 Genius.Verify Deleted Tunnels On OVS ${tunnel_list} ${resp} - Wait Until Keyword Succeeds 40 10 Genius.Check Tunnel Delete On OVS ${tunnel_list} + 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] ${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} = Should Match Regexp @{tools_ips}[0] ${gateway_regex_IPV6} - ${SUBNET_IPV6} = Catenate ${substr}0 - Set Suite Variable ${SUBNET_IPV6} + ${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} 204 Get Network Topology with Tunnel [Arguments] ${url} ${network_topology_list} [Documentation] Returns the Network topology with Tunnel info in it. - Check For Elements At URI ${url} ${network_topology_list} + Utils.Check For Elements At URI ${url} ${network_topology_list} Get ITM IPV6 [Arguments] ${itm_created[0]} ${subnet} ${vlan} @@ -164,7 +164,7 @@ Get ITM IPV6 @{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} - Check For Elements At URI ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]} ${Itm-no-vlan} + 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 @@ -173,16 +173,16 @@ OVS Verification Between IPV6 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} + ${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 - Check For Elements At URI ${OPERATIONAL_API}/ietf-interfaces:interfaces-state/ ${DPN_ID_LIST} session True - ${all_tunnels} Genius.Get Tunnels List - Check For Elements At URI ${OPERATIONAL_API}/ietf-interfaces:interfaces-state/ ${all_tunnels} session True + 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. diff --git a/csit/suites/genius/ID_manager.robot b/csit/suites/genius/ID_manager.robot index 16f1148877..d98cc346f0 100644 --- a/csit/suites/genius/ID_manager.robot +++ b/csit/suites/genius/ID_manager.robot @@ -26,76 +26,76 @@ ${OPERATIONS_API} /restconf/operations *** Test Cases *** Create ID pool in range 10:20 [Documentation] This testcase creates Id pool in range 10 to 20. - Post Elements To URI From File ${OPERATIONS_API}/id-manager:createIdPool ${genius_config_dir}/${create_json} - @{poolrange} create list ${pool-name} 10 20 - Check For Elements At URI ${CONFIG_API}/id-manager:id-pools/id-pool/${pool-name}/ ${poolrange} - @{availiable_pool} create List 10 20 10 - Check For Elements At URI ${CONFIG_API}/id-manager:id-pools/id-pool/${pool-name}/available-ids-holder/ ${availiable_pool} + Utils.Post Elements To URI From File ${OPERATIONS_API}/id-manager:createIdPool ${genius_config_dir}/${create_json} + @{poolrange} = BuiltIn.Create list ${pool-name} 10 20 + Utils.Check For Elements At URI ${CONFIG_API}/id-manager:id-pools/id-pool/${pool-name}/ ${poolrange} + @{availiable_pool} = BuiltIn.Create list 10 20 10 + Utils.Check For Elements At URI ${CONFIG_API}/id-manager:id-pools/id-pool/${pool-name}/available-ids-holder/ ${availiable_pool} Allocate Ids from pool created within size as 5 [Documentation] This testcase allocated IDs of specified size for the pool created in 1st testcase. - ${body} OperatingSystem.Get File ${genius_config_dir}/${allocaterange_json} - ${body} replace string ${body} test-key ${test_keys[0]} - log ${body} - Post Elements To URI ${OPERATIONS_API}/id-manager:allocateIdRange ${body} + ${body} = OperatingSystem.Get File ${genius_config_dir}/${allocaterange_json} + ${body} = String.Replace string ${body} test-key ${test_keys[0]} + BuiltIn.Log ${body} + Utils.Post Elements To URI ${OPERATIONS_API}/id-manager:allocateIdRange ${body} get Id pool Neg_Allocate ids of size 10 from the same pool [Documentation] This is a Negative testcase where when trying to allocate Id range out of the availiable IDs we have, the IDs are not allocated. - ${pool-name} Set Variable test-pool - ${body} OperatingSystem.Get File ${genius_config_dir}/${allocaterange_json} - ${body} Replace String ${body} 5 6 - ${body} Replace String ${body} test-key ${test_keys[1]} - log ${body} - ${resp} RequestsLibrary.Post Request session ${OPERATIONS_API}/id-manager:allocateIdRange data=${body} - Log ${resp.content} - should be equal as strings ${resp.status_code} 500 + ${pool-name} = BuiltIn.Set Variable test-pool + ${body} = OperatingSystem.Get File ${genius_config_dir}/${allocaterange_json} + ${body} = String.Replace String ${body} 5 6 + ${body} = String.Replace String ${body} test-key ${test_keys[1]} + BuiltIn.Log ${body} + ${resp} = RequestsLibrary.Post Request session ${OPERATIONS_API}/id-manager:allocateIdRange data=${body} + BuiltIn.Log ${resp.content} + BuiltIn.Should Be Equal As Strings ${resp.status_code} 500 Allocate IDs of size 3 from the pool [Documentation] This testcase allocates 3 Ids from the created pool in test case 1 - ${body} OperatingSystem.Get File ${genius_config_dir}/${allocaterange_json} - ${body} replace string ${body} test-key ${test_keys[2]} - ${body} replace string ${body} 5 3 - log ${body} - Post Elements To URI ${OPERATIONS_API}/id-manager:allocateIdRange ${body} - ${get_resp} RequestsLibrary.Get Request session ${CONFIG_API}/id-manager:id-pools/id-pool/${pool-name}/available-ids-holder/ - ${respjson} RequestsLibrary.To Json ${get_resp.content} pretty_print=True - Log ${respjson} - Should Contain ${get_resp.content} 17 - Should Be Equal As Strings ${get_resp.status_code} 200 + ${body}= OperatingSystem.Get File ${genius_config_dir}/${allocaterange_json} + ${body} = String.Replace string ${body} test-key ${test_keys[2]} + ${body} = String.Replace string ${body} 5 3 + BuiltIn.Log ${body} + Utils.Post Elements To URI ${OPERATIONS_API}/id-manager:allocateIdRange ${body} + ${get_resp} = RequestsLibrary.Get Request session ${CONFIG_API}/id-manager:id-pools/id-pool/${pool-name}/available-ids-holder/ + ${respjson} = RequestsLibrary.To Json ${get_resp.content} pretty_print=True + BuiltIn.Log ${respjson} + BuiltIn.Should Contain ${get_resp.content} 17 + BuiltIn.Should Be Equal As Strings ${get_resp.status_code} 200 Release a block of IDs allocated using releaseIds RPC [Documentation] This testcase Releases the block of Ids by using the key which is sent in json. - ${body} OperatingSystem.Get File ${genius_config_dir}/releaseIds.json - log ${body} - ${body} replace string ${body} test-key ${test_keys[2]} - Post Elements To URI ${OPERATIONS_API}/id-manager:releaseId ${body} - ${get_resp} RequestsLibrary.Get Request session ${CONFIG_API}/id-manager:id-pools/id-pool/${pool-name}/ - ${respjson} RequestsLibrary.To Json ${get_resp.content} pretty_print=True - Log ${respjson} - Should Be Equal As Strings ${get_resp.status_code} 200 - ${child-pool-name} Should Match Regexp ${get_resp.content} ${pool-name}\.[-]?[0-9]+ - log ${child-pool-name} - ${get_releasedIds} RequestsLibrary.Get Request session ${CONFIG_API}/id-manager:id-pools/id-pool/${child-pool-name}/released-ids-holder/ - ${respjson} RequestsLibrary.To Json ${get_releasedIds.content} pretty_print=True - log ${respjson} + ${body} = OperatingSystem.Get File ${genius_config_dir}/releaseIds.json + BuiltIn.Log ${body} + ${body} = String.Replace String ${body} test-key ${test_keys[2]} + Utils.Post Elements To URI ${OPERATIONS_API}/id-manager:releaseId ${body} + ${get_resp} = RequestsLibrary.Get Request session ${CONFIG_API}/id-manager:id-pools/id-pool/${pool-name}/ + ${respjson} = RequestsLibrary.To Json ${get_resp.content} pretty_print=True + BuiltIn.Log ${respjson} + BuiltIn.Should Be Equal As Strings ${get_resp.status_code} 200 + ${child-pool-name} = BuiltIn.Should Match Regexp ${get_resp.content} ${pool-name}\.[-]?[0-9]+ + BuiltIn.Log ${child-pool-name} + ${get_releasedIds} = RequestsLibrary.Get Request session ${CONFIG_API}/id-manager:id-pools/id-pool/${child-pool-name}/released-ids-holder/ + ${respjson} = RequestsLibrary.To Json ${get_releasedIds.content} pretty_print=True + BuiltIn.Log ${respjson} Should Be Equal As Strings ${get_releasedIds.status_code} 200 - @{released_ids} re.findall [0-9]+ ${get_releasedIds.content} - log ${released_ids} + @{released_ids} = re.Findall [0-9]+ ${get_releasedIds.content} + BuiltIn.Log ${released_ids} Delete the ID Pool using deleteIdPool RPC [Documentation] This testcase deletes the ID pool craeted in the 1st testcase. - ${body} OperatingSystem.Get File ${genius_config_dir}/deleteIdPool.json - ${body} replace string ${body} poolname ${pool-name} - log ${body} - Post Elements To URI ${OPERATIONS_API}/id-manager:deleteIdPool ${body} - No Content From URI session ${CONFIG_API}/id-manager:id-pools/id-pool/${pool-name}/ + ${body} = OperatingSystem.Get File ${genius_config_dir}/deleteIdPool.json + ${body} = String.Replace String ${body} poolname ${pool-name} + BuiltIn.Log ${body} + Utils.Post Elements To URI ${OPERATIONS_API}/id-manager:deleteIdPool ${body} + Utils.No Content From URI session ${CONFIG_API}/id-manager:id-pools/id-pool/${pool-name}/ *** Keywords *** get Id pool [Documentation] This keyword checks the created ID pool by doing GET. - ${get_resp} RequestsLibrary.Get Request session ${CONFIG_API}/id-manager:id-pools/id-pool/${pool-name}/available-ids-holder/ - ${respjson} RequestsLibrary.To Json ${get_resp.content} pretty_print=True - Log ${respjson} - Should Contain ${get_resp.content} 14 - Should Be Equal As Strings ${get_resp.status_code} 200 + ${get_resp} = RequestsLibrary.Get Request session ${CONFIG_API}/id-manager:id-pools/id-pool/${pool-name}/available-ids-holder/ + ${respjson} = RequestsLibrary.To Json ${get_resp.content} pretty_print=True + BuiltIn.Log ${respjson} + BuiltIn.Should Contain ${get_resp.content} 14 + BuiltIn.Should Be Equal As Strings ${get_resp.status_code} 200 diff --git a/csit/suites/genius/ITM_Direct_Tunnels.robot b/csit/suites/genius/ITM_Direct_Tunnels.robot index a97a5e9fea..7ecc3a1202 100644 --- a/csit/suites/genius/ITM_Direct_Tunnels.robot +++ b/csit/suites/genius/ITM_Direct_Tunnels.robot @@ -26,19 +26,19 @@ Variables ../../variables/genius/Modules.py Create and Verify VTEP [Documentation] This testcase creates a Internal Transport Manager - ITM tunnel between 2 DPNs Genius.Create Vteps ${NO_VLAN} ${gateway_ip} - 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]} ${SUBNET} ${NO_VLAN} ${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 - Wait Until Keyword Succeeds 40 10 Genius.Ovs Interface Verification + BuiltIn.Wait Until Keyword Succeeds 40 10 Genius.Ovs Interface Verification ${resp} = RequestsLibrary.Get Request session ${OPERATIONAL_API}/itm-state:tunnels_state/ - Should Be Equal As Strings ${resp.status_code} 200 - Wait Until Keyword Succeeds 60 5 Genius.Verify Tunnel Status As Up - Wait Until Keyword Succeeds 40 10 Genius.Verify Table0 Entry After fetching Port Number + BuiltIn.Should Be Equal As Strings ${resp.status_code} 200 + BuiltIn.Wait Until Keyword Succeeds 60 5 Genius.Verify Tunnel Status As Up + BuiltIn.Wait Until Keyword Succeeds 40 10 Genius.Verify Table0 Entry After fetching Port Number Verify VTEP After Restarting OVS [Documentation] Verify Testcase, Verifying tunnel state by restarting OVS - Wait Until Keyword Succeeds 20 2 Genius.Verify Tunnel Status As Up + BuiltIn.Wait Until Keyword Succeeds 20 2 Genius.Verify Tunnel Status As Up OVSDB.Restart OVSDB ${TOOLS_SYSTEM_IP} Verify VTEP After Restarting Controller @@ -46,8 +46,8 @@ Verify VTEP After Restarting Controller BuiltIn.Wait Until Keyword Succeeds 30 3 Genius.Verify Tunnel Status As Up ClusterManagement.Stop_Members_From_List_Or_All ClusterManagement.Start_Members_From_List_Or_All - Wait Until Keyword Succeeds 60 3 ClusterManagement.Check Status Of Services Is OPERATIONAL @{GENIUS_DIAG_SERVICES} - Wait Until Keyword Succeeds 30 3 Genius.Verify Tunnel Status As Up + BuiltIn.Wait Until Keyword Succeeds 60 3 ClusterManagement.Check Status Of Services Is OPERATIONAL @{GENIUS_DIAG_SERVICES} + BuiltIn.Wait Until Keyword Succeeds 30 3 Genius.Verify Tunnel Status As Up Verify Tunnels By Enabling/Disabling BFD [Documentation] Verify tunnel creation by enabling and disabling BFD one after another with respect to the branch in such a way default value is retained at last. @@ -58,52 +58,52 @@ Verify Tunnels By Enabling/Disabling BFD Delete and Verify VTEP [Documentation] This Delete testcase , deletes the ITM tunnel created between 2 dpns. - ${tunnel_list} Genius.Get Tunnels List + ${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} - ${output} KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW} + ${output} = KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW} BuiltIn.Should Not Contain ${output} ${itm_created[0]} - 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/ + 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]} - Wait Until Keyword Succeeds 40 10 Genius.Verify Deleted Tunnels On OVS ${tunnel_list} ${resp} - Wait Until Keyword Succeeds 40 10 Genius.Check Tunnel Delete On OVS ${tunnel_list} + BuiltIn.Wait Until Keyword Succeeds 40 10 Genius.Verify Deleted Tunnels On OVS ${tunnel_list} ${resp} + BuiltIn.Wait Until Keyword Succeeds 40 10 Genius.Check Tunnel Delete On OVS ${tunnel_list} *** Keywords *** Enable_Tunnel_Monitoring [Documentation] In this we will enable tunnel monitoring by tep:enable command running in karaf console - Issue_Command_On_Karaf_Console tep:enable-tunnel-monitor true + KarafKeywords.Issue_Command_On_Karaf_Console tep:enable-tunnel-monitor true Verify Tunnel State After OVS Restart [Arguments] ${TOOLS_SYSTEM_IP} [Documentation] In this we will Verify Tunnel State by Stopping/Starting Switch OVSDB.Stop OVS ${TOOLS_SYSTEM_IP} - Wait Until Keyword Succeeds 2min 20 sec Verify Tunnel Down + BuiltIn.Wait Until Keyword Succeeds 2min 20 sec Verify Tunnel Down OVSDB.Start OVS ${TOOLS_SYSTEM_IP} - Wait Until Keyword Succeeds 2min 20 sec Genius.Verify Tunnel Status As Up + BuiltIn.Wait Until Keyword Succeeds 2min 20 sec Genius.Verify Tunnel Status As Up Verify Tunnel Down [Documentation] In this we will check whether tunnel is in down or not ${output}= KarafKeywords.Issue_Command_On_Karaf_Console ${TEP_SHOW_STATE} - Should Contain ${output} DOWN + BuiltIn.Should Contain ${output} DOWN Disable_Tunnel_Monitoring [Documentation] In this we will disable tunnel monitoring by tep:enable command running in karaf console - Issue_Command_On_Karaf_Console tep:enable-tunnel-monitor false + KarafKeywords.Issue_Command_On_Karaf_Console tep:enable-tunnel-monitor false Verify Tunnels By Enabling BFD [Documentation] Verify tunnel creation by enabling BFD monitoring. - ${result} Run Keyword And Return Status Genius.Verify Tunnel Monitoring Status ${TUNNEL_MONITOR_ON} - Run Keyword If '${result}' == 'False' Enable_Tunnel_monitoring + ${result} = BuiltIn.Run Keyword And Return Status Genius.Verify Tunnel Monitoring Status ${TUNNEL_MONITOR_ON} + BuiltIn.Run Keyword If '${result}' == 'False' Enable_Tunnel_monitoring : FOR ${tools_ip} IN @{TOOLS_SYSTEM_ALL_IPS} \ Verify Tunnel State After OVS Restart ${tools_ip} Verify Tunnels By Disabling BFD [Documentation] Verify tunnel creation by disabling BFD monitoring. ${result} = Run Keyword And Return Status Genius.Verify Tunnel Monitoring Status ${TUNNEL_MONITOR_ON} - Run Keyword If '${result}' == 'True' Disable_Tunnel_Monitoring + BuiltIn.Run Keyword If '${result}' == 'True' Disable_Tunnel_Monitoring ${tunnels_on_OVS} = Genius.Get Tunnels On OVS ${TOOLS_SYSTEM_ALL_CONN_IDS[0]} OVSDB.Stop OVS ${TOOLS_SYSTEM_IP} Genius.Verify Tunnel Status UNKNOWN ${tunnels_on_OVS} OVSDB.Start OVS ${TOOLS_SYSTEM_IP} - Wait Until Keyword Succeeds 10s 1s Genius.Verify Tunnel Status As Up + BuiltIn.Wait Until Keyword Succeeds 10s 1s Genius.Verify Tunnel Status As Up diff --git a/csit/suites/genius/Interface_manager.robot b/csit/suites/genius/Interface_manager.robot index b1939eb704..46037a26cc 100644 --- a/csit/suites/genius/Interface_manager.robot +++ b/csit/suites/genius/Interface_manager.robot @@ -23,117 +23,117 @@ ${trunk_member_json} l2vlan_member.json Create l2vlan transparent interface [Documentation] This testcase creates a l2vlan transparent interface between 2 dpns. Create Interface ${trunk_json} transparent - @{l2vlan} create list l2vlan-trunk l2vlan transparent l2vlan true - Check For Elements At URI ${CONFIG_API}/ietf-interfaces:interfaces/ ${l2vlan} - Wait Until Keyword Succeeds 50 5 get operational interface ${interface_name} - Wait Until Keyword Succeeds 40 10 table0 entry ${TOOLS_SYSTEM_1_IP} + @{l2vlan} = BuiltIn.Create List l2vlan-trunk l2vlan transparent l2vlan true + Utils.Check For Elements At URI ${CONFIG_API}/ietf-interfaces:interfaces/ ${l2vlan} + BuiltIn.Wait Until Keyword Succeeds 50 5 get operational interface ${interface_name} + BuiltIn.Wait Until Keyword Succeeds 40 10 table0 entry ${TOOLS_SYSTEM_1_IP} Delete l2vlan transparent interface [Documentation] This testcase deletes the l2vlan transparent interface created between 2 dpns. - Remove All Elements At URI And Verify ${CONFIG_API}/ietf-interfaces:interfaces/ - No Content From URI session ${OPERATIONAL_API}/ietf-interfaces:interfaces/ - Wait Until Keyword Succeeds 30 10 no table0 entry + Utils.Remove All Elements At URI And Verify ${CONFIG_API}/ietf-interfaces:interfaces/ + Utils.No Content From URI session ${OPERATIONAL_API}/ietf-interfaces:interfaces/ + BuiltIn.Wait Until Keyword Succeeds 30 10 no table0 entry Create l2vlan trunk interface [Documentation] This testcase creates a l2vlan trunk interface between 2 DPNs. Create Interface ${trunk_json} trunk - @{l2vlan} create list l2vlan-trunk l2vlan trunk tap0ed70586-6c true - Check For Elements At URI ${CONFIG_API}/ietf-interfaces:interfaces/ ${l2vlan} - Wait Until Keyword Succeeds 50 5 get operational interface ${interface_name} - Wait Until Keyword Succeeds 30 10 table0 entry ${TOOLS_SYSTEM_1_IP} + @{l2vlan} = BuiltIn.Create list l2vlan-trunk l2vlan trunk tap0ed70586-6c true + Utils.Check For Elements At URI ${CONFIG_API}/ietf-interfaces:interfaces/ ${l2vlan} + BuiltIn.Wait Until Keyword Succeeds 50 5 get operational interface ${interface_name} + BuiltIn.Wait Until Keyword Succeeds 30 10 table0 entry ${TOOLS_SYSTEM_1_IP} Create l2vlan Trunk member interface [Documentation] This testcase creates a l2vlan Trunk member interface for the l2vlan trunk interface created in 1st testcase. - ${body} OperatingSystem.Get File ${genius_config_dir}/l2vlan_member.json - ${post_resp} RequestsLibrary.Post Request session ${CONFIG_API}/ietf-interfaces:interfaces/ data=${body} - Should Be Equal As Strings ${post_resp.status_code} 204 - @{l2vlan} create list l2vlan-trunk1 l2vlan trunk-member 1000 l2vlan-trunk + ${body} = OperatingSystem.Get File ${genius_config_dir}/l2vlan_member.json + ${post_resp} = RequestsLibrary.Post Request session ${CONFIG_API}/ietf-interfaces:interfaces/ data=${body} + BuiltIn.Should Be Equal As Strings ${post_resp.status_code} 204 + @{l2vlan} = create list l2vlan-trunk1 l2vlan trunk-member 1000 l2vlan-trunk ... true - Check For Elements At URI ${CONFIG_API}/ietf-interfaces:interfaces/ ${l2vlan} - Wait Until Keyword Succeeds 10 5 get operational interface ${l2vlan[0]} - Wait Until Keyword Succeeds 40 10 ovs check for member interface creation ${TOOLS_SYSTEM_1_IP} + Utils.Check For Elements At URI ${CONFIG_API}/ietf-interfaces:interfaces/ ${l2vlan} + BuiltIn.Wait Until Keyword Succeeds 10 5 get operational interface ${l2vlan[0]} + BuiltIn.Wait Until Keyword Succeeds 40 10 ovs check for member interface creation ${TOOLS_SYSTEM_1_IP} Bind service on Interface [Documentation] This testcase binds service to the interface created . - ${body} OperatingSystem.Get File ${genius_config_dir}/bind_service.json - ${body} Replace string ${body} service1 VPN - ${body} Replace string ${body} service2 elan - log ${body} - ${service_mode} Set Variable interface-service-bindings:service-mode-ingress - ${post_resp} RequestsLibrary.Post Request session ${CONFIG_API}/interface-service-bindings:service-bindings/services-info/${interface_name}/${service_mode}/ data=${body} - Should Be Equal As Strings ${post_resp.status_code} 204 - @{bind_array} create list 2 3 VPN elan 50 + ${body} = OperatingSystem.Get File ${genius_config_dir}/bind_service.json + ${body} = String.Replace string ${body} service1 VPN + ${body} = String.Replace string ${body} service2 elan + BuiltIn.Log ${body} + ${service_mode} = BuiltIn.Set Variable interface-service-bindings:service-mode-ingress + ${post_resp} = RequestsLibrary.Post Request session ${CONFIG_API}/interface-service-bindings:service-bindings/services-info/${interface_name}/${service_mode}/ data=${body} + BuiltIn.Should Be Equal As Strings ${post_resp.status_code} 204 + @{bind_array} = BuiltIn.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} - Wait Until Keyword Succeeds 40 10 table entry + Utils.Check For Elements At URI ${CONFIG_API}/interface-service-bindings:service-bindings/services-info/${interface_name}/${service_mode}/ ${bind_array} + BuiltIn.Wait Until Keyword Succeeds 40 10 table entry unbind service on interface [Documentation] This testcase Unbinds the service which is binded by the 3rd testcase. - ${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}/ - ${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}/ - ${table-id} Set Variable 50 - Wait Until Keyword Succeeds 10 2 no goto_table entry ${table-id} + ${service-priority-1} = BuiltIn.Set Variable 3 + ${service-priority-2} = BuiltIn.Set Variable 4 + ${service_mode} = BuiltIn.Set Variable interface-service-bindings:service-mode-ingress + Utils.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}/ + ${table-id} = BuiltIn.Set Variable 21 + BuiltIn.Wait Until Keyword Succeeds 10 2 no goto_table entry ${table-id} + Utils.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}/ + Utils.No Content From URI session ${CONFIG_API}/interface-service-bindings:service-bindings/services-info/${interface_name}/${service_mode}/bound-services/${service-priority-2}/ + ${table-id} = BuiltIn.Set Variable 50 + BuiltIn.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/ - Wait Until Keyword Succeeds 30 10 no table0 entry + Utils.Remove All Elements At URI And Verify ${CONFIG_API}/ietf-interfaces:interfaces/ + Utils.No Content From URI session ${OPERATIONAL_API}/ietf-interfaces:interfaces/ + BuiltIn.Wait Until Keyword Succeeds 30 10 no table0 entry *** Keywords *** get operational interface [Arguments] ${interface_name} [Documentation] checks operational status of the interface. - ${get_oper_resp} RequestsLibrary.Get Request session ${OPERATIONAL_API}/ietf-interfaces:interfaces-state/interface/${interface_name}/ - ${respjson} RequestsLibrary.To Json ${get_oper_resp.content} pretty_print=True - log ${respjson} - Should Be Equal As Strings ${get_oper_resp.status_code} 200 - Should not contain ${get_oper_resp.content} down - Should Contain ${get_oper_resp.content} up up + ${get_oper_resp} = RequestsLibrary.Get Request session ${OPERATIONAL_API}/ietf-interfaces:interfaces-state/interface/${interface_name}/ + ${respjson} = RequestsLibrary.To Json ${get_oper_resp.content} pretty_print=True + BuiltIn.Log ${respjson} + BuiltIn.Should Be Equal As Strings ${get_oper_resp.status_code} 200 + BuiltIn.Should Not Contain ${get_oper_resp.content} down + BuiltIn.Should Contain ${get_oper_resp.content} up up table entry [Documentation] Checks for tables entry wrt the service the Interface is binded. ${result} = Utils.Run Command On Remote System ${TOOLS_SYSTEM_1_IP} sudo ovs-ofctl -O OpenFlow13 dump-flows ${Bridge} - should contain ${result} table=17 - should contain ${result} goto_table:21 - should contain ${result} goto_table:50 + BuiltIn.Should Contain ${result} table=17 + BuiltIn.Should Contain ${result} goto_table:21 + BuiltIn.Should Contain ${result} goto_table:50 no table0 entry [Documentation] After Deleting trunk interface, checking for absence of table 0 in the flow dumps ${ovs-check} = Utils.Run Command On Remote System ${TOOLS_SYSTEM_1_IP} sudo ovs-ofctl -O OpenFlow13 dump-flows ${Bridge} - should not contain ${ovs-check} table=0 - should not contain ${ovs-check} goto_table:17 + BuiltIn.Should Not Contain ${ovs-check} table=0 + BuiltIn.Should Not Contain ${ovs-check} goto_table:17 no goto_table entry [Arguments] ${table-id} [Documentation] Checks for absence of no goto_table after unbinding the service on the interface. ${ovs-check1} = Utils.Run Command On Remote System ${TOOLS_SYSTEM_1_IP} sudo ovs-ofctl -O OpenFlow13 dump-flows ${Bridge} - Should not contain ${ovs-check1} goto_table:${table-id} + BuiltIn.Should Not Contain ${ovs-check1} goto_table:${table-id} table0 entry [Arguments] ${tools_ip} [Documentation] After Creating the trunk interface , checking for table 0 entry exist in the flow dumps ${ovs-check} = Utils.Run Command On Remote System ${tools_ip} sudo ovs-ofctl -O OpenFlow13 dump-flows ${Bridge} - Should Contain ${ovs-check} table=0 + BuiltIn.Should Contain ${ovs-check} table=0 ovs check for member interface creation [Arguments] ${tools_ip} [Documentation] This keyword verifies the member interface created on OVS by checking the table0 ,vlan and action=pop_vlan entries ${ovs-check} = Utils.Run Command On Remote System ${tools_ip} sudo ovs-ofctl -O OpenFlow13 dump-flows ${Bridge} - should contain ${ovs-check} table=0 - should contain ${ovs-check} dl_vlan=1000 - should contain ${ovs-check} actions=pop_vlan + BuiltIn.Should Contain ${ovs-check} table=0 + BuiltIn.Should Contain ${ovs-check} dl_vlan=1000 + BuiltIn.Should Contain ${ovs-check} actions=pop_vlan Create Interface [Arguments] ${json_file} ${interface_mode} [Documentation] Creates an trunk/transparent interface based on input provided to the json body - ${body} OperatingSystem.Get File ${genius_config_dir}/${json_file} - ${body} replace string ${body} "l2vlan-mode":"trunk" "l2vlan-mode":"${interface_mode}" - ${post_resp} RequestsLibrary.Post Request session ${CONFIG_API}/ietf-interfaces:interfaces/ data=${body} - Should Be Equal As Strings ${post_resp.status_code} 204 + ${body} = OperatingSystem.Get File ${genius_config_dir}/${json_file} + ${body} = String.Replace String ${body} "l2vlan-mode":"trunk" "l2vlan-mode":"${interface_mode}" + ${post_resp} = RequestsLibrary.Post Request session ${CONFIG_API}/ietf-interfaces:interfaces/ data=${body} + BuiltIn.Should Be Equal As Strings ${post_resp.status_code} 204 -- 2.36.6