012949177995668014d95f516296f72e8ddc2fec
[integration/test.git] / test / csit / suites / karaf-l2switch / 040__HostTracking_OF13 / 010__restconf_topo_nodes.txt
1 *** Settings ***
2 Documentation     Test suite for Address in RESTCONF topology
3 Suite Setup       Create Session    session    http://${CONTROLLER}:${PORT}    auth=${AUTH}    headers=${HEADERS_XML}
4 Suite Teardown    Delete All Sessions
5 Library           SSHLibrary
6 Library           Collections
7 Library           ../../../libraries/RequestsLibrary.py
8 Library           ../../../libraries/Common.py
9 Variables         ../../../variables/Variables.py
10
11 *** Variables ***
12 ${REST_TOPO}      /restconf/operational/network-topology:network-topology
13 ${MAC_1}          00:00:00:00:00:01
14 ${MAC_2}          00:00:00:00:00:02
15 ${MAC_3}          00:00:00:00:00:03
16 ${IP_1}           10.0.0.1
17 ${IP_2}           10.0.0.2
18 ${IP_3}           10.0.0.3
19
20 *** Test Cases ***
21 Get list of host from network topology
22     [Documentation]    Get the network topology, should not contain any host address
23     ${resp}    Get    session    ${REST_TOPO}
24     Should Be Equal As Strings    ${resp.status_code}    200
25     Should Contain    ${resp.content}    openflow:1
26     Should Contain    ${resp.content}    openflow:2
27     Should Contain    ${resp.content}    openflow:3
28     Should Contain X Times    ${resp.content}    link-id    4
29     Should Not Contain    ${resp.content}    ${MAC_1}
30     Should Not Contain    ${resp.content}    ${MAC_2}
31     Should Not Contain    ${resp.content}    ${MAC_3}
32
33 Ping All
34     [Documentation]    Pingall, verify no packet loss
35     [Tags]    Get
36     Write    pingall
37     ${result}    Read Until    mininet>
38     Should Contain    ${result}    0% dropped
39     Should Not Contain    ${result}    X
40     Sleep    3
41
42 Host Tracker
43     [Documentation]    Get the network topology,
44     ${resp}    Get    session    ${REST_TOPO}/topology/flow:1
45     Should Be Equal As Strings    ${resp.status_code}    200
46     Log    ${resp.content}
47     Should Contain X Times    ${resp.content}    "node-id":"host:${MAC_1}"    1
48     Should Contain X Times    ${resp.content}    "node-id":"host:${MAC_2}"    1
49     Should Contain X Times    ${resp.content}    "node-id":"host:${MAC_3}"    1
50
51 Check host are deleted
52     [Documentation]    Closing mininet this will remove the switch and the host should also be deleted
53     Log    closing mininet
54     write    exit
55     Read Until    >
56     sleep    5
57     ${resp}    Get    session    ${REST_TOPO}/topology/flow:1
58     Should Be Equal as Strings    ${resp.status_code}    200
59     Should not Contain    ${resp.content}    "node-id":"host
60     Log    ${resp.content}