aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCedric Ollivier <cedric.ollivier@orange.com>2017-10-03 07:58:47 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-10-03 07:58:47 +0000
commitbce23e6c880c65cd307bc43d84ebbe4f9a7a8be8 (patch)
tree9b8108357a976da4010aee619f64c2ae7b451eae
parentb9745b8a5e2fe6400a68372eee8f7b442206fe5f (diff)
parenteb852423006e1c4934e40f38e44e6c16b20e56bc (diff)
Merge "Create a router in both vping scenarii" into stable/euphrates
-rw-r--r--functest/opnfv_tests/openstack/vping/vping_base.py16
-rw-r--r--functest/opnfv_tests/openstack/vping/vping_ssh.py20
2 files changed, 17 insertions, 19 deletions
diff --git a/functest/opnfv_tests/openstack/vping/vping_base.py b/functest/opnfv_tests/openstack/vping/vping_base.py
index 1a2378775..e719145bf 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')
diff --git a/functest/opnfv_tests/openstack/vping/vping_ssh.py b/functest/opnfv_tests/openstack/vping/vping_ssh.py
index f94d20b20..1a04ad023 100644
--- a/functest/opnfv_tests/openstack/vping/vping_ssh.py
+++ b/functest/opnfv_tests/openstack/vping/vping_ssh.py
@@ -20,7 +20,6 @@ import pkg_resources
from functest.core.testcase import TestCase
from functest.energy import energy
-from functest.opnfv_tests.openstack.snaps import snaps_utils
from functest.opnfv_tests.openstack.vping import vping_base
from functest.utils.constants import CONST
from snaps.openstack.create_instance import FloatingIpSettings, \
@@ -28,7 +27,6 @@ from snaps.openstack.create_instance import FloatingIpSettings, \
from snaps.openstack.create_keypairs import KeypairSettings
from snaps.openstack.create_network import PortSettings
-from snaps.openstack.create_router import RouterSettings
from snaps.openstack.create_security_group import Direction, Protocol, \
SecurityGroupSettings, SecurityGroupRuleSettings
from snaps.openstack.utils import deploy_utils
@@ -51,8 +49,6 @@ class VPingSSH(vping_base.VPingBase):
self.kp_name = CONST.__getattribute__('vping_keypair_name') + self.guid
self.kp_priv_file = CONST.__getattribute__('vping_keypair_priv_file')
self.kp_pub_file = CONST.__getattribute__('vping_keypair_pub_file')
- self.router_name = CONST.__getattribute__(
- 'vping_router_name') + self.guid
self.sg_name = CONST.__getattribute__('vping_sg_name') + self.guid
self.sg_desc = CONST.__getattribute__('vping_sg_desc')
@@ -77,20 +73,6 @@ class VPingSSH(vping_base.VPingBase):
public_filepath=self.kp_pub_file))
self.creators.append(kp_creator)
- # Creating router to external network
- log = "Creating router with name: '%s'" % self.router_name
- self.logger.info(log)
- net_set = self.network_creator.network_settings
- sub_set = [net_set.subnet_settings[0].name]
- ext_net_name = snaps_utils.get_ext_net_name(self.os_creds)
- router_creator = deploy_utils.create_router(
- self.os_creds,
- RouterSettings(
- name=self.router_name,
- external_gateway=ext_net_name,
- internal_subnets=sub_set))
- self.creators.append(router_creator)
-
# Creating Instance 1
port1_settings = PortSettings(
name=self.vm1_name + '-vPingPort',
@@ -129,7 +111,7 @@ class VPingSSH(vping_base.VPingBase):
floating_ip_settings=[FloatingIpSettings(
name=self.vm2_name + '-FIPName',
port_name=port2_settings.name,
- router_name=router_creator.router_settings.name)])
+ router_name=self.router_creator.router_settings.name)])
log = ("Creating VM 2 instance with name: '%s'"
% instance2_settings.name)