OVSDB Southbound TestSuites Updated
authorChaudhry Muhammad Usama <chaudhryusama@gmail.com>
Mon, 8 Jun 2015 18:47:46 +0000 (11:47 -0700)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 10 Jun 2015 01:51:31 +0000 (01:51 +0000)
Change-Id: I362d90491fbd531cb2d8cdc6165e3a93450a50af
Signed-off-by: Chaudhry Muhammad Usama <chaudhryusama@gmail.com>
test/csit/suites/ovsdb/Southbound_Domain/010__connection_manager.robot
test/csit/suites/ovsdb/Southbound_Domain/020__configure_1_ovsdb_node.robot
test/csit/suites/ovsdb/Southbound_Domain/030__configure_exit_ovsdb_node.robot [new file with mode: 0644]
test/csit/variables/ovsdb/create_bridge.json
test/csit/variables/ovsdb/create_port.json

index 68f2d749da0015b8e5b6db160ac18e6a087b846c..9a651b266d863a91af3de4607bd369a061de1739 100644 (file)
@@ -11,14 +11,19 @@ Resource          ../../../libraries/Utils.txt
 *** Variables ***
 ${OVSDB_PORT}     6644
 ${SOUTHBOUND_CONFIG_API}    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${MININET}:${OVSDB_PORT}
-${FILE}           ${CURDIR}/../../../variables/ovsdb
+${OVSDB_CONFIG_DIR}    ${CURDIR}/../../../variables/ovsdb
 @{node_list}      ovsdb://${MININET}:${OVSDB_PORT}    ${MININET}    ${OVSDB_PORT}
 
 *** Test Cases ***
+Make the OVS instacne to listen for connection
+    [Tags]    Southbound
+    Run Command On Remote System    ${MININET}    sudo ovs-vsctl del-manager
+    Run Command On Remote System    ${MININET}    sudo ovs-vsctl set-manager ptcp:6644
+
 Connect to OVSDB Node
     [Documentation]    Initiate the connection to OVSDB node from controller
     [Tags]    Southbound
-    ${sample}    OperatingSystem.Get File    ${FILE}/connect.json
+    ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/connect.json
     ${sample1}    Replace String    ${sample}    127.0.0.1    ${MININET}
     ${body}    Replace String    ${sample1}    61644    ${OVSDB_PORT}
     Log    URL is ${SOUTHBOUND_CONFIG_API}
@@ -37,7 +42,7 @@ Get Config Topology
 Get Operational Topology
     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes
     [Tags]    Southbound
-    Wait Until Keyword Succeeds    6s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${node_list}
+    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${node_list}
 
 Delete the OVSDB Node
     [Documentation]    This request will delete the OVSDB node
@@ -48,4 +53,4 @@ Delete the OVSDB Node
 Get Operational Topology after Deletion
     [Documentation]    This request will fetch the operational topology after the OVSDB node is deleted
     [Tags]    Southbound
-    Wait Until Keyword Succeeds    6s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${node_list}
+    Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${node_list}
index 6b152db23912213981c879bc56b5f5c0e764d5b8..addc98027911b6a7475174ad744b98317eaba998 100644 (file)
@@ -12,13 +12,18 @@ Resource          ../../../libraries/Utils.txt
 ${OVSDB_PORT}     6644
 ${BRIDGE}         br01
 ${SOUTHBOUND_CONFIG_API}    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${MININET}:${OVSDB_PORT}
-${FILE}           ${CURDIR}/../../../variables/ovsdb
+${OVSDB_CONFIG_DIR}    ${CURDIR}/../../../variables/ovsdb
 
 *** Test Cases ***
+Make the OVS instacne to listen for connection
+    [Tags]    Southbound
+    Run Command On Remote System    ${MININET}    sudo ovs-vsctl del-manager
+    Run Command On Remote System    ${MININET}    sudo ovs-vsctl set-manager ptcp:6644
+
 Connect to OVSDB Node
     [Documentation]    Initiate the connection to OVSDB node from controller
     [Tags]    Southbound
-    ${sample}    OperatingSystem.Get File    ${FILE}/connect.json
+    ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/connect.json
     ${sample1}    Replace String    ${sample}    127.0.0.1    ${MININET}
     ${body}    Replace String    ${sample1}    61644    ${OVSDB_PORT}
     Log    URL is ${SOUTHBOUND_CONFIG_API}
@@ -29,8 +34,8 @@ Connect to OVSDB Node
 Create a Bridge
     [Documentation]    This will create bridge on the specified OVSDB node.
     [Tags]    Southbound
-    ${sample}    OperatingSystem.Get File    ${FILE}/create_bridge.json
-    ${sample1}    Replace String    ${sample}    tcp:127.0.0.1:6630    tcp:${CONTROLLER}:6633
+    ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_bridge.json
+    ${sample1}    Replace String    ${sample}    tcp:127.0.0.1:6633    tcp:${CONTROLLER}:6633
     ${sample2}    Replace String    ${sample1}    127.0.0.1    ${MININET}
     ${sample3}    Replace String    ${sample2}    br01    ${BRIDGE}
     ${body}    Replace String    ${sample3}    61644    ${OVSDB_PORT}
@@ -51,12 +56,12 @@ Get Operational Topology with Bridge
     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes to verify the bridge is added to the data store
     [Tags]    Southbound
     @{list}    Create List    ${BRIDGE}
-    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${list}
+    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${list}
 
 Create Port and attach to a Bridge
     [Documentation]    This request will creates port/interface and attach it to the specific bridge
     [Tags]    Southbound
-    ${body}    OperatingSystem.Get File    ${FILE}/create_port.json
+    ${body}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_port.json
     Log    URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/
     ${resp}    RequestsLibrary.Put    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/    data=${body}
     Log    ${resp.content}
@@ -66,7 +71,7 @@ Get Operational Topology with Port
     [Documentation]    This request will fetch the operational topology after the Port is added to the bridge
     [Tags]    Southbound
     @{list}    Create List    ${BRIDGE}    vxlanport
-    Wait Until Keyword Succeeds    6s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${list}
+    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${list}
 
 Delete the Port
     [Documentation]    This request will delete the port node from the bridge node and data store.
@@ -78,7 +83,7 @@ Get Operational Topology after Deletion of Port
     [Documentation]    This request will fetch the operational topology after the Port is deleted
     [Tags]    Southbound
     @{list}    Create List    vxlanport
-    Wait Until Keyword Succeeds    6s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
+    Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
 
 Delete the Bridge
     [Documentation]    This request will delete the bridge node from the config data store.
@@ -90,7 +95,7 @@ Get Operational Topology after Deletion of Bridge
     [Documentation]    This request will fetch the operational topology after the Bridge is deleted
     [Tags]    Southbound
     @{list}    Create List    ${BRIDGE}    vxlanport
-    Wait Until Keyword Succeeds    6s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
+    Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
 
 Delete the OVSDB Node
     [Documentation]    This request will delete the OVSDB node
@@ -102,4 +107,4 @@ Get Operational Topology after Deletion of OVSDB Node
     [Documentation]    This request will fetch the operational topology after the OVSDB node is deleted
     [Tags]    Southbound
     @{list}    Create List    ovsdb://${MININET}:${OVSDB_PORT}    ${BRIDGE}    vxlanport
-    Wait Until Keyword Succeeds    6s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
+    Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
diff --git a/test/csit/suites/ovsdb/Southbound_Domain/030__configure_exit_ovsdb_node.robot b/test/csit/suites/ovsdb/Southbound_Domain/030__configure_exit_ovsdb_node.robot
new file mode 100644 (file)
index 0000000..5c9fcd1
--- /dev/null
@@ -0,0 +1,142 @@
+*** Settings ***
+Documentation     Test suite for Connection Manager
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
+Suite Teardown    Delete All Sessions
+Library           OperatingSystem
+Library           String
+Library           RequestsLibrary
+Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+${OVSDB_PORT}     6644
+${BRIDGE}         br-s1
+${SOUTHBOUND_CONFIG_API}    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${MININET}:${OVSDB_PORT}
+${OVSDB_CONFIG_DIR}    ${CURDIR}/../../../variables/ovsdb
+@{node_list}      ${BRIDGE}    vx1
+
+*** Test Cases ***
+Create a Topology in OVSDB node
+    [Documentation]    Create topology in OVSDB and ready it for further tests
+    [Tags]    Southbound
+    Run Command On Remote System    ${MININET}    sudo ovs-vsctl del-manager
+    Run Command On Remote System    ${MININET}    sudo ovs-vsctl add-br ${BRIDGE}
+    Run Command On Remote System    ${MININET}    sudo ovs-vsctl set-manager ptcp:6644
+
+Connect to OVSDB Node
+    [Documentation]    Initiate the connection to OVSDB node from controller
+    [Tags]    Southbound
+    ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/connect.json
+    ${sample1}    Replace String    ${sample}    127.0.0.1    ${MININET}
+    ${body}    Replace String    ${sample1}    61644    ${OVSDB_PORT}
+    Log    URL is ${SOUTHBOUND_CONFIG_API}
+    ${resp}    RequestsLibrary.Put    session    ${SOUTHBOUND_CONFIG_API}    data=${body}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Get Operational Topology
+    [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes
+    [Tags]    Southbound
+    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${node_list}
+
+Get Config Topology without Bridge
+    [Documentation]    This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
+    [Tags]    Southbound
+    Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${CONFIG_TOPO_API}    ${node_list}
+
+Create bridge of already added bridge
+    [Documentation]    This will add bridge to the config datastore
+    [Tags]    Southbound
+    ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_bridge.json
+    ${sample1}    Replace String    ${sample}    tcp:127.0.0.1:6633    tcp:${CONTROLLER}:6633
+    ${sample2}    Replace String    ${sample1}    127.0.0.1    ${MININET}
+    ${sample3}    Replace String    ${sample2}    br01    ${BRIDGE}
+    ${body}    Replace String    ${sample3}    61644    ${OVSDB_PORT}
+    Log    URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}
+    ${resp}    RequestsLibrary.Put    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}    data=${body}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Create Port of already added port in OVSDB
+    [Documentation]    This will add port/interface to the config datastore
+    [Tags]    Southbound
+    ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_port.json
+    ${sample1}    Replace String    ${sample}    vxlanport    vx1
+    ${body}    Replace String    ${sample1}    192.168.0.21    192.168.1.10
+    Log    URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/
+    ${resp}    RequestsLibrary.Put    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/    data=${body}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Get Config Topology with Bridge
+    [Documentation]    This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
+    [Tags]    Southbound
+    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${CONFIG_TOPO_API}    ${node_list}
+
+Modify the destination IP of Port
+    [Documentation]    This will modify the dst ip of existing port
+    [Tags]    Southbound
+    ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_port.json
+    ${sample1}    Replace String    ${sample}    vxlanport    vx1
+    ${body}    Replace String    ${sample1}    192.168.0.21    10.0.0.19
+    Log    URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/
+    ${resp}    RequestsLibrary.Put    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/    data=${body}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Create Port and attach to a Bridge
+    [Documentation]    This request will creates port/interface and attach it to the specific bridge
+    [Tags]    Southbound
+    ${body}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_port.json
+    Log    URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/
+    ${resp}    RequestsLibrary.Put    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/    data=${body}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Get Operational Topology with Port
+    [Documentation]    This request will fetch the operational topology after the Port is added to the bridge
+    [Tags]    Southbound
+    @{list}    Create List    ${BRIDGE}    vxlanport    vx1    10.0.0.19
+    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${list}
+
+Delete the Port1
+    [Documentation]    This request will delete the port node from the bridge node and data store.
+    [Tags]    Southbound
+    ${resp}    RequestsLibrary.Delete    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/
+    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+
+Delete the Port2
+    [Documentation]    This request will delete the port node from the bridge node and data store.
+    [Tags]    Southbound
+    ${resp}    RequestsLibrary.Delete    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/
+    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+
+Get Operational Topology after Deletion of Port
+    [Documentation]    This request will fetch the operational topology after the Port is deleted
+    [Tags]    Southbound
+    @{list}    Create List    vxlanport    vx1
+    Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
+
+Delete the Bridge
+    [Documentation]    This request will delete the bridge node from the config data store.
+    [Tags]    Southbound
+    ${resp}    RequestsLibrary.Delete    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}
+    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+
+Get Operational Topology after Deletion of Bridge
+    [Documentation]    This request will fetch the operational topology after the Bridge is deleted
+    [Tags]    Southbound
+    @{list}    Create List    ${BRIDGE}    vxlanport    vx1
+    Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
+
+Delete the OVSDB Node
+    [Documentation]    This request will delete the OVSDB node
+    [Tags]    Southbound
+    ${resp}    RequestsLibrary.Delete    session    ${SOUTHBOUND_CONFIG_API}
+    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+
+Get Operational Topology after Deletion of OVSDB Node
+    [Documentation]    This request will fetch the operational topology after the OVSDB node is deleted
+    [Tags]    Southbound
+    @{list}    Create List    ovsdb://${MININET}:${OVSDB_PORT}    ${BRIDGE}    vxlanport    vx1
+    Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
index 55f4660fde9877bab3b4341606f3c2bccada7ae1..b0e382c9c2690d4e4ea2229196c9bd56ddd5b5e5 100644 (file)
@@ -2,19 +2,24 @@
   "network-topology:node": [
         {
             "node-id": "ovsdb://127.0.0.1:61644/bridge/br01",
-             "ovsdb:bridge-name": "br01",
-             "ovsdb:datapath-id": "00:00:b2:ff:ff:25:f2:4b",
-             "ovsdb:protocol-entry": [
+            "ovsdb:bridge-name": "br01",
+            "ovsdb:protocol-entry": [
                 {
-                  "protocol": "ovsdb:ovsdb-bridge-protocol-openflow-13"
+                    "protocol": "ovsdb:ovsdb-bridge-protocol-openflow-13"
                 }
-              ],
-              "ovsdb:controller-entry": [
+            ],
+            "ovsdb:controller-entry": [
                 {
-                  "target": "tcp:127.0.0.1:6630"
+                    "target": "tcp:127.0.0.1:6633"
                 }
-              ],
-             "ovsdb:managed-by": "/network-topology:network-topology/network-topology:topology[network-topology:topology-id='ovsdb:1']/network-topology:node[network-topology:node-id='ovsdb://127.0.0.1:61644']"
+            ],
+            "ovsdb:bridge-other-configs": [
+                {
+                    "bridge-other-config-key": "datapath-id",
+                    "bridge-other-config-value": "0000000000000001"
+                }
+            ],
+            "ovsdb:managed-by": "/network-topology:network-topology/network-topology:topology[network-topology:topology-id='ovsdb:1']/network-topology:node[network-topology:node-id='ovsdb://127.0.0.1:61644']"
         }
     ]
 }
index 77bfbb2b2fe7db36203f4165314d93e074da95e5..2ec84beca19e6fe62e34051fc350fc202643be90 100644 (file)
@@ -1,25 +1,15 @@
 {
-    "network-topology:termination-point": [
-        {
-            "ovsdb:options": [
-                      {
-                          "ovsdb:option": "remote_ip",
-                          "ovsdb:value" : "10.10.11.11"
-                      }
-                         ],
-                "ovsdb:name": "vxlanport",
-                "ovsdb:interface-type": "ovsdb:interface-type-vxlan",
-                         "tp-id": "vxlanport",
-                 "vlan-tag": "1",
-                 "trunks": [
-                {
-                    "trunk": "2"
-                },
-                {
-                    "trunk": "3"
-                }
-             ],
-             "vlan-mode":"access"
-                }
-    ]
+   "network-topology:termination-point": [
+      {
+             "ovsdb:options": [
+                    {
+                  "ovsdb:option": "remote_ip",
+                  "ovsdb:value" : "192.168.0.21"
+                        }
+                        ],
+                   "ovsdb:interface-type": "ovsdb:interface-type-vxlan",
+                        "ovsdb:name": "vxlanport",
+                        "tp-id": "vxlanport"
+             }
+     ]
 }