Networking-L2Gateway CI fails

Due to the removal of tempest test file from neutron

Change-Id: Iebb93d4f161cd114ea2d44389e39057361b40cf5
Closes-bug: 1540760
changes/43/275043/6
Ashish Gupta 7 years ago committed by ashish-kumar-gupta
parent d0ba851eb7
commit 61f74e1422

@ -13,10 +13,6 @@
# License for the specific language governing permissions and limitations
# under the License.
from networking_l2gw.tests.tempest import config
CONF = config.CONF
SEGMENTATION_ID_DELIMITER = "#"
INTERFACE_SEG_ID_DELIMITER = "|"
DEVICE_INTERFACE_DELIMITER = "::"

@ -13,17 +13,20 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import test
from neutron.tests.api import base
from neutron.tests.tempest import test
from tempest_lib.common.utils import data_utils
from networking_l2gw.tests.api import base_l2gw
from networking_l2gw.tests.tempest import config
from oslo_config import cfg
import random
CONF = config.CONF
CONF = cfg.CONF
class L2GatewayExtensionTestJSON(base.BaseAdminNetworkTest):
@ -45,9 +48,10 @@ class L2GatewayExtensionTestJSON(base.BaseAdminNetworkTest):
@classmethod
def resource_setup(cls):
config.register_options()
super(L2GatewayExtensionTestJSON, cls).resource_setup()
# At least one switch detail should be provided to run the tests
if (len(CONF.network.l2gw_switch) < 0):
if (len(CONF.L2GW.l2gw_switch) < 0):
msg = ('At least one switch detail must be defined.')
raise cls.skipException(msg)
if not test.is_extension_enabled('l2gateway', 'network'):
@ -58,7 +62,7 @@ class L2GatewayExtensionTestJSON(base.BaseAdminNetworkTest):
def test_create_show_list_update_delete_l2gateway(self):
# Create an L2Gateway
gw_name = data_utils.rand_name('l2gw')
devices = base_l2gw.get_l2gw_body(CONF.network.l2gw_switch)["devices"]
devices = base_l2gw.get_l2gw_body(CONF.L2GW.l2gw_switch)["devices"]
body = self.admin_client.create_l2_gateway(
name=gw_name, devices=devices)
l2_gateway = body['l2_gateway']
@ -91,7 +95,7 @@ class L2GatewayExtensionTestJSON(base.BaseAdminNetworkTest):
self.addCleanup(self.admin_client.delete_network, net_id)
# Create an L2Gateway
gw_name = data_utils.rand_name('l2gw')
devices = base_l2gw.get_l2gw_body(CONF.network.l2gw_switch)["devices"]
devices = base_l2gw.get_l2gw_body(CONF.L2GW.l2gw_switch)["devices"]
l2_gw_body = self.admin_client.create_l2_gateway(
name=gw_name, devices=devices)
l2_gw_id = l2_gw_body['l2_gateway']['id']
@ -113,7 +117,7 @@ class L2GatewayExtensionTestJSON(base.BaseAdminNetworkTest):
def test_create_l2gw_conn_with_segid_when_l2gw_created_without_segid(self):
# Create an L2Gateway
gw_name = data_utils.rand_name('l2gw')
devices = base_l2gw.get_l2gw_body(CONF.network.l2gw_switch)["devices"]
devices = base_l2gw.get_l2gw_body(CONF.L2GW.l2gw_switch)["devices"]
if devices[0]['interfaces'][0]['segmentation_id']:
seg_id = devices[0]['interfaces'][0]['segmentation_id'][0]
devices[0]['interfaces'][0].pop('segmentation_id')

@ -14,11 +14,13 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import test
from neutron.tests.api import base
from neutron.tests.tempest import test
from networking_l2gw.tests.api import base_l2gw
from networking_l2gw.tests.tempest import config
from oslo_config import cfg
from random import randint
@ -26,7 +28,7 @@ from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
CONF = config.CONF
CONF = cfg.CONF
class L2GatewaysNegativeTestJSON(base.BaseNetworkTest):
@ -36,7 +38,7 @@ class L2GatewaysNegativeTestJSON(base.BaseNetworkTest):
def resource_setup(cls):
super(L2GatewaysNegativeTestJSON, cls).resource_setup()
# At least one switch detail should be provided to run the tests
if (len(CONF.network.l2gw_switch) < 0):
if (len(CONF.L2GW.l2gw_switch) < 0):
msg = ('At least one switch detail must be defined.')
raise cls.skipException(msg)
if not test.is_extension_enabled('l2gateway', 'network'):
@ -47,7 +49,7 @@ class L2GatewaysNegativeTestJSON(base.BaseNetworkTest):
@test.idempotent_id('b301d83d-3af3-4712-86dc-a6824e9b14e5')
def test_create_l2gateway_non_admin_user(self):
gw_name = data_utils.rand_name('l2gw')
devices = base_l2gw.get_l2gw_body(CONF.network.l2gw_switch)["devices"]
devices = base_l2gw.get_l2gw_body(CONF.L2GW.l2gw_switch)["devices"]
self.assertRaises(lib_exc.Forbidden,
self.client.create_l2_gateway,
name=gw_name, devices=devices)
@ -117,7 +119,7 @@ class L2GatewaysNegativeAdminTestJSON(base.BaseAdminNetworkTest):
self.addCleanup(self.admin_client.delete_network, net_id)
# Create an L2Gateway
gw_name = data_utils.rand_name('l2gw')
devices = base_l2gw.get_l2gw_body(CONF.network.l2gw_switch)["devices"]
devices = base_l2gw.get_l2gw_body(CONF.L2GW.l2gw_switch)["devices"]
body = self.admin_client.create_l2_gateway(
name=gw_name, devices=devices)
l2_gateway = body['l2_gateway']
@ -221,7 +223,7 @@ class L2GatewaysNegativeAdminTestJSON(base.BaseAdminNetworkTest):
def test_create_l2gw_connection_with_invalid_network_name(self):
# Create an L2Gateway
gw_name = data_utils.rand_name('l2gw')
devices = base_l2gw.get_l2gw_body(CONF.network.l2gw_switch)["devices"]
devices = base_l2gw.get_l2gw_body(CONF.L2GW.l2gw_switch)["devices"]
body = self.admin_client.create_l2_gateway(
name=gw_name, devices=devices)
l2_gateway = body['l2_gateway']
@ -239,7 +241,7 @@ class L2GatewaysNegativeAdminTestJSON(base.BaseAdminNetworkTest):
def test_update_gateway_with_invalid_device_name(self):
# Create an L2Gateway
gw_name = data_utils.rand_name('l2gw')
devices = base_l2gw.get_l2gw_body(CONF.network.l2gw_switch)["devices"]
devices = base_l2gw.get_l2gw_body(CONF.L2GW.l2gw_switch)["devices"]
body = self.admin_client.create_l2_gateway(
name=gw_name, devices=devices)
l2_gateway = body['l2_gateway']
@ -256,7 +258,7 @@ class L2GatewaysNegativeAdminTestJSON(base.BaseAdminNetworkTest):
def test_create_l2gw_and_l2gw_connection_both_without_seg_id(self):
# Create an L2Gateway
gw_name = data_utils.rand_name('l2gw')
devices = base_l2gw.get_l2gw_body(CONF.network.l2gw_switch)["devices"]
devices = base_l2gw.get_l2gw_body(CONF.L2GW.l2gw_switch)["devices"]
if devices[0]['interfaces'][0]['segmentation_id']:
devices[0]['interfaces'][0].pop('segmentation_id')
body = self.admin_client.create_l2_gateway(

File diff suppressed because it is too large Load Diff

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Many of neutron's repos suffer from the problem of depending on neutron,
# but it not existing on pypi.

@ -38,12 +38,13 @@ builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
[testenv:api]
# This must be set manually in your environment until
# a new release of tox fixes the issues with setenv
setenv = OS_TEST_PATH=./networking_l2gw/tests/api
TEMPEST_CONFIG_DIR={env:TEMPEST_CONFIG_DIR:/opt/stack/tempest/etc}
OS_TEST_API_WITH_REST=1
OS_TEST_TIMEOUT=90
deps =
{[testenv]deps}
git+https://git.openstack.org/openstack/tempest#egg=tempest
[hacking]
import_exceptions = networking_l2gw._i18n

Loading…
Cancel
Save