48e23a850a8c7b000fac9f8e22d891d1b77695a6
[integration/test.git] / csit / suites / ovsdb / Southbound_Domain / 040__Vxlan_Extension_Test.robot
1 *** Settings ***
2 Documentation     Test suite for Connection Manager
3 Suite Setup       Vxlan Extension Test Suite Setup
4 Suite Teardown    Vxlan Extension Test Suite Teardown
5 Test Setup        Log Testcase Start To Controller Karaf
6 Force Tags        Southbound
7 Library           OperatingSystem
8 Library           String
9 Library           Collections
10 Library           SSHLibrary
11 Library           RequestsLibrary
12 Library           ../../../libraries/Common.py
13 Variables         ../../../variables/Variables.py
14 Resource          ../../../libraries/Utils.robot
15 Resource          ../../../libraries/OVSDB.robot
16
17 *** Variables ***
18 ${OVSDB_PORT}     6634
19 ${OVSDB_CONFIG_DIR}    ${CURDIR}/../../../variables/ovsdb
20 @{node_list1}     ovsdb://${TOOLS_SYSTEM_2_IP}:${OVSDB_PORT}    ${TOOLS_SYSTEM_2_IP}    ${OVSDB_PORT}    ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_PORT}    ${TOOLS_SYSTEM_IP}    ${OVSDB_PORT}
21 ${start1}         sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --switch=ovsk,protocols=OpenFlow13 --custom ovsdb.py --topo host,1
22 ${start2}         sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --switch=ovsk,protocols=OpenFlow13 --custom ovsdb.py --topo host,2
23
24 *** Test Cases ***
25 Make the OVS instance to listen for connection
26     Run Command On Remote System    ${TOOLS_SYSTEM_2_IP}    sudo ovs-vsctl del-manager
27     Run Command On Remote System    ${TOOLS_SYSTEM_2_IP}    sudo ovs-vsctl set-manager ptcp:${OVSDB_PORT}
28     Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-manager
29     Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager ptcp:${OVSDB_PORT}
30
31 Connect controller to OVSDB Node1
32     [Documentation]    Initiate the connection to OVSDB node from controller
33     Connect To Ovsdb Node    ${TOOLS_SYSTEM_2_IP}
34
35 Connect controller to OVSDB Node2
36     [Documentation]    Initiate the connection to OVSDB node from controller
37     Connect To Ovsdb Node    ${TOOLS_SYSTEM_IP}
38
39 Get Operational Topology from OVSDB Node1 and OVSDB Node2
40     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes
41     Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${node_list1}
42
43 Start the Mininet and create custom topology
44     [Documentation]    This will start mininet with custom topology on both the Virtual Machines
45     ${conn_id1}    Start Mininet    ${TOOLS_SYSTEM_2_IP}    ${start1}    ${OVSDB_CONFIG_DIR}/ovsdb.py
46     Set Global Variable    ${conn_id1}
47     ${conn_id2}    Start Mininet    ${TOOLS_SYSTEM_IP}    ${start2}    ${OVSDB_CONFIG_DIR}/ovsdb.py
48     Set Global Variable    ${conn_id2}
49
50 Get Operational Topology with custom topology
51     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes to make sure the mininet created custom topology
52     @{list}    Create List    s1    s2
53     Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${list}
54
55 Add the bridge s1 in the config datastore of OVSDB Node1
56     [Documentation]    This request will add already operational bridge to the config data store of the OVSDB node.
57     Add Bridge To Ovsdb Node    ${TOOLS_SYSTEM_2_IP}    s1    0000000000000001
58
59 Add the bridge s2 in the config datastore of OVSDB Node2
60     [Documentation]    This request will add already operational bridge to the config data store of the OVSDB node.
61     Add Bridge To Ovsdb Node    ${TOOLS_SYSTEM_IP}    s2    0000000000000002
62
63 Get Config Topology with s1 and s2 Bridges
64     [Documentation]    This will fetch the configuration topology from configuration data store to verify the bridge is added to the config data store
65     @{list}    Create List    s1    s2
66     Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${CONFIG_TOPO_API}    ${list}
67
68 Create Vxlan Port and attach to s1 Bridge
69     [Documentation]    This request will create vxlan port/interface for vxlan tunnel and attach it to the specific bridge s1 of OVSDB node 1
70     Add Vxlan To Bridge    ${TOOLS_SYSTEM_IP}    s2    vxlanport    ${TOOLS_SYSTEM_2_IP}
71
72 Create Vxlan Port and attach to s2 Bridge
73     [Documentation]    This request will create vxlan port/interface for vxlan tunnel and attach it to the specific bridge s2 of OVSDB node 2
74     Add Vxlan To Bridge    ${TOOLS_SYSTEM_2_IP}    s1    vxlanport    ${TOOLS_SYSTEM_IP}
75
76 Get Operational Topology with vxlan tunnel
77     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes to verify that the vxlan tunnel is created
78     @{list}    Create List    vxlanport    ${TOOLS_SYSTEM_2_IP}    ${TOOLS_SYSTEM_IP}
79     Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${list}
80
81 Disconnect controller connection from the connected OVSDBs nodes
82     [Documentation]    This request will disconnect the controller from the connected OVSDB node for clean startup for next suite.
83     [Tags]    Southbound
84     Disconnect From Ovsdb Node    ${TOOLS_SYSTEM_IP}
85     Disconnect From Ovsdb Node    ${TOOLS_SYSTEM_2_IP}
86
87 Verify that the operational topology is clean
88     [Documentation]    This request will verify the operational toplogy after the mininet is cleaned.
89     [Tags]    Southbound
90     @{list}    Create List    ${TOOLS_SYSTEM_IP}    ${TOOLS_SYSTEM_2_IP}    s1    s2
91     Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
92
93 Check For Bug 4756
94     [Documentation]    bug 4756 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
95     ...    case executed.
96     Check Karaf Log File Does Not Have Messages    ${ODL_SYSTEM_IP}    SimpleShardDataTreeCohort.*Unexpected failure in validation phase
97     [Teardown]    Report_Failure_Due_To_Bug    4756
98
99 Check For Bug 4794
100     [Documentation]    bug 4794 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
101     ...    case executed.
102     Check Karaf Log File Does Not Have Messages    ${ODL_SYSTEM_IP}    Shard.*shard-topology-operational An exception occurred while preCommitting transaction
103     [Teardown]    Report_Failure_Due_To_Bug    4794
104
105 *** Keywords ***
106 Vxlan Extension Test Suite Setup
107     Open Controller Karaf Console On Background
108     Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
109
110 Vxlan Extension Test Suite Teardown
111     [Documentation]    Cleans up test environment, close existing sessions.
112     Clean OVSDB Test Environment    ${TOOLS_SYSTEM_IP}
113     Clean OVSDB Test Environment    ${TOOLS_SYSTEM_2_IP}
114     RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
115     RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${TOOLS_SYSTEM_2_IP}:${OVSDB_PORT}
116     ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
117     Log    ${resp.content}
118     Delete All Sessions