aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/openstack/vping/vping_base.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2017-10-03 00:27:36 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2017-10-03 00:33:08 +0200
commita691a8c2868d3f8af531e0bff513023c3a704aaf (patch)
tree58351da03929bc39468b921554016dcb612f089c /functest/opnfv_tests/openstack/vping/vping_base.py
parente36a14f6db0bc5ac93469bb553810de506f29bef (diff)
Create a router in both vping scenarii
It fixes vping_userdata as it allows getting metadata due to the gateway defined for the subnet. It could be noted that DHCP can add the route needed if no gateway is defined and if force_metadata is set in dhcp_agent.ini. Change-Id: Ia62e0f00e3d2caee6262dd9cd9966d1f21fe40d5 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/opnfv_tests/openstack/vping/vping_base.py')
-rw-r--r--functest/opnfv_tests/openstack/vping/vping_base.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/functest/opnfv_tests/openstack/vping/vping_base.py b/functest/opnfv_tests/openstack/vping/vping_base.py
index 8b622e1c..a8525a38 100644
--- a/functest/opnfv_tests/openstack/vping/vping_base.py
+++ b/functest/opnfv_tests/openstack/vping/vping_base.py
@@ -13,11 +13,13 @@ import time
import uuid
from functest.core import testcase
+from functest.opnfv_tests.openstack.snaps import snaps_utils
from functest.utils.constants import CONST
from snaps.openstack import create_flavor
from snaps.openstack.create_flavor import FlavorSettings, OpenStackFlavor
from snaps.openstack.create_network import NetworkSettings, SubnetSettings
+from snaps.openstack.create_router import RouterSettings
from snaps.openstack.tests import openstack_tests
from snaps.openstack.utils import deploy_utils
@@ -62,6 +64,8 @@ class VPingBase(testcase.TestCase):
if CONST.__getattribute__('vping_unique_names'):
self.guid = '-' + str(uuid.uuid4())
+ self.router_name = CONST.__getattribute__(
+ 'vping_router_name') + self.guid
self.vm1_name = CONST.__getattribute__('vping_vm_name_1') + self.guid
self.vm2_name = CONST.__getattribute__('vping_vm_name_2') + self.guid
@@ -136,6 +140,18 @@ class VPingBase(testcase.TestCase):
cidr=private_subnet_cidr)]))
self.creators.append(self.network_creator)
+ # Creating router to external network
+ log = "Creating router with name: '%s'" % self.router_name
+ self.logger.info(log)
+ ext_net_name = snaps_utils.get_ext_net_name(self.os_creds)
+ self.router_creator = deploy_utils.create_router(
+ self.os_creds,
+ RouterSettings(
+ name=self.router_name,
+ external_gateway=ext_net_name,
+ internal_subnets=[private_subnet_name]))
+ self.creators.append(self.router_creator)
+
self.logger.info(
"Creating flavor with name: '%s'" % self.flavor_name)
scenario = CONST.__getattribute__('DEPLOY_SCENARIO')