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