Create Neutron ports, Veriy Neutron Ports tests are added 62/41962/2
authorMahendar Yavagani <mahendar.yavagani@gmail.com>
Mon, 18 Jul 2016 18:43:56 +0000 (11:43 -0700)
committerJamo Luhrsen <jluhrsen@redhat.com>
Tue, 19 Jul 2016 05:12:21 +0000 (05:12 +0000)
Change-Id: I824a4ce5cb882e4a25154533e1dc1831952517a8
Signed-off-by: Mahendar Yavagani <mahendar.yavagani@gmail.com>
csit/libraries/OpenStackOperations.robot
csit/suites/openstack/vpnservice/basic_vpnservice.robot
csit/variables/Variables.py

index d0af7e3904b9c15cd035ad91a306205ddade682b..e48dd3eb4a0679f9df44cb047b9a4a5978de31d2 100644 (file)
@@ -58,6 +58,16 @@ Create SubNet
     Log    ${output}
     Should Contain    ${output}    Created a new subnet
 
+Create Port
+    [Arguments]    ${network_name}    ${port_name}
+    [Documentation]    Create Port with neutron request.
+    ${devstack_conn_id}=       Get ControlNode Connection
+    Switch Connection    ${devstack_conn_id}
+    ${output}=    Write Commands Until Prompt    neutron -v port-create ${network_name} --name ${port_name}    30s
+    Close Connection
+    Log    ${output}
+    Should Contain    ${output}    Created a new port
+
 Verify Gateway Ips
     [Documentation]    Verifies the Gateway Ips with dump flow.
     ${output}=    Write Commands Until Prompt    sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
index 2dbe27fb3c708525c059cfe6eea17c94c1294cd6..cca32b066b1953d9d2b17a27bd62bf494ac01091 100644 (file)
@@ -10,14 +10,19 @@ Library           RequestsLibrary
 Resource          ../../../libraries/Utils.robot
 Resource          ../../../libraries/OpenStackOperations.robot
 Resource          ../../../libraries/DevstackUtils.robot
+Variables         ../../../variables/Variables.py
 
 *** Variables ***
-${net-1}    NET10
-${net-2}    NET20
-${subnet-1}    SUBNET1
-${subnet-2}    SUBNET2
-${subnet-1-cidr}    10.1.1.0/24
-${subnet-2-cidr}    20.1.1.0/24
+${net_1}    NET10
+${net_2}    NET20
+${subnet_1}    SUBNET1
+${subnet_2}    SUBNET2
+${subnet_1_cidr}    10.1.1.0/24
+${subnet_2_cidr}    20.1.1.0/24
+${port_1}    PORT1
+${port_2}    PORT2
+${port_3}    PORT3
+${port_4}    PORT4
 
 *** Test Cases ***
 Verify Tunnel Creation
@@ -29,21 +34,35 @@ Verify Tunnel Creation
     ...    test case is critical to run, and if it fails we would be dead in the water for the rest of the suite,
     ...    we should move it to Suite Setup so that nothing else will run and waste time in a broken environment.
 
+#TC1
 Create Neutron Networks
     [Documentation]    Create two networks
-    Create Network    ${net-1}    --provider:network_type local
-    Create Network    ${net-2}    --provider:network_type local
+    Create Network    ${net_1}    --provider:network_type local
+    Create Network    ${net_2}    --provider:network_type local
     List Networks
 
 Create Neutron Subnets
     [Documentation]    Create two subnets for previously created networks
-    Create SubNet    ${net-1}    {subnet-1}    ${subnet-1-cidr}
-    Create SubNet    ${net-2}    {subnet-2}    ${subnet-2-cidr}
+    Create SubNet    ${net_1}    ${subnet_1}    ${subnet_1_cidr}
+    Create SubNet    ${net_2}    ${subnet_2}    ${subnet_2_cidr}
     List Subnets
 
+Create Neutron Ports
+    [Documentation]    Create four ports under previously created subnets
+    Create Port    ${net_1}    ${port_1}
+    Create Port    ${net_1}    ${port_2}
+    Create Port    ${net_2}    ${port_3}
+    Create Port    ${net_2}    ${port_4}
+
+Check OpenDaylight Neutron Ports
+    [Documentation]    Checking OpenDaylight Neutron API for known ports
+    ${resp}    RequestsLibrary.Get Request    session    ${NEUTRON_PORTS_API}
+    Log    ${resp.content}
+    Should be Equal As Strings    ${resp.status_code}    200
+
 *** Keywords ***
 Basic Vpnservice Suite Setup
     Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
 
 Basic Vpnservice Suite Teardown
-    Delete All Sessions
\ No newline at end of file
+    Delete All Sessions
index 3af1310696bc94ca79eccb77f36f8ffaf90ee14a..41857fc6d259cf19226472e85d73d15999778514 100644 (file)
@@ -170,6 +170,7 @@ LFM_SB_RPC_API = "/restconf/operations/odl-lisp-sb"
 # Neutron
 NEUTRON_NB_API = '/controller/nb/v2/neutron'
 NEUTRON_NETWORKS_API = NEUTRON_NB_API + '/' + 'networks'
+NEUTRON_PORTS_API = NEUTRON_NB_API + '/' + 'ports'
 NEUTRON_ROUTERS_API = NEUTRON_NB_API + '/' + 'routers'
 OSREST = '/v2.0/networks'
 KARAF_HOME = '${WORKSPACE}${/}${BUNDLEFOLDER}'