Migrate Get Requests invocations(libraries)
[integration/test.git] / csit / suites / l2switch / Address_Tracking_OF13 / 010__restconf_inv_addresses.robot
1 *** Settings ***
2 Documentation       Test suite for AddressObservations in RESTCONF inventory
3
4 Library             RequestsLibrary
5 Resource            ../../../libraries/Utils.robot
6 Resource            ../../../variables/openflowplugin/Variables.robot
7 Variables           ../../../variables/Variables.py
8
9 Suite Setup         Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
10 Suite Teardown      Delete All Sessions
11
12
13 *** Variables ***
14 ${IP_1}     "10.0.0.1"
15 ${IP_2}     "10.0.0.2"
16 ${IP_3}     "10.0.0.3"
17
18
19 *** Test Cases ***
20 Check Stats for node 1
21     [Documentation]    Get the stats for a node
22     Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow%3A1
23
24 Check Stats for node 2
25     [Documentation]    Get the stats for a node
26     Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow%3A2
27
28 Check Stats for node 3
29     [Documentation]    Get the stats for a node
30     Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow%3A3
31
32 Check No Host Is Present
33     [Documentation]    Get the invnetory, should not contain any host address
34     @{list}    Create List    ${IP_1}    ${IP_2}    ${IP_3}
35     Wait Until Keyword Succeeds
36     ...    10s
37     ...    2s
38     ...    Check For Elements Not At URI
39     ...    ${RFC8040_OPERATIONAL_NODES_API}
40     ...    ${list}
41
42 Ping All
43     [Documentation]    Pingall, verify no packet loss
44     Wait Until Keyword Succeeds    10s    2s    Ping All Works Good
45
46 Check node 1 addresses
47     [Documentation]    Get the address observations for node 1
48     @{list}    Create List    ${IP_2}    ${IP_3}
49     Wait Until Keyword Succeeds
50     ...    10s
51     ...    2s
52     ...    Check For Specific Number Of Elements At URI
53     ...    ${RFC8040_NODES_API}/node=openflow%3A1?content=nonconfig
54     ...    ${IP_1}
55     ...    1
56     Wait Until Keyword Succeeds
57     ...    10s
58     ...    2s
59     ...    Check For Elements Not At URI
60     ...    ${RFC8040_NODES_API}/node=openflow%3A1?content=nonconfig
61     ...    ${list}
62
63 Check node 2 addresses
64     [Documentation]    Get the address observations for node 2
65     @{list}    Create List    ${IP_1}    ${IP_3}
66     Wait Until Keyword Succeeds
67     ...    10s
68     ...    2s
69     ...    Check For Specific Number Of Elements At URI
70     ...    ${RFC8040_NODES_API}/node=openflow%3A2?content=nonconfig
71     ...    ${IP_2}
72     ...    1
73     Wait Until Keyword Succeeds
74     ...    10s
75     ...    2s
76     ...    Check For Elements Not At URI
77     ...    ${RFC8040_NODES_API}/node=openflow%3A2?content=nonconfig
78     ...    ${list}
79
80 Check node 3 addresses
81     [Documentation]    Get the address observations for node 3
82     @{list}    Create List    ${IP_1}    ${IP_2}
83     Wait Until Keyword Succeeds
84     ...    10s
85     ...    2s
86     ...    Check For Specific Number Of Elements At URI
87     ...    ${RFC8040_NODES_API}/node=openflow%3A3?content=nonconfig
88     ...    ${IP_3}
89     ...    1
90     Wait Until Keyword Succeeds
91     ...    10s
92     ...    2s
93     ...    Check For Elements Not At URI
94     ...    ${RFC8040_NODES_API}/node=openflow%3A3?content=nonconfig
95     ...    ${list}
96
97
98 *** Keywords ***
99 Ping All Works Good
100     Write    pingall
101     ${result}    Read Until    mininet>
102     Should Contain    ${result}    Results: 0% dropped