add vpnaas as a devstack plugin
and add new option into config for it (network extension in tempest.conf doesn't have vpnaas even if it's present) Change-Id: I64026c36fc47b860d1ee0b6deb1bfbc91522148c
This commit is contained in:
parent
65e9a0d57d
commit
0fd3eb2ead
|
@ -32,7 +32,7 @@ class CustomerGatewayTest(base.EC2TestCase):
|
|||
super(CustomerGatewayTest, cls).setUpClass()
|
||||
if not base.TesterStateHolder().get_vpc_enabled():
|
||||
raise cls.skipException('VPC is disabled')
|
||||
base.check_network_feature_enabled('vpnaas')
|
||||
base.check_vpnaas_enabled()
|
||||
|
||||
@decorators.idempotent_id('54a40b66-1675-44b1-938d-0cad2eb6afe4')
|
||||
def test_create_delete_customer_gateway(self):
|
||||
|
|
|
@ -458,7 +458,7 @@ class TagTest(base.EC2TestCase):
|
|||
|
||||
@testtools.skip("Some unknown bug. Will fix this later")
|
||||
@base.skip_without_vpc()
|
||||
@base.skip_without_network_feature('vpnaas')
|
||||
@base.skip_without_vpnaas_enabled()
|
||||
@decorators.idempotent_id('a0437171-81a1-4871-9b71-c7629b25c337')
|
||||
def test_tag_vpn_gateway(self):
|
||||
data = self.client.create_vpn_gateway(Type='ipsec.1')
|
||||
|
@ -476,7 +476,7 @@ class TagTest(base.EC2TestCase):
|
|||
|
||||
@testtools.skip("Some unknown bug. Will fix this later")
|
||||
@base.skip_without_vpc()
|
||||
@base.skip_without_network_feature('vpnaas')
|
||||
@base.skip_without_vpnaas_enabled()
|
||||
@decorators.idempotent_id('ecd343b4-f448-4990-880d-02a68febc9cf')
|
||||
def test_tag_vpn_connection(self):
|
||||
data = self.client.create_customer_gateway(
|
||||
|
|
|
@ -36,7 +36,7 @@ class VpnConnectionTest(base.EC2TestCase):
|
|||
super(VpnConnectionTest, cls).setUpClass()
|
||||
if not base.TesterStateHolder().get_vpc_enabled():
|
||||
raise cls.skipException('VPC is disabled')
|
||||
base.check_network_feature_enabled('vpnaas')
|
||||
base.check_vpnaas_enabled()
|
||||
|
||||
data = cls.client.create_customer_gateway(
|
||||
Type='ipsec.1', PublicIp=cls.CUSTOMER_GATEWAY_IP, BgpAsn=65000)
|
||||
|
|
|
@ -33,7 +33,7 @@ class VpnGatewayTest(base.EC2TestCase):
|
|||
super(VpnGatewayTest, cls).setUpClass()
|
||||
if not base.TesterStateHolder().get_vpc_enabled():
|
||||
raise cls.skipException('VPC is disabled')
|
||||
base.check_network_feature_enabled('vpnaas')
|
||||
base.check_vpnaas_enabled()
|
||||
|
||||
data = cls.client.create_vpc(CidrBlock=cls.VPC_CIDR)
|
||||
cls.vpc_id = data['Vpc']['VpcId']
|
||||
|
|
|
@ -241,22 +241,18 @@ def skip_without_vpc(*args, **kwargs):
|
|||
return decorator
|
||||
|
||||
|
||||
def check_network_feature_enabled(ext_name):
|
||||
if hasattr(CONF, 'network_feature_enabled'):
|
||||
ext_list = CONF.network_feature_enabled.api_extensions
|
||||
else:
|
||||
ext_list = ['all']
|
||||
if 'all' not in ext_list and ext_name not in ext_list:
|
||||
msg = ("Skipped network test as %s is not available" % ext_name)
|
||||
def check_vpnaas_enabled():
|
||||
if not CONF.aws.vpnaas_enabled:
|
||||
msg = ("Skipped VPN test as vpnaas is not available")
|
||||
raise testtools.TestCase.skipException(msg)
|
||||
|
||||
|
||||
def skip_without_network_feature(ext_name, *args, **kwargs):
|
||||
def skip_without_vpnaas_enabled(*args, **kwargs):
|
||||
"""A decorator useful to skip tests without specified network extension."""
|
||||
def decorator(f):
|
||||
@functools.wraps(f)
|
||||
def wrapper(self, *func_args, **func_kwargs):
|
||||
check_network_feature_enabled(ext_name)
|
||||
check_vpnaas_enabled()
|
||||
return f(self, *func_args, **func_kwargs)
|
||||
return wrapper
|
||||
return decorator
|
||||
|
|
|
@ -39,7 +39,6 @@ class ConfigPrivate(object):
|
|||
if config_opts.aws_group.name in cfg.CONF:
|
||||
self.aws = cfg.CONF.aws
|
||||
self.service_available = cfg.CONF.service_available
|
||||
self.network_feature_enabled = cfg.CONF['network-feature-enabled']
|
||||
return
|
||||
|
||||
# Environment variables override defaults...
|
||||
|
|
|
@ -93,4 +93,7 @@ AWSGroup = [
|
|||
cfg.BoolOpt('run_ssh',
|
||||
default=True,
|
||||
help='Can block all tests that wants to ssh into instance.'),
|
||||
cfg.BoolOpt('vpnaas_enabled',
|
||||
default=False,
|
||||
help='Enable VPN-related tests'),
|
||||
]
|
||||
|
|
|
@ -48,8 +48,9 @@ class VpnTest(scenario_base.BaseScenarioTest):
|
|||
super(VpnTest, cls).setUpClass()
|
||||
if not base.TesterStateHolder().get_vpc_enabled():
|
||||
raise cls.skipException('VPC is disabled')
|
||||
base.check_network_feature_enabled('vpnaas')
|
||||
base.check_vpnaas_enabled()
|
||||
|
||||
@testtools.skip("Some unknown bug. Will fix this later")
|
||||
@decorators.idempotent_id('63c2ac38-cfee-45d3-b765-c9b43859660d')
|
||||
def test_vpn_routing(self):
|
||||
vpc_id, _subnet_id = self.create_vpc_and_subnet('10.42.0.0/20')
|
||||
|
|
Loading…
Reference in New Issue