Replace Bierman02 with RFC8040 for OpenFlow Plugin
[integration/test.git] / csit / suites / openflowplugin / MD_SAL_NSF_OF13 / 010_restconf_inventory.robot
1 *** Settings ***
2 Documentation     Test suite for RESTCONF inventory
3 Suite Setup       Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
4 Suite Teardown    Delete All Sessions
5 Library           Collections
6 Library           RequestsLibrary
7 Library           ../../../libraries/Common.py
8 Variables         ../../../variables/Variables.py
9 Resource          ../../../libraries/Utils.robot
10 Resource          ../../../variables/openflowplugin/Variables.robot
11
12 *** Variables ***
13 ${VENDOR}         Nicira, Inc.
14 ${HARDWARE}       Open vSwitch
15 @{node_list}      openflow:1    openflow:2    openflow:3
16 ${SW_IPADDRESS}    "flow-node-inventory:ip-address":"${TOOLS_SYSTEM_IP}"
17 ${SW_VENDOR}      "flow-node-inventory:manufacturer":"${VENDOR}"
18 ${SW_HARDWARE}    "flow-node-inventory:hardware":"${HARDWARE}"
19 @{SW_CAPABILITIES}    "flow-node-inventory:flow-feature-capability-flow-stats"    "flow-node-inventory:flow-feature-capability-table-stats"    "flow-node-inventory:flow-feature-capability-port-stats"    "flow-node-inventory:flow-feature-capability-queue-stats"
20
21 *** Test Cases ***
22 Get list of nodes
23     [Documentation]    Get the inventory
24     Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_OPERATIONAL_NODES_API}    ${node_list}
25
26 Check No Link Down
27     [Documentation]    Check there is no link down. We have 8 ports in total: s1=2, s2=3, s3=3.
28     Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${RFC8040_OPERATIONAL_NODES_API}    "link-down":false    8
29
30 Get node 1 inventory
31     [Documentation]    Get the inventory for a node
32     ${list}    Create List    @{SW_CAPABILITIES}    ${SW_VENDOR}    ${SW_IPADDRESS}    ${SW_HARDWARE}    openflow:1:1
33     ...    openflow:1:2
34     Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A1?${RFC8040_OPERATIONAL_CONTENT}    ${list}
35
36 Get node 2 inventory
37     [Documentation]    Get the inventory for a node
38     ${list}    Create List    @{SW_CAPABILITIES}    ${SW_VENDOR}    ${SW_IPADDRESS}    ${SW_HARDWARE}    openflow:2:1
39     ...    openflow:2:2    openflow:2:3
40     Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A2?${RFC8040_OPERATIONAL_CONTENT}    ${list}
41
42 Get node 3 inventory
43     [Documentation]    Get the inventory for a node
44     ${list}    Create List    @{SW_CAPABILITIES}    ${SW_VENDOR}    ${SW_IPADDRESS}    ${SW_HARDWARE}    openflow:3:1
45     ...    openflow:3:2    openflow:3:3
46     Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A3?${RFC8040_OPERATIONAL_CONTENT}    ${list}
47
48 Link Down
49     [Documentation]    Take link s1-s2 down
50     Write    link s1 s2 down
51     Read Until    mininet>
52     @{list}    Create List    "link-down":true
53     Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?${RFC8040_OPERATIONAL_CONTENT}    ${list}
54     Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A2/node-connector=openflow%3A2%3A3?${RFC8040_OPERATIONAL_CONTENT}    ${list}
55
56 Link Up
57     [Documentation]    Take link s1-s2 up
58     Write    link s1 s2 up
59     Read Until    mininet>
60     @{list}    Create List    "link-down":false
61     Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?${RFC8040_OPERATIONAL_CONTENT}    ${list}
62     Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_NODES_API}/node=openflow%3A2/node-connector=openflow%3A2%3A3?${RFC8040_OPERATIONAL_CONTENT}    ${list}
63
64 Remove Port
65     [Documentation]    Remove port s2-eth1
66     [Tags]    exclude
67     Write    sh ovs-vsctl del-port s2 s2-eth1
68     Read Until    mininet>
69     @{list}    Create List    openflow:2:1
70     Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${RFC8040_OPERATIONAL_NODES_API}    ${list}
71
72 Add Port
73     [Documentation]    Add port s2-eth1, new id 4
74     [Tags]    exclude
75     Write    sh ovs-vsctl add-port s2 s2-eth1
76     Read Until    mininet>
77     @{list}    Create List    openflow:2:4
78     Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${RFC8040_OPERATIONAL_NODES_API}    ${list}