[CVP] Add ext_net parameter
Change-Id: Ie0d80d86b6d527f5593b9525cf22bc8343b84839
Related-PROD: PROD-26972
diff --git a/test_set/cvp-spt/global_config.yaml b/test_set/cvp-spt/global_config.yaml
index f55a2a6..9a8e738 100644
--- a/test_set/cvp-spt/global_config.yaml
+++ b/test_set/cvp-spt/global_config.yaml
@@ -23,8 +23,9 @@
skipped_nodes: []
# example for Jenkins: networks=net1,net2
networks: "10.101.0.0/24"
+external_network: ''
HW_NODES: []
CMP_HOSTS: []
nova_timeout: 30
iperf_prep_string: "sudo /bin/bash -c 'echo \"91.189.88.161 archive.ubuntu.com\" >> /etc/hosts'"
-IMAGE_SIZE_MB: 2000
\ No newline at end of file
+IMAGE_SIZE_MB: 2000
diff --git a/test_set/cvp-spt/utils/os_client.py b/test_set/cvp-spt/utils/os_client.py
index c17617f..fb84265 100644
--- a/test_set/cvp-spt/utils/os_client.py
+++ b/test_set/cvp-spt/utils/os_client.py
@@ -9,7 +9,7 @@
import os
import random
import time
-
+import utils
class OfficialClientManager(object):
"""Manager that provides access to the official python clients for
@@ -241,15 +241,18 @@
return net
def get_external_network(self):
- networks = [
- net for net in self.os_clients.network.list_networks()["networks"]
- if net["admin_state_up"] and net["router:external"] and
- len(net["subnets"])
- ]
- if networks:
- ext_net = networks[0]
- else:
- ext_net = self.create_fake_external_network()
+ config = utils.get_configuration()
+ ext_net = config.get('external_network') or ''
+ if not ext_net:
+ networks = [
+ net for net in self.os_clients.network.list_networks()["networks"]
+ if net["admin_state_up"] and net["router:external"] and
+ len(net["subnets"])
+ ]
+ if networks:
+ ext_net = networks[0]
+ else:
+ ext_net = self.create_fake_external_network()
return ext_net
def create_flavor(self, name, ram=256, vcpus=1, disk=2):