Append 3 more punt path protection TCs
[integration/test.git] / csit / suites / genius / Service_Recovery.robot
1 *** Settings ***
2 Documentation     Test Suite for Service Recovery.
3 ...               Find detailed test plan here, http://docs.opendaylight.org/en/latest/submodules/genius/docs/testplans/service-recovery.html
4 Suite Setup       Genius.SRM Start Suite
5 Suite Teardown    Genius.SRM Stop Suite
6 Test Setup        Genius Test Setup
7 Test Teardown     Genius Test Teardown    ${data_models}
8 Library           re
9 Resource          ../../libraries/DataModels.robot
10 Resource          ../../libraries/Genius.robot
11 Resource          ../../libraries/OVSDB.robot
12 Resource          ../../libraries/Utils.robot
13 Resource          ../../libraries/VpnOperations.robot
14 Resource          ../../variables/Variables.robot
15 Variables         ../../variables/genius/Modules.py
16
17 *** Test Cases ***
18 ITM TZ Recovery
19     [Documentation]    This test case recovers the tunnels using transportzone name.
20     Delete Tunnel on OVS
21     KarafKeywords.Issue Command On Karaf Console    srm:recover INSTANCE ITM-TZ TZA
22     BuiltIn.Wait Until Keyword Succeeds    60s    5s    Genius.Verify Tunnel Status as UP    TZA
23
24 ITM TEP Recovery
25     [Documentation]    This test case recovers the tunnels using transportzone name and tunnel's ip address.
26     Delete Tunnel on OVS
27     KarafKeywords.Issue Command On Karaf Console    srm:recover INSTANCE ITM-TEP TZA:${TOOLS_SYSTEM_IP}
28     BuiltIn.Wait Until Keyword Succeeds    60s    5s    Genius.Verify Tunnel Status as UP    TZA
29
30 ITM Service Recovery
31     [Documentation]    This test case recovers ITM Service.
32     ${tunnel} =    Get Tunnel name
33     Utils.Remove All Elements At URI And Verify    ${CONFIG_API}/ietf-interfaces:interfaces/interface/${tunnel}
34     BuiltIn.Wait Until Keyword Succeeds    60s    5s    Genius.Verify Tunnel Delete on DS    ${tunnel}
35     KarafKeywords.Issue Command On Karaf Console    srm:recover SERVICE ITM
36     BuiltIn.Wait Until Keyword Succeeds    60s    5s    Genius.Verify Tunnel Status as UP    TZA
37
38 IFM Instance Recovery
39     [Documentation]    This test case recovers tunnel interface instance using interface name.
40     ${tunnel} =    Get Tunnel name
41     Delete Tunnel on OVS
42     KarafKeywords.Issue Command On Karaf Console    srm:recover INSTANCE IFM-IFACE ${tunnel}
43     BuiltIn.Wait Until Keyword Succeeds    60s    5s    Genius.Verify Tunnel Status as UP    TZA
44
45 IFM Service Recovery
46     [Documentation]    This test case recovers IFM Service.
47     ${tunnel} =    Get Tunnel name
48     SSHLibrary.Switch Connection    ${conn_id_1}
49     ${uuid}    ${bridge} =    OVSDB.Get Bridge Data
50     ${resp} =    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_CONFIG_API}uuid%2F${uuid}%2Fbridge%2F${bridge}
51     BuiltIn.Should Be Equal As Strings    ${resp.status_code}    ${RESP_CODE}
52     BuiltIn.Wait Until Keyword Succeeds    60s    5s    Genius.Verify Tunnel Delete on DS    ${tunnel}
53     KarafKeywords.Issue Command On Karaf Console    srm:recover SERVICE IFM
54     BuiltIn.Wait Until Keyword Succeeds    60s    5s    Genius.Verify Tunnel Status as UP    TZA
55
56 *** Keywords ***
57 Delete Tunnel on OVS
58     [Documentation]    Deletes a tunnel interface on switch and verify deletion on OVS.
59     ${dpn_Id_1} =    Genius.Get Dpn Ids    ${conn_id_1}
60     ${dpn_Id_2} =    Genius.Get Dpn Ids    ${conn_id_2}
61     ${tunnel} =    Wait Until Keyword Succeeds    40    20    Genius.Get Tunnel    ${dpn_Id_1}    ${dpn_Id_2}
62     ...    odl-interface:tunnel-type-vxlan
63     SSHLibrary.Switch Connection    ${conn_id_1}
64     SSHLibrary.Execute Command    sudo ovs-vsctl del-port ${tunnel}
65     BuiltIn.Wait Until Keyword Succeeds    60s    5s    Genius.Verify Tunnel Delete on DS    ${tunnel}
66
67 Get Tunnel name
68     [Documentation]    This keyword returns tunnel interface name.
69     ${dpn_id_1}=    Genius.Get Dpn Ids    ${conn_id_1}
70     ${dpn_id_2}=    Genius.Get Dpn Ids    ${conn_id_2}
71     ${tunnel}=    BuiltIn.Wait Until Keyword Succeeds    40    20    Genius.Get Tunnel    ${dpn_id_1}    ${dpn_id_2}
72     ...    odl-interface:tunnel-type-vxlan
73     [Return]    ${tunnel}