Cleanup ovsdb suites
[integration/test.git] / csit / suites / ovsdb / Southbound_Domain / 030__configure_exit_ovsdb_node.robot
1 *** Settings ***
2 Documentation     Test suite for Connection Manager
3 Suite Setup       OVSDB.Suite Setup
4 Suite Teardown    Suite Teardown
5 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
6 Force Tags        Southbound
7 Library           RequestsLibrary
8 Resource          ../../../libraries/OVSDB.robot
9 Resource          ../../../libraries/SetupUtils.robot
10 Resource          ../../../libraries/Utils.robot
11 Resource          ../../../variables/Variables.robot
12
13 *** Variables ***
14 ${BRIDGE}         ovsconf_exit_br
15 ${PORT1}          vx1
16 ${PORT2}          vx2
17 @{NODE_LIST}      ${BRIDGE}    ${PORT1}
18
19 *** Test Cases ***
20 Create a Topology in OVSDB node
21     [Documentation]    Create topology in OVSDB and ready it for further tests
22     Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-manager
23     Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl add-br ${BRIDGE}
24     Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl add-port ${BRIDGE} ${PORT1} -- set Interface ${PORT1} type=vxlan options:remote_ip=192.168.1.11
25     Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager ptcp:6634
26
27 Connect to OVSDB Node
28     [Documentation]    Initiate the connection to OVSDB node from controller
29     OVSDB.Connect To Ovsdb Node    ${TOOLS_SYSTEM_IP}
30
31 Get Operational Topology
32     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes
33     BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${NODE_LIST}    pretty_print_json=True
34     [Teardown]    Utils.Report_Failure_Due_To_Bug    5221
35
36 Verify Bridge Port Not In Config DS
37     [Documentation]    This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
38     @{list} =    BuiltIn.Create List    ${PORT1}
39     BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements Not At URI    ${CONFIG_TOPO_API}    ${list}    pretty_print_json=True
40
41 Create bridge of already added bridge
42     [Documentation]    This will add bridge to the config datastore
43     OVSDB.Add Bridge To Ovsdb Node    ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    ${TOOLS_SYSTEM_IP}    ${BRIDGE}    0000000000000030
44
45 Get Config Topology with Bridge
46     [Documentation]    This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
47     @{list} =    BuiltIn.Create List    ${BRIDGE}
48     BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${CONFIG_TOPO_API}    ${list}    pretty_print_json=True
49
50 Create Port of already added port in OVSDB
51     [Documentation]    This will add port/interface to the config datastore
52     OVSDB.Add Termination Point    ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    ${BRIDGE}    ${PORT1}    10.0.0.10
53
54 Get Config Topology with Bridge and Port
55     [Documentation]    This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
56     BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${CONFIG_TOPO_API}    ${NODE_LIST}    pretty_print_json=True
57
58 Modify the destination IP of Port
59     [Documentation]    This will modify the dst ip of existing port
60     OVSDB.Add Termination Point    ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    ${BRIDGE}    ${PORT1}    10.0.0.19
61
62 Get Operational Topology with modified Port
63     [Documentation]    This request will fetch the operational topology after the Port is added to the bridge
64     @{list} =    BuiltIn.Create List    ${BRIDGE}    ${PORT1}    10.0.0.19
65     BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${list}    pretty_print_json=True
66     [Teardown]    Utils.Report_Failure_Due_To_Bug    5221
67
68 Create Port and attach to a Bridge
69     [Documentation]    This request will creates port/interface and attach it to the specific bridge
70     OVSDB.Add Termination Point    ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    ${BRIDGE}    ${PORT2}    10.0.0.121
71
72 Get Operational Topology with Port
73     [Documentation]    This request will fetch the operational topology after the Port is added to the bridge
74     @{list} =    BuiltIn.Create List    ${BRIDGE}    ${PORT2}
75     BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${list}    pretty_print_json=True
76     [Teardown]    Utils.Report_Failure_Due_To_Bug    5221
77
78 Delete the Port1
79     [Documentation]    This request will delete the port node from the bridge node and data store.
80     ${resp} =    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_NODE_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/${PORT1}/
81     BuiltIn.Should Be Equal As Strings    ${resp.status_code}    200
82
83 Get Operational Topology after deletion of Port1
84     [Documentation]    This request will fetch the operational topology after the Port is added to the bridge
85     @{list} =    BuiltIn.Create List    ${PORT1}
86     BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}    pretty_print_json=True
87
88 Delete the Port2
89     [Documentation]    This request will delete the port node from the bridge node and data store.
90     ${resp} =    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_NODE_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/${PORT2}/
91     BuiltIn.Should Be Equal As Strings    ${resp.status_code}    200
92
93 Get Operational Topology after Deletion of Port2
94     [Documentation]    This request will fetch the operational topology after the Port is deleted
95     @{list} =    BuiltIn.Create List    ${PORT2}
96     BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}    pretty_print_json=True
97
98 Delete the Bridge
99     [Documentation]    This request will delete the bridge node from the config data store.
100     ${resp} =    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_NODE_CONFIG_API}%2Fbridge%2F${BRIDGE}
101     BuiltIn.Should Be Equal As Strings    ${resp.status_code}    200
102
103 Get Operational Topology after Deletion of Bridge
104     [Documentation]    This request will fetch the operational topology after the Bridge is deleted
105     @{list} =    BuiltIn.Create List    ${BRIDGE}    ${PORT1}    ${PORT2}
106     BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}    pretty_print_json=True
107
108 Delete the OVSDB Node
109     [Documentation]    This request will delete the OVSDB node
110     ${resp} =    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_NODE_CONFIG_API}
111     BuiltIn.Should Be Equal As Strings    ${resp.status_code}    200
112
113 Get Operational Topology after Deletion of OVSDB Node
114     [Documentation]    This request will fetch the operational topology after the OVSDB node is deleted
115     @{list} =    BuiltIn.Create List    ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    ${BRIDGE}    ${PORT1}    ${PORT2}
116     BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}    pretty_print_json=True
117
118 Check For Bug 4756
119     [Documentation]    bug 4756 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
120     ...    case executed
121     Utils.Check Karaf Log File Does Not Have Messages    ${ODL_SYSTEM_IP}    SimpleShardDataTreeCohort.*Unexpected failure in validation phase
122     [Teardown]    Utils.Report_Failure_Due_To_Bug    4756
123
124 Check For Bug 4794
125     [Documentation]    bug 4794 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
126     ...    case executed.
127     Utils.Check Karaf Log File Does Not Have Messages    ${ODL_SYSTEM_IP}    Shard.*shard-topology-operational An exception occurred while preCommitting transaction
128     [Teardown]    Utils.Report_Failure_Due_To_Bug    4794
129
130 *** Keywords ***
131 Suite Teardown
132     [Documentation]    Cleans up test environment, close existing sessions.
133     @{uris} =    Builtin.Create List    ${SOUTHBOUND_NODE_CONFIG_API}
134     OVSDB.Suite Teardown    ${uris}