Correctly space expected_status
[integration/test.git] / csit / suites / ovsdb / Southbound_Domain / 030__configure_exit_ovsdb_node.robot
1 *** Settings ***
2 Documentation       Test suite for Connection Manager
3
4 Library             RequestsLibrary
5 Resource            ../../../libraries/OVSDB.robot
6 Resource            ../../../libraries/SetupUtils.robot
7 Resource            ../../../libraries/Utils.robot
8 Resource            ../../../variables/Variables.robot
9 Resource            ../../../variables/ovsdb/Variables.robot
10
11 Suite Setup         OVSDB.Suite Setup
12 Suite Teardown      Suite Teardown
13 Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
14
15 Force Tags          southbound
16
17
18 *** Variables ***
19 ${BRIDGE}       ovsconf_exit_br
20 ${PORT1}        vx1
21 ${PORT2}        vx2
22 @{NODE_LIST}    ${BRIDGE}    ${PORT1}
23
24
25 *** Test Cases ***
26 Create a Topology in OVSDB node
27     [Documentation]    Create topology in OVSDB and ready it for further tests
28     Utils.Run Command On Mininet    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-manager
29     Utils.Run Command On Mininet    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl add-br ${BRIDGE}
30     Utils.Run Command On Mininet
31     ...    ${TOOLS_SYSTEM_IP}
32     ...    sudo ovs-vsctl add-port ${BRIDGE} ${PORT1} -- set Interface ${PORT1} type=vxlan options:remote_ip=192.168.1.11
33     Utils.Run Command On Mininet    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager ptcp:6634
34
35 Connect to OVSDB Node
36     [Documentation]    Initiate the connection to OVSDB node from controller
37     OVSDB.Connect To Ovsdb Node    ${TOOLS_SYSTEM_IP}
38
39 Get Operational Topology
40     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes
41     BuiltIn.Wait Until Keyword Succeeds
42     ...    8s
43     ...    2s
44     ...    Utils.Check For Elements At URI
45     ...    ${RFC8040_OPERATIONAL_TOPO_API}
46     ...    ${NODE_LIST}
47     ...    pretty_print_json=True
48     [Teardown]    Utils.Report_Failure_Due_To_Bug    5221
49
50 Verify Bridge Port Not In Config DS
51     [Documentation]    This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
52     @{list} =    BuiltIn.Create List    ${PORT1}
53     BuiltIn.Wait Until Keyword Succeeds
54     ...    8s
55     ...    2s
56     ...    Utils.Check For Elements Not At URI
57     ...    ${RFC8040_CONFIG_TOPO_API}
58     ...    ${list}
59     ...    pretty_print_json=True
60
61 Create bridge of already added bridge
62     [Documentation]    This will add bridge to the config datastore
63     OVSDB.Add Bridge To Ovsdb Node
64     ...    ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}
65     ...    ${TOOLS_SYSTEM_IP}
66     ...    ${BRIDGE}
67     ...    0000000000000030
68
69 Get Config Topology with Bridge
70     [Documentation]    This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
71     @{list} =    BuiltIn.Create List    ${BRIDGE}
72     BuiltIn.Wait Until Keyword Succeeds
73     ...    8s
74     ...    2s
75     ...    Utils.Check For Elements At URI
76     ...    ${RFC8040_CONFIG_TOPO_API}
77     ...    ${list}
78     ...    pretty_print_json=True
79
80 Create Port of already added port in OVSDB
81     [Documentation]    This will add port/interface to the config datastore
82     OVSDB.Add Termination Point    ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    ${BRIDGE}    ${PORT1}    10.0.0.10
83
84 Get Config Topology with Bridge and Port
85     [Documentation]    This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
86     BuiltIn.Wait Until Keyword Succeeds
87     ...    8s
88     ...    2s
89     ...    Utils.Check For Elements At URI
90     ...    ${RFC8040_CONFIG_TOPO_API}
91     ...    ${NODE_LIST}
92     ...    pretty_print_json=True
93
94 Modify the destination IP of Port
95     [Documentation]    This will modify the dst ip of existing port
96     OVSDB.Add Termination Point    ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    ${BRIDGE}    ${PORT1}    10.0.0.19
97
98 Get Operational Topology with modified Port
99     [Documentation]    This request will fetch the operational topology after the Port is added to the bridge
100     @{list} =    BuiltIn.Create List    ${BRIDGE}    ${PORT1}    10.0.0.19
101     BuiltIn.Wait Until Keyword Succeeds
102     ...    8s
103     ...    2s
104     ...    Utils.Check For Elements At URI
105     ...    ${RFC8040_OPERATIONAL_TOPO_API}
106     ...    ${list}
107     ...    pretty_print_json=True
108     [Teardown]    Utils.Report_Failure_Due_To_Bug    5221
109
110 Create Port and attach to a Bridge
111     [Documentation]    This request will creates port/interface and attach it to the specific bridge
112     OVSDB.Add Termination Point    ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    ${BRIDGE}    ${PORT2}    10.0.0.121
113
114 Get Operational Topology with Port
115     [Documentation]    This request will fetch the operational topology after the Port is added to the bridge
116     @{list} =    BuiltIn.Create List    ${BRIDGE}    ${PORT2}
117     BuiltIn.Wait Until Keyword Succeeds
118     ...    8s
119     ...    2s
120     ...    Utils.Check For Elements At URI
121     ...    ${RFC8040_OPERATIONAL_TOPO_API}
122     ...    ${list}
123     ...    pretty_print_json=True
124     [Teardown]    Utils.Report_Failure_Due_To_Bug    5221
125
126 Delete the Port1
127     [Documentation]    This request will delete the port node from the bridge node and data store.
128     ${resp} =    RequestsLibrary.Delete Request
129     ...    session
130     ...    ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}/termination-point=${PORT1}
131     BuiltIn.Should Be Equal As Strings    ${resp.status_code}    204
132
133 Get Operational Topology after deletion of Port1
134     [Documentation]    This request will fetch the operational topology after the Port is added to the bridge
135     @{list} =    BuiltIn.Create List    ${PORT1}
136     BuiltIn.Wait Until Keyword Succeeds
137     ...    8s
138     ...    2s
139     ...    Utils.Check For Elements Not At URI
140     ...    ${RFC8040_OPERATIONAL_TOPO_API}
141     ...    ${list}
142     ...    pretty_print_json=True
143
144 Delete the Port2
145     [Documentation]    This request will delete the port node from the bridge node and data store.
146     ${resp} =    RequestsLibrary.Delete Request
147     ...    session
148     ...    ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}/termination-point=${PORT2}
149     BuiltIn.Should Be Equal As Strings    ${resp.status_code}    204
150
151 Get Operational Topology after Deletion of Port2
152     [Documentation]    This request will fetch the operational topology after the Port is deleted
153     @{list} =    BuiltIn.Create List    ${PORT2}
154     BuiltIn.Wait Until Keyword Succeeds
155     ...    8s
156     ...    2s
157     ...    Utils.Check For Elements Not At URI
158     ...    ${RFC8040_OPERATIONAL_TOPO_API}
159     ...    ${list}
160     ...    pretty_print_json=True
161
162 Delete the Bridge
163     [Documentation]    This request will delete the bridge node from the config data store.
164     ${resp} =    RequestsLibrary.Delete Request    session    ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}
165     BuiltIn.Should Be Equal As Strings    ${resp.status_code}    204
166
167 Get Operational Topology after Deletion of Bridge
168     [Documentation]    This request will fetch the operational topology after the Bridge is deleted
169     @{list} =    BuiltIn.Create List    ${BRIDGE}    ${PORT1}    ${PORT2}
170     BuiltIn.Wait Until Keyword Succeeds
171     ...    8s
172     ...    2s
173     ...    Utils.Check For Elements Not At URI
174     ...    ${RFC8040_OPERATIONAL_TOPO_API}
175     ...    ${list}
176     ...    pretty_print_json=True
177
178 Delete the OVSDB Node
179     [Documentation]    This request will delete the OVSDB node
180     ${resp} =    RequestsLibrary.Delete Request    session    ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}
181     BuiltIn.Should Be Equal As Strings    ${resp.status_code}    204
182
183 Get Operational Topology after Deletion of OVSDB Node
184     [Documentation]    This request will fetch the operational topology after the OVSDB node is deleted
185     @{list} =    BuiltIn.Create List
186     ...    ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}
187     ...    ${BRIDGE}
188     ...    ${PORT1}
189     ...    ${PORT2}
190     BuiltIn.Wait Until Keyword Succeeds
191     ...    8s
192     ...    2s
193     ...    Utils.Check For Elements Not At URI
194     ...    ${RFC8040_OPERATIONAL_TOPO_API}
195     ...    ${list}
196     ...    pretty_print_json=True
197
198 Check For Bug 4756
199     [Documentation]    bug 4756 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
200     ...    case executed
201     Utils.Check Karaf Log File Does Not Have Messages
202     ...    ${ODL_SYSTEM_IP}
203     ...    SimpleShardDataTreeCohort.*Unexpected failure in validation phase
204     [Teardown]    Utils.Report_Failure_Due_To_Bug    4756
205
206 Check For Bug 4794
207     [Documentation]    bug 4794 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
208     ...    case executed.
209     Utils.Check Karaf Log File Does Not Have Messages
210     ...    ${ODL_SYSTEM_IP}
211     ...    Shard.*shard-topology-operational An exception occurred while preCommitting transaction
212     [Teardown]    Utils.Report_Failure_Due_To_Bug    4794
213
214
215 *** Keywords ***
216 Suite Teardown
217     [Documentation]    Cleans up test environment, close existing sessions.
218     @{uris} =    Builtin.Create List    ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}
219     OVSDB.Suite Teardown    ${uris}