2 Documentation Collection of test cases to validate OVSDB projects bugs.
3 ... - https://bugs.opendaylight.org/show_bug.cgi?id=5221
4 ... - https://bugs.opendaylight.org/show_bug.cgi?id=5177
5 ... - https://bugs.opendaylight.org/show_bug.cgi?id=4794
6 Suite Setup OVSDB Connection Manager Suite Setup
7 Suite Teardown OVSDB Connection Manager Suite Teardown
8 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
10 Library OperatingSystem
12 Library RequestsLibrary
13 Variables ../../../variables/Variables.py
14 Resource ../../../libraries/Utils.robot
15 Resource ../../../libraries/SetupUtils.robot
16 Resource ../../../libraries/WaitForFailure.robot
17 Resource ../../../libraries/OVSDB.robot
21 ${BRIDGE} ovsdb-csit-test-5177
22 ${SOUTHBOUND_CONFIG_API} ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
23 ${OVSDB_CONFIG_DIR} ${CURDIR}/../../../variables/ovsdb
27 [Documentation] In the case that an ovs node is rebooted, or the ovs service is
28 ... otherwise restarted, a controller initiated connection should reconnect when
29 ... the ovs is ready and available.
30 [Setup] Clean OVSDB Test Environment
31 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set-manager ptcp:${OVSDB_PORT}
32 Connect Controller To OVSDB Node
33 @{list} Create List ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
34 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list}
35 Create Bridge ${TOOLS_SYSTEM_IP}:6634 ${BRIDGE}
36 @{list} Create List ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_PORT}/bridge/${BRIDGE}
37 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list}
38 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo /usr/share/openvswitch/scripts/ovs-ctl stop
39 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list}
40 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo /usr/share/openvswitch/scripts/ovs-ctl start
41 # Depending on when the retry timers are firing, it may take some 10s of seconds to reconnect, so setting to 30 to cover that.
42 Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list}
43 [Teardown] Run Keywords Clean OVSDB Test Environment
44 ... AND Report_Failure_Due_To_Bug 5221
47 [Documentation] This test case will recreate the bug using the same basic steps as
48 ... provided in the bug, and noted here:
49 ... 1) create bridge in config using the UUID determined in Suite Setup
50 ... 2) connect ovs (vsctl set-manager)
51 ... 3) Fail if node is not discovered in Operational Store
52 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:6640
53 Wait Until Keyword Succeeds 5s 1s Verify OVS Reports Connected
54 ${ovsdb_uuid}= Get OVSDB UUID ${TOOLS_SYSTEM_IP}
55 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl del-manager
56 # Suite teardown wants this ${ovsdb_uuid} variable for it's best effort cleanup, so making it visible at suite level.
57 Set Suite Variable ${ovsdb_uuid}
58 ${node} Set Variable uuid/${ovsdb_uuid}
59 Create Bridge ${node} ${BRIDGE}
60 ${resp} RequestsLibrary.Get Request session ${CONFIG_TOPO_API}
62 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
63 Should Contain ${resp.content} ${node}/bridge/${BRIDGE}
64 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:6640
65 @{list} Create List ${BRIDGE}
66 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list}
67 [Teardown] Run Keywords Clean OVSDB Test Environment
68 ... AND Report_Failure_Due_To_Bug 5177
71 [Documentation] This test is dependent on the work done in the Bug 5177 test case so should
72 ... always be executed immediately after.
73 ... 1) delete bridge in config
74 ... 2) Poll and Fail if exception is seen in karaf.log
75 ${node} Set Variable ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}
76 ${resp} RequestsLibrary.Delete Request session ${CONFIG_TOPO_API}/topology/ovsdb:1/node/${node}%2Fbridge%2F${BRIDGE}
77 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
78 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl del-manager
79 # If the exception is seen in karaf.log within 10s, the following line will FAIL, which is the point.
80 Verify_Keyword_Does_Not_Fail_Within_Timeout 10s 1s Check Karaf Log File Does Not Have Messages ${ODL_SYSTEM_IP} Shard.*shard-topology-operational An exception occurred while preCommitting transaction
82 [Teardown] Run Keywords Clean OVSDB Test Environment
83 ... AND Report_Failure_Due_To_Bug 4794
86 OVSDB Connection Manager Suite Setup
87 SetupUtils.Setup_Utils_For_Setup_And_Teardown
88 Open Controller Karaf Console On Background
89 Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
90 Clean OVSDB Test Environment ${TOOLS_SYSTEM_IP}
91 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:6640
92 Wait Until Keyword Succeeds 5s 1s Verify OVS Reports Connected
93 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl del-manager
95 OVSDB Connection Manager Suite Teardown
96 [Documentation] Cleans up test environment, close existing sessions.
97 Clean OVSDB Test Environment ${TOOLS_SYSTEM_IP}
98 # Best effort to clean config store, by deleting all the types of nodes that are used in this suite
99 ${node} Set Variable ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}
100 RequestsLibrary.Delete Request session ${CONFIG_TOPO_API}/topology/ovsdb:1/node/${node}
101 RequestsLibrary.Delete Request session ${CONFIG_TOPO_API}/topology/ovsdb:1/node/${node}%2Fbridge%2F${BRIDGE}
102 ${node} Set Variable ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
103 RequestsLibrary.Delete Request session ${CONFIG_TOPO_API}/topology/ovsdb:1/node/${node}
104 RequestsLibrary.Delete Request session ${CONFIG_TOPO_API}/topology/ovsdb:1/node/${node}%2Fbridge%2F${BRIDGE}
105 ${resp} RequestsLibrary.Get Request session ${CONFIG_TOPO_API}
108 # TODO: both Create Bridge and Connect Controller To OVSDB Node keywords below should be moved to a library
109 # and all the suites using this kind of work can move to using the library instead of
110 # doing all this work each time.
113 [Arguments] ${node_string} ${bridge}
114 [Documentation] This will create bridge on the specified OVSDB node.
115 ${body} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_bridge.json
116 ${body} Replace String ${body} ovsdb://127.0.0.1:61644 ovsdb://${node_string}
117 ${body} Replace String ${body} tcp:127.0.0.1:6633 tcp:${ODL_SYSTEM_IP}:6633
118 ${body} Replace String ${body} 127.0.0.1 ${TOOLS_SYSTEM_IP}
119 ${body} Replace String ${body} br01 ${bridge}
120 ${body} Replace String ${body} 61644 ${OVSDB_PORT}
121 ${node_string} Replace String ${node_string} / %2F
122 ${uri}= Set Variable ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${node_string}%2Fbridge%2F${bridge}
125 ${resp} RequestsLibrary.Put Request session ${uri} data=${body}
126 Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
128 Connect Controller To OVSDB Node
129 [Documentation] Initiate the connection to OVSDB node from controller
130 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/connect.json
131 ${sample1} Replace String ${sample} 127.0.0.1 ${TOOLS_SYSTEM_IP}
132 ${body} Replace String ${sample1} 61644 ${OVSDB_PORT}
134 ${resp} RequestsLibrary.Put Request session ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:${OVSDB_PORT} data=${body}
136 Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
137 Wait Until Keyword Succeeds 5s 1s Verify OVS Reports Connected