TLS activation methods made independent
[integration/test.git] / csit / suites / l2switch / Loop_Removal_OF13 / 010__loop_of_3.robot
1 *** Settings ***
2 Documentation     Test suite for Ring/Loop topology of size 3
3 Suite Setup       Start Suite
4 Suite Teardown    Utils.Stop Mininet
5 Library           RequestsLibrary
6 Resource          ../../../libraries/Utils.robot
7 Variables         ../../../variables/Variables.py
8
9 *** Variables ***
10 ${FORWARD}        "stp-status-aware-node-connector:status":"forwarding"
11 ${DISCARD}        "stp-status-aware-node-connector:status":"discarding"
12
13 *** Test Cases ***
14 Check Stats for node 1
15     [Documentation]    Get the stats for a node
16     Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:1
17
18 Check Stats for node 2
19     [Documentation]    Get the stats for a node
20     Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:2
21
22 Check Stats for node 3
23     [Documentation]    Get the stats for a node
24     Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:3
25
26 Check Ports
27     [Documentation]    Check all ports are present
28     @{list}    Create List    openflow:1:1    openflow:1:2    openflow:1:3    openflow:2:1    openflow:2:2
29     ...    openflow:2:3    openflow:3:1    openflow:3:2    openflow:3:3
30     Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}    ${list}
31
32 Check Ports STP status
33     [Documentation]    Check the stp status of the ports (forwarding/discarding)
34     Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    ${FORWARD}    4
35     Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    ${DISCARD}    2
36
37 Check Flows
38     [Documentation]    Check all flows are present
39     Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    "output-node-connector"    16
40     [Teardown]    Report_Failure_Due_To_Bug    6984
41
42 Ping Test
43     [Documentation]    Ping h1 to h2, verify no packet loss or duplicates
44     Wait Until Keyword Succeeds    10s    2s    Ping Works Good
45
46 Link Down
47     [Documentation]    Take link s1-s2 down and verify ping works. This is not implemented.
48     [Tags]    exclude
49     Write    link s1 s2 down
50     Read Until    mininet>
51     @{list}    Create List    ${DISCARD}
52     Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_NODES_API}    ${list}
53     Wait Until Keyword Succeeds    10s    2s    Ping Works Good
54
55 Link Up
56     [Documentation]    Take link s1-s2 up and verify ping works. This is not implemented.
57     [Tags]    exclude
58     Write    link s1 s2 up
59     Read Until    mininet>
60     Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    ${FORWARD}    4
61     Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    ${DISCARD}    2
62     # This sleep is needed because if the ping in the below WUKS is launched before the STP effectively removes the link,
63     # it produces a packet storm in mininet that makes the test unresponsive.
64     Sleep    1
65     Wait Until Keyword Succeeds    10s    2s    Ping Works Good
66
67 Remove Port
68     [Documentation]    Remove port s1-eth2 and verify ping works. This is not stable, should be rewritten to pick a port that is not blocked.
69     [Tags]    exclude
70     Write    sh ovs-vsctl del-port s1 s1-eth2
71     Read Until    mininet>
72     Wait Until Keyword Succeeds    10s    2s    Ping Works Good
73
74 Add Port
75     [Documentation]    Add port s1-eth2 and verify ping works. This is not stable, should be rewritten to pick a port that is not blocked.
76     [Tags]    exclude
77     Write    sh ovs-vsctl add-port s1 s1-eth2 -- set interface s1-eth2 ofport=2
78     Read Until    mininet>
79     Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    ${FORWARD}    4
80     Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    ${DISCARD}    2
81     # This sleep is needed because if the ping in the below WUKS is launched before the STP effectively removes the link,
82     # it produces a packet storm in mininet that makes the test unresponsive.
83     Sleep    1
84     Wait Until Keyword Succeeds    10s    2s    Ping Works Good
85
86 *** Keywords ***
87 Start Suite
88     [Documentation]    Open controller session & mininet connection and start mininet custom topo
89     Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
90     ${start}=    Set Variable    sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --custom customtopo.py --topo ring --switch ovsk,protocols=OpenFlow13
91     ${mininet_conn_id}=    Open Connection    ${TOOLS_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=30s
92     Set Suite Variable    ${mininet_conn_id}
93     Login With Public Key    ${TOOLS_SYSTEM_USER}    ${USER_HOME}/.ssh/${SSH_KEY}    any
94     Put File    ${CURDIR}/../topologies/customtopo.py
95     Execute Command    sudo ovs-vsctl set-manager ptcp:6644
96     Execute Command    sudo mn -c
97     Write    ${start}
98     Read Until    mininet>
99
100 Ping Works Good
101     Write    h1 ping -w 1 h2
102     ${result}    Read Until    mininet>
103     Should Contain    ${result}    received, 0% packet loss
104     Should Not Contain    ${result}    duplicates