Migrate Get Requests invocations(libraries)
[integration/test.git] / csit / suites / ovsdb / Southbound_Domain / 040__Vxlan_Extension_Test.robot
1 *** Settings ***
2 Documentation       Test suite for Connection Manager
3
4 Library             RequestsLibrary
5 Resource            ../../../libraries/MininetKeywords.robot
6 Resource            ../../../libraries/OVSDB.robot
7 Resource            ../../../libraries/SetupUtils.robot
8 Resource            ../../../libraries/Utils.robot
9 Resource            ../../../variables/Variables.robot
10 Resource            ../../../variables/ovsdb/Variables.robot
11
12 Suite Setup         OVSDB.Suite Setup
13 Suite Teardown      Suite Teardown
14 Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
15
16 Force Tags          southbound
17
18
19 *** Variables ***
20 @{NODE_LIST}
21 ...                 ${OVSDB_NODE_PORT}
22 ...                 ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}
23 ...                 ${TOOLS_SYSTEM_IP}
24 ...                 ${OVSDB_NODE_PORT}
25 ...                 ovsdb://${TOOLS_SYSTEM_2_IP}:${OVSDB_NODE_PORT}
26 ...                 ${TOOLS_SYSTEM_2_IP}
27 ${MN_OPTS_S1}       --custom ovsdb.py --topo host,1
28 ${MN_OPTS_S2}       --custom ovsdb.py --topo host,2
29
30
31 *** Test Cases ***
32 Make the OVS instance to listen for connection
33     Utils.Run Command On Mininet    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-manager
34     Utils.Run Command On Mininet    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager ptcp:${OVSDB_NODE_PORT}
35     Utils.Run Command On Mininet    ${TOOLS_SYSTEM_2_IP}    sudo ovs-vsctl del-manager
36     Utils.Run Command On Mininet    ${TOOLS_SYSTEM_2_IP}    sudo ovs-vsctl set-manager ptcp:${OVSDB_NODE_PORT}
37
38 Connect controller to OVSDB Node1
39     [Documentation]    Initiate the connection to OVSDB node from controller
40     OVSDB.Connect To Ovsdb Node    ${TOOLS_SYSTEM_IP}
41
42 Connect controller to OVSDB Node2
43     [Documentation]    Initiate the connection to OVSDB node from controller
44     OVSDB.Connect To Ovsdb Node    ${TOOLS_SYSTEM_2_IP}
45
46 Get Operational Topology from OVSDB Node1 and OVSDB Node2
47     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes
48     BuiltIn.Wait Until Keyword Succeeds
49     ...    8s
50     ...    2s
51     ...    Utils.Check For Elements At URI
52     ...    ${RFC8040_OPERATIONAL_TOPO_API}
53     ...    ${NODE_LIST}
54     ...    pretty_print_json=True
55
56 Start the Mininet and create custom topology
57     [Documentation]    This will start mininet with custom topology on both the Virtual Machines
58     ${conn_id1} =    MininetKeywords.Start Mininet Single Controller
59     ...    ${TOOLS_SYSTEM_IP}
60     ...    ${ODL_SYSTEM_IP}
61     ...    ${MN_OPTS_S1}
62     ...    ${OVSDB_CONFIG_DIR}/ovsdb.py
63     ${conn_id2} =    MininetKeywords.Start Mininet Single Controller
64     ...    ${TOOLS_SYSTEM_2_IP}
65     ...    ${ODL_SYSTEM_IP}
66     ...    ${MN_OPTS_S2}
67     ...    ${OVSDB_CONFIG_DIR}/ovsdb.py
68
69 Get Operational Topology with custom topology
70     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes to make sure the mininet created custom topology
71     @{list} =    BuiltIn.Create List    s1    s2
72     BuiltIn.Wait Until Keyword Succeeds
73     ...    8s
74     ...    2s
75     ...    Utils.Check For Elements At URI
76     ...    ${RFC8040_OPERATIONAL_TOPO_API}
77     ...    ${list}
78     ...    pretty_print_json=True
79
80 Add the bridge s1 in the config datastore of OVSDB Node1
81     [Documentation]    This request will add already operational bridge to the config data store of the OVSDB node.
82     OVSDB.Add Bridge To Ovsdb Node
83     ...    ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}
84     ...    ${TOOLS_SYSTEM_IP}
85     ...    s1
86     ...    0000000000000051
87
88 Add the bridge s2 in the config datastore of OVSDB Node2
89     [Documentation]    This request will add already operational bridge to the config data store of the OVSDB node.
90     OVSDB.Add Bridge To Ovsdb Node
91     ...    ${TOOLS_SYSTEM2_IP}:${OVSDB_NODE_PORT}
92     ...    ${TOOLS_SYSTEM_2_IP}
93     ...    s2
94     ...    0000000000000052
95
96 Get Config Topology with s1 and s2 Bridges
97     [Documentation]    This will fetch the configuration topology from configuration data store to verify the bridge is added to the config data store
98     @{list} =    BuiltIn.Create List    s1    s2
99     BuiltIn.Wait Until Keyword Succeeds
100     ...    8s
101     ...    2s
102     ...    Utils.Check For Elements At URI
103     ...    ${RFC8040_CONFIG_TOPO_API}
104     ...    ${list}
105     ...    pretty_print_json=True
106
107 Create Vxlan Port and attach to s1 Bridge
108     [Documentation]    This request will create vxlan port/interface for vxlan tunnel and attach it to the specific bridge s1 of OVSDB node 1
109     OVSDB.Add Vxlan To Bridge    ${TOOLS_SYSTEM_IP}    s1    s1-s2    ${TOOLS_SYSTEM_2_IP}
110
111 Create Vxlan Port and attach to s2 Bridge
112     [Documentation]    This request will create vxlan port/interface for vxlan tunnel and attach it to the specific bridge s2 of OVSDB node 2
113     OVSDB.Add Vxlan To Bridge    ${TOOLS_SYSTEM_2_IP}    s2    s2-s1    ${TOOLS_SYSTEM_IP}
114
115 Get Operational Topology with vxlan tunnel
116     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes to verify that the vxlan tunnel is created
117     @{list} =    BuiltIn.Create List    s1-s2    s2-s1    ${TOOLS_SYSTEM_IP}    ${TOOLS_SYSTEM_2_IP}
118     BuiltIn.Wait Until Keyword Succeeds
119     ...    8s
120     ...    2s
121     ...    Utils.Check For Elements At URI
122     ...    ${RFC8040_OPERATIONAL_TOPO_API}
123     ...    ${list}
124     ...    pretty_print_json=True
125
126 Delete Bridges from config datastore
127     [Documentation]    This request will delete the bridges from config data store.
128     [Tags]    southbound
129     OVSDB.Delete Bridge From Ovsdb Node    ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    s1
130     OVSDB.Delete Bridge From Ovsdb Node    ${TOOLS_SYSTEM_2_IP}:${OVSDB_NODE_PORT}    s2
131
132 Disconnect controller connection from the connected OVSDBs nodes
133     [Documentation]    This request will disconnect the controller from the connected OVSDB node for clean startup for next suite.
134     [Tags]    southbound
135     OVSDB.Disconnect From Ovsdb Node    ${TOOLS_SYSTEM_IP}
136     OVSDB.Disconnect From Ovsdb Node    ${TOOLS_SYSTEM_2_IP}
137
138 Verify that the operational topology is clean
139     [Documentation]    This request will verify the operational toplogy after the mininet is cleaned.
140     [Tags]    southbound
141     @{list} =    BuiltIn.Create List    ${TOOLS_SYSTEM_IP}    ${TOOLS_SYSTEM_2_IP}    s1    s2
142     BuiltIn.Wait Until Keyword Succeeds
143     ...    8s
144     ...    2s
145     ...    Utils.Check For Elements Not At URI
146     ...    ${RFC8040_OPERATIONAL_TOPO_API}
147     ...    ${list}
148     ...    pretty_print_json=True
149
150 Check For Bug 4756
151     [Documentation]    bug 4756 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
152     ...    case executed.
153     Utils.Check Karaf Log File Does Not Have Messages
154     ...    ${ODL_SYSTEM_IP}
155     ...    SimpleShardDataTreeCohort.*Unexpected failure in validation phase
156     [Teardown]    Utils.Report_Failure_Due_To_Bug    4756
157
158 Check For Bug 4794
159     [Documentation]    bug 4794 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
160     ...    case executed.
161     Utils.Check Karaf Log File Does Not Have Messages
162     ...    ${ODL_SYSTEM_IP}
163     ...    Shard.*shard-topology-operational An exception occurred while preCommitting transaction
164     [Teardown]    Utils.Report_Failure_Due_To_Bug    4794
165
166
167 *** Keywords ***
168 Suite Teardown
169     [Documentation]    Cleans up test environment, close existing sessions.
170     OVSDB.Clean OVSDB Test Environment    ${TOOLS_SYSTEM_IP}
171     OVSDB.Clean OVSDB Test Environment    ${TOOLS_SYSTEM_2_IP}
172     OVSDB.Log Config And Operational Topology
173     RequestsLibrary.Delete All Sessions