neutron-vpnaas fix for 'tox -e api' test
A VPNaaS test case for 'tox -e api' was failing as the test_vpnaas.py code catching a tempest_lib.NotFound but the tempest code is throwing a tempest.lib.NotFound causing a Mismatch. ============================== Failed 1 tests - output below: ============================== neutron_vpnaas.tests.api.test_vpnaas.VPNaaSTestJSON. test_create_update_delete_ipsec_policy[smoke] Captured traceback: ~~~~~~~~~~~~~~~~~~~ Traceback (most recent call last): File "neutron_vpnaas/tests/api/test_vpnaas.py", line 312, in test_create_update_delete_ipsec_policy Fix was to change to tempest.lib, as recommended in: /usr/local/lib/python2.7/dist-packages/tempest_lib/__init__.py:28: DeprecationWarning: tempest-lib is deprecated for future bug-fixes and code changes in favor of tempest. Please change your imports from tempest_lib to tempest.lib DeprecationWarning) Fix base.py for same issue, plus clean up some obvious code issues like a 'self' for a class method and indentation while in there. And since bash not my default shell, fix tox_install.sh to use bash as otherwise get error. opt/stack/neutron-vpnaas/tools/tox_install.sh: 19: /opt/stack/neutron-vpnaas/tools/tox_install.sh: Bad substitution Change-Id: I2ced6fd5cf9cc8a6972e6c937e1da4a0fc0236f4
This commit is contained in:
parent
97282700b7
commit
946d232e05
|
@ -1,5 +1,5 @@
|
|||
# Copyright 2012 OpenStack Foundation
|
||||
# Copyright 2016 Hewlett Packard Enterprise Development Company
|
||||
# Copyright 2016 Hewlett Packard Enterprise Development Company LP
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
|
@ -16,9 +16,9 @@
|
|||
|
||||
import netaddr
|
||||
from oslo_log import log as logging
|
||||
from tempest.lib.common.utils import data_utils
|
||||
from tempest.lib import exceptions as lib_exc
|
||||
from tempest import test
|
||||
from tempest_lib.common.utils import data_utils
|
||||
from tempest_lib import exceptions as lib_exc
|
||||
|
||||
from neutron.tests.tempest import config
|
||||
|
||||
|
@ -62,16 +62,16 @@ class BaseNetworkTest(test.BaseTestCase):
|
|||
def get_client_manager(cls, credential_type=None, roles=None,
|
||||
force_new=None):
|
||||
manager = test.BaseTestCase.get_client_manager(
|
||||
credential_type=credential_type,
|
||||
roles=roles,
|
||||
force_new=force_new)
|
||||
credential_type=credential_type,
|
||||
roles=roles,
|
||||
force_new=force_new)
|
||||
# Neutron uses a different clients manager than the one in the Tempest
|
||||
return clients.Manager(manager.credentials)
|
||||
|
||||
@classmethod
|
||||
def skip_checks(cls):
|
||||
super(BaseNetworkTest, cls).skip_checks()
|
||||
# Create no network resources for these test.
|
||||
# Create no network resources for these tests.
|
||||
if not CONF.service_available.neutron:
|
||||
raise cls.skipException("Neutron support is required")
|
||||
if cls._ip_version == 6 and not CONF.network_feature_enabled.ipv6:
|
||||
|
@ -112,7 +112,7 @@ class BaseNetworkTest(test.BaseTestCase):
|
|||
vpnservice['id'])
|
||||
|
||||
@classmethod
|
||||
def _try_delete_resource(self, delete_callable, *args, **kwargs):
|
||||
def _try_delete_resource(cls, delete_callable, *args, **kwargs):
|
||||
"""Cleanup resources in case of test-failure
|
||||
|
||||
Some resources are explicitly deleted by the test.
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
# under the License.
|
||||
|
||||
import six
|
||||
from tempest.lib.common.utils import data_utils
|
||||
from tempest.lib import exceptions as lib_exc
|
||||
from tempest import test
|
||||
from tempest_lib.common.utils import data_utils
|
||||
from tempest_lib import exceptions as lib_exc
|
||||
|
||||
from neutron.tests.tempest import config
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Many of neutron's repos suffer from the problem of depending on neutron,
|
||||
# but it not existing on pypi.
|
||||
|
|
Loading…
Reference in New Issue