Step 1: Move vm scripts to the right place
[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://${CONTROLLER}:${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     Write    pingall
43     ${result}    Read Until    mininet>
44     Should Contain    ${result}    Results: 0% dropped
45
46 Check Host Links
47     [Documentation]    Get the topology and check links
48     Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    link-id    10
49
50 Host Tracker host1
51     [Documentation]    Get the network topology, should contain host1 one time
52     Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    "node-id":"host:${MAC_1}"    1
53
54 Host Tracker host2
55     [Documentation]    Get the network topology, should contain host 2 one time
56     Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    "node-id":"host:${MAC_2}"    1
57
58 Host Tracker host3
59     [Documentation]    Get the network topology, should contain hos 3 one time
60     Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    "node-id":"host:${MAC_3}"    1
61
62 Link Down
63     [Documentation]    Take link s1-h1 down and verify host1 goes away
64     Write    link s1 h1 down
65     Read Until    mininet>
66     @{list}    Create List    "link-down":true
67     Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1    ${list}
68     @{list}    Create List    ${MAC_1}
69     Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
70
71 Link Up
72     [Documentation]    Take link s1-h1 up and verify host1 comes back
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