l2switch suite stabilization
[integration/test.git] / csit / suites / l2switch / Host_Tracking_OF13 / 010__restconf_topo_nodes.robot
1 *** Settings ***
2 Documentation     Test suite for Address in RESTCONF topology
3 Suite Setup       Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
4 Suite Teardown    Delete All Sessions
5 Library           RequestsLibrary
6 Resource          ../../../libraries/Utils.robot
7 Variables         ../../../variables/Variables.py
8
9 *** Variables ***
10 ${MAC_1}          00:00:00:00:00:01
11 ${MAC_2}          00:00:00:00:00:02
12 ${MAC_3}          00:00:00:00:00:03
13 ${IP_1}           10.0.0.1
14 ${IP_2}           10.0.0.2
15 ${IP_3}           10.0.0.3
16
17 *** Test Cases ***
18 Check Stats for node 1
19     [Documentation]    Get the stats for a node
20     Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:1
21
22 Check Stats for node 2
23     [Documentation]    Get the stats for a node
24     Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:2
25
26 Check Stats for node 3
27     [Documentation]    Get the stats for a node
28     Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:3
29
30 Check Switch Links
31     [Documentation]    Get the topology and check links
32     Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    link-id    4
33
34 Check No Host Is Present
35     [Documentation]    Get the network topology, should not contain any host address
36     @{list}    Create List    ${MAC_1}    ${MAC_2}    ${MAC_3}
37     Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
38     Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    link-id    4
39
40 Ping All
41     [Documentation]    Pingall, verify no packet loss
42     Wait Until Keyword Succeeds    10s    2s    Ping All Works Good
43
44 Check Host Links
45     [Documentation]    Get the topology and check links
46     Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    link-id    10
47
48 Host Tracker host1
49     [Documentation]    Get the network topology, should contain host1 one time
50     Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    "node-id":"host:${MAC_1}"    1
51
52 Host Tracker host2
53     [Documentation]    Get the network topology, should contain host 2 one time
54     Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    "node-id":"host:${MAC_2}"    1
55
56 Host Tracker host3
57     [Documentation]    Get the network topology, should contain hos 3 one time
58     Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    "node-id":"host:${MAC_3}"    1
59
60 Link Down
61     [Documentation]    Take link s1-h1 down and verify host1 goes away
62     [Tags]    exclude
63     Write    link s1 h1 down
64     Read Until    mininet>
65     @{list}    Create List    "link-down":true
66     Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1    ${list}
67     @{list}    Create List    ${MAC_1}
68     Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
69
70 Link Up
71     [Documentation]    Take link s1-h1 up and verify host1 comes back
72     [Tags]    exclude
73     Write    link s1 h1 up
74     Read Until    mininet>
75     @{list}    Create List    "link-down":false
76     Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1    ${list}
77     Write    pingall
78     Read Until    mininet>
79     Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    "node-id":"host:${MAC_1}"    1
80
81 Remove Port
82     [Documentation]    Remove port s1-eth1 and verify host1 goes away
83     Write    sh ovs-vsctl del-port s1 s1-eth1
84     Read Until    mininet>
85     @{list}    Create List    ${MAC_1}
86     Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
87
88 Add Port
89     [Documentation]    Add port s2-eth1 and verify host1 comes back
90     Write    sh ovs-vsctl add-port s1 s1-eth1 -- set interface s1-eth1 ofport=1
91     Read Until    mininet>
92     @{list}    Create List    "link-down":false
93     Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1    ${list}
94     Write    pingall
95     Read Until    mininet>
96     Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    "node-id":"host:${MAC_1}"    1
97
98 *** Keywords ***
99 Ping All Works Good
100     Write    pingall
101     ${result}    Read Until    mininet>
102     Should Contain    ${result}    Results: 0% dropped