Resource OVSDB.robot
Resource ../variables/netvirt/Variables.robot
Resource VpnOperations.robot
+Resource DataModels.robot
*** Variables ***
@{itm_created} TZA
${Bridge-2} BR2
${DEFAULT_MONITORING_INTERVAL} Tunnel Monitoring Interval (for VXLAN tunnels): 1000
@{GENIUS_DIAG_SERVICES} OPENFLOW IFM ITM DATASTORE
+${vlan} 0
+${gateway-ip} 0.0.0.0
*** Keywords ***
Genius Suite Setup
Delete All Vteps
[Documentation] This will delete vtep.
${resp} RequestsLibrary.Delete Request session ${CONFIG_API}/itm:transport-zones/ data=${vtep_body}
- Log ${resp.status_code}
Should Be Equal As Strings ${resp.status_code} 200
Log "Before disconnecting CSS with controller"
- ${output}= Issue Command On Karaf Console ${TEP_SHOW}
- Log ${output}
- ${output}= Issue Command On Karaf Console ${TEP_SHOW_STATE}
- Log ${output}
+ ${output} = Issue Command On Karaf Console ${TEP_SHOW}
+ BuiltIn.Wait Until Keyword Succeeds 30 5 Verify All Tunnel Delete on DS
Genius Test Teardown
[Arguments] ${data_models}
Check Tunnel Delete On OVS
[Arguments] ${connection-id} ${tunnel}
- [Documentation] Verifies the Tunnel is deleted from OVS
+ [Documentation] Verifies the Tunnel is deleted from OVS.
Switch Connection ${connection-id}
- ${return} Execute Command sudo ovs-vsctl show
- Log ${return}
+ ${return} = Execute Command sudo ovs-vsctl show
+ log ${return}
Should Not Contain ${return} ${tunnel}
[Return] ${return}
\ Collections.Append To List ${tunnel_names} ${tun_list}
${items_in_list} = BuiltIn.Get Length ${tunnel_names}
[Return] ${Tunnel_Names}
+
+Get Tunnel
+ [Arguments] ${src} ${dst} ${type}
+ [Documentation] This keyword returns tunnel interface name between source DPN and destination DPN.
+ ${resp} = RequestsLibrary.Get Request session ${CONFIG_API}/itm-state:tunnel-list/internal-tunnel/${src}/${dst}/${type}/
+ BuiltIn.Should Be Equal As Strings ${resp.status_code} ${RESP_CODE}
+ BuiltIn.Should Contain ${resp.content} ${src}
+ BuiltIn.Should Contain ${resp.content} ${dst}
+ ${json} = Utils.Json Parse From String ${resp.content}
+ ${tunnel} = BuiltIn.Run Keyword If "tunnel-interface-names" in "${json}" Get Tunnel Interface Name ${json["internal-tunnel"][0]} tunnel-interface-names
+ [Return] ${tunnel}
+
+Get Tunnel Interface Name
+ [Arguments] ${json} ${expected_tunnel_interface_name}
+ [Documentation] This keyword extracts tunnel interface name from json given as input.
+ ${tunnels} = Collections.Get From Dictionary ${json} ${expected_tunnel_interface_name}
+ [Return] ${tunnels[0]}
+
+Verify All Tunnel Delete on DS
+ [Documentation] This keyword confirms that tunnels are not present by giving command from karaf console.
+ Verify Tunnel Delete on DS tun
+
+Verify Tunnel Delete on DS
+ [Arguments] ${tunnel}
+ [Documentation] This keyword confirms that specified tunnel is not present by giving command from karaf console.
+ ${output} = KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW_STATE}
+ BuiltIn.Should Not Contain ${output} ${tunnel}
+
+SRM Start Suite
+ [Documentation] Start suite for service recovery.
+ Genius Suite Setup
+ ${dpn_Id_1} = Genius.Get Dpn Ids ${conn_id_1}
+ ${dpn_Id_2} = Genius.Get Dpn Ids ${conn_id_2}
+ Genius.Create Vteps ${dpn_Id_1} ${dpn_Id_2} ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_2_IP} ${vlan} ${gateway-ip}
+ ${tunnel} = BuiltIn.Wait Until Keyword Succeeds 40 20 Genius.Get Tunnel ${dpn_Id_1} ${dpn_Id_2}
+ ... odl-interface:tunnel-type-vxlan
+ BuiltIn.Wait Until Keyword Succeeds 60s 5s Genius.Verify Tunnel Status as UP TZA
+
+SRM Stop Suite
+ [Documentation] Stop suite for service recovery.
+ Delete All Vteps
+ Genius Suite Teardown
[Documentation] Stop the OVS node.
${output} = Utils.Run Command On Mininet ${ovs_ip} sudo /usr/share/openvswitch/scripts/ovs-ctl stop
BuiltIn.Log ${output}
+
+Get Bridge Data
+ [Documentation] This keyword returns first bridge name and UUID from list of bridges.
+ ${result} = SSHLibrary.Execute Command sudo ovs-vsctl show
+ ${uuid} = String.Get Line ${result} 0
+ ${line} ${bridge_name} Builtin.Should Match Regexp ${result} Bridge "(\\w+)"
+ [Return] ${uuid} ${bridge_name}
--- /dev/null
+*** Settings ***
+Documentation Test Suite for Service Recovery.
+... Find detailed test plan here, http://docs.opendaylight.org/en/latest/submodules/genius/docs/testplans/service-recovery.html
+Suite Setup Genius.SRM Start Suite
+Suite Teardown Genius.SRM Stop Suite
+Test Teardown Genius Test Teardown ${data_models}
+Library re
+Resource ../../libraries/DataModels.robot
+Resource ../../libraries/Genius.robot
+Resource ../../libraries/OVSDB.robot
+Resource ../../libraries/Utils.robot
+Resource ../../libraries/VpnOperations.robot
+Resource ../../variables/Variables.robot
+Variables ../../variables/genius/Modules.py
+
+*** Test Cases ***
+ITM TZ Recovery
+ [Documentation] This test case recovers the tunnels using transportzone name.
+ Delete Tunnel on OVS
+ KarafKeywords.Issue Command On Karaf Console srm:recover INSTANCE ITM-TZ TZA
+ BuiltIn.Wait Until Keyword Succeeds 60s 5s Genius.Verify Tunnel Status as UP TZA
+
+ITM TEP Recovery
+ [Documentation] This test case recovers the tunnels using transportzone name and tunnel's ip address.
+ Delete Tunnel on OVS
+ KarafKeywords.Issue Command On Karaf Console srm:recover INSTANCE ITM-TEP TZA:${TOOLS_SYSTEM_IP}
+ BuiltIn.Wait Until Keyword Succeeds 60s 5s Genius.Verify Tunnel Status as UP TZA
+
+ITM Service Recovery
+ [Documentation] This test case recovers ITM Service.
+ ${tunnel} = Get Tunnel name
+ Utils.Remove All Elements At URI And Verify ${CONFIG_API}/ietf-interfaces:interfaces/interface/${tunnel}
+ BuiltIn.Wait Until Keyword Succeeds 60s 5s Genius.Verify Tunnel Delete on DS ${tunnel}
+ KarafKeywords.Issue Command On Karaf Console srm:recover SERVICE ITM
+ BuiltIn.Wait Until Keyword Succeeds 60s 5s Genius.Verify Tunnel Status as UP TZA
+
+IFM Instance Recovery
+ [Documentation] This test case recovers tunnel interface instance using interface name.
+ ${tunnel} = Get Tunnel name
+ Delete Tunnel on OVS
+ KarafKeywords.Issue Command On Karaf Console srm:recover INSTANCE IFM-IFACE ${tunnel}
+ BuiltIn.Wait Until Keyword Succeeds 60s 5s Genius.Verify Tunnel Status as UP TZA
+
+IFM Service Recovery
+ [Documentation] This test case recovers IFM Service.
+ ${tunnel} = Get Tunnel name
+ SSHLibrary.Switch Connection ${conn_id_1}
+ ${uuid} ${bridge} = OVSDB.Get Bridge Data
+ ${resp} = RequestsLibrary.Delete Request session ${SOUTHBOUND_CONFIG_API}uuid%2F${uuid}%2Fbridge%2F${bridge}
+ BuiltIn.Should Be Equal As Strings ${resp.status_code} ${RESP_CODE}
+ BuiltIn.Wait Until Keyword Succeeds 60s 5s Genius.Verify Tunnel Delete on DS ${tunnel}
+ KarafKeywords.Issue Command On Karaf Console srm:recover SERVICE IFM
+ BuiltIn.Wait Until Keyword Succeeds 60s 5s Genius.Verify Tunnel Status as UP TZA
+
+*** Keywords ***
+Delete Tunnel on OVS
+ [Documentation] Deletes a tunnel interface on switch and verify deletion on OVS.
+ ${dpn_Id_1} = Genius.Get Dpn Ids ${conn_id_1}
+ ${dpn_Id_2} = Genius.Get Dpn Ids ${conn_id_2}
+ ${tunnel} = Wait Until Keyword Succeeds 40 20 Genius.Get Tunnel ${dpn_Id_1} ${dpn_Id_2}
+ ... odl-interface:tunnel-type-vxlan
+ SSHLibrary.Switch Connection ${conn_id_1}
+ SSHLibrary.Execute Command sudo ovs-vsctl del-port ${tunnel}
+ BuiltIn.Wait Until Keyword Succeeds 60s 5s Genius.Verify Tunnel Delete on DS ${tunnel}
+
+Get Tunnel name
+ [Documentation] This keyword returns tunnel interface name.
+ ${dpn_id_1}= Genius.Get Dpn Ids ${conn_id_1}
+ ${dpn_id_2}= Genius.Get Dpn Ids ${conn_id_2}
+ ${tunnel}= BuiltIn.Wait Until Keyword Succeeds 40 20 Genius.Get Tunnel ${dpn_id_1} ${dpn_id_2}
+ ... odl-interface:tunnel-type-vxlan
+ [Return] ${tunnel}
integration/test/csit/suites/genius/ID_manager.robot
integration/test/csit/suites/genius/Configure_ITM.robot
integration/test/csit/suites/genius/BFD_monitoring.robot
-
-# Add new suites for oxygen or higher here:
+integration/test/csit/suites/genius/Service_Recovery.robot
integration/test/csit/suites/genius/ID_manager.robot
integration/test/csit/suites/genius/Configure_ITM.robot
integration/test/csit/suites/genius/BFD_monitoring.robot
-
-# Add new suites for oxygen or higher here:
+integration/test/csit/suites/genius/Service_Recovery.robot