aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/vnf
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-09-07 23:15:25 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2018-09-08 13:53:25 +0200
commit2e7f66734394dc5e749ef9ac95e46a8ded9fb2c9 (patch)
tree45d1555c4afad366ba2354ea238207c4330ba9ab /functest/opnfv_tests/vnf
parent98f3bf16722e5e718130f960910d64bc76951e3b (diff)
Stop cloning when running vyos_vrouter
It moves the clone operation into docker build instead. Change-Id: I296005d8638510a999665d383a26c4fcd48897a6 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/opnfv_tests/vnf')
-rw-r--r--functest/opnfv_tests/vnf/router/cloudify_vrouter.yaml3
-rw-r--r--functest/opnfv_tests/vnf/router/test_controller/function_test_exec.py11
-rw-r--r--functest/opnfv_tests/vnf/router/utilvnf.py27
-rw-r--r--functest/opnfv_tests/vnf/router/vrouter_base.py3
4 files changed, 6 insertions, 38 deletions
diff --git a/functest/opnfv_tests/vnf/router/cloudify_vrouter.yaml b/functest/opnfv_tests/vnf/router/cloudify_vrouter.yaml
index 649cd6ccd..2d98dffa5 100644
--- a/functest/opnfv_tests/vnf/router/cloudify_vrouter.yaml
+++ b/functest/opnfv_tests/vnf/router/cloudify_vrouter.yaml
@@ -3,9 +3,6 @@ tenant_images:
cloudify_manager_4.0:
/home/opnfv/functest/images/cloudify-manager-premium-4.0.1.qcow2
vyos1.1.7: /home/opnfv/functest/images/vyos-1.1.7.img
-test_data:
- url: 'https://github.com/oolorg/opnfv-vnf-data.git'
- branch: 'fraser'
orchestrator:
name: cloudify
version: '4.0'
diff --git a/functest/opnfv_tests/vnf/router/test_controller/function_test_exec.py b/functest/opnfv_tests/vnf/router/test_controller/function_test_exec.py
index 9d484cb56..0b8a69b73 100644
--- a/functest/opnfv_tests/vnf/router/test_controller/function_test_exec.py
+++ b/functest/opnfv_tests/vnf/router/test_controller/function_test_exec.py
@@ -12,6 +12,7 @@
"""vrouter function test execution module"""
import logging
+import os
import time
import yaml
@@ -31,11 +32,11 @@ class FunctionTestExec(object):
credentials = util_info["credentials"]
self.vnf_ctrl = VnfController(util_info)
- test_cmd_map_file = open(self.util.vnf_data_dir +
- self.util.opnfv_vnf_data_dir +
- self.util.command_template_dir +
- self.util.test_cmd_map_yaml_file,
- 'r')
+ test_cmd_map_file = open(
+ os.path.join(
+ self.util.vnf_data_dir, self.util.command_template_dir,
+ self.util.test_cmd_map_yaml_file),
+ 'r')
self.test_cmd_map_yaml = yaml.safe_load(test_cmd_map_file)
test_cmd_map_file.close()
diff --git a/functest/opnfv_tests/vnf/router/utilvnf.py b/functest/opnfv_tests/vnf/router/utilvnf.py
index 4bb277a8d..a54f6cb0b 100644
--- a/functest/opnfv_tests/vnf/router/utilvnf.py
+++ b/functest/opnfv_tests/vnf/router/utilvnf.py
@@ -14,12 +14,9 @@
import json
import logging
import os
-import pkg_resources
import requests
import yaml
-from git import Repo
-
from functest.utils import config
RESULT_SPRIT_INDEX = {
@@ -53,14 +50,12 @@ class Utilvnf(object): # pylint: disable=too-many-instance-attributes
def __init__(self):
self.vnf_data_dir = getattr(config.CONF, 'dir_router_data')
- self.opnfv_vnf_data_dir = "opnfv-vnf-data/"
self.command_template_dir = "command_template/"
self.test_scenario_yaml = "test_scenario.yaml"
test_env_config_yaml_file = "test_env_config.yaml"
self.test_cmd_map_yaml_file = "test_cmd_map.yaml"
self.test_env_config_yaml = os.path.join(
self.vnf_data_dir,
- self.opnfv_vnf_data_dir,
test_env_config_yaml_file)
self.blueprint_dir = "opnfv-vnf-vyos-blueprint/"
@@ -69,28 +64,6 @@ class Utilvnf(object): # pylint: disable=too-many-instance-attributes
if not os.path.exists(self.vnf_data_dir):
os.makedirs(self.vnf_data_dir)
- case_dir = pkg_resources.resource_filename(
- 'functest', 'opnfv_tests/vnf/router')
-
- config_file_name = getattr(
- config.CONF, 'vnf_{}_config'.format("vyos_vrouter"))
-
- config_file = os.path.join(case_dir, config_file_name)
-
- with open(config_file) as file_fd:
- vrouter_config_yaml = yaml.safe_load(file_fd)
- file_fd.close()
-
- test_data = vrouter_config_yaml.get("test_data")
-
- self.logger.debug("Downloading the test data.")
- vrouter_data_path = self.vnf_data_dir + self.opnfv_vnf_data_dir
-
- if not os.path.exists(vrouter_data_path):
- Repo.clone_from(test_data['url'],
- vrouter_data_path,
- branch=test_data['branch'])
-
with open(self.test_env_config_yaml) as file_fd:
test_env_config_yaml = yaml.safe_load(file_fd)
file_fd.close()
diff --git a/functest/opnfv_tests/vnf/router/vrouter_base.py b/functest/opnfv_tests/vnf/router/vrouter_base.py
index fe3058f01..e8a933ff5 100644
--- a/functest/opnfv_tests/vnf/router/vrouter_base.py
+++ b/functest/opnfv_tests/vnf/router/vrouter_base.py
@@ -32,15 +32,12 @@ class VrouterOnBoardingBase(object):
self.logger = logging.getLogger(__name__)
self.case_dir = pkg_resources.resource_filename(
'functest', 'opnfv_tests/vnf/router')
- self.data_dir = getattr(config.CONF, 'dir_router_data')
self.result_dir = os.path.join(
getattr(config.CONF, 'dir_results'), case_name)
self.util = util
self.util_info = util_info
self.vnf_list = []
- if not os.path.exists(self.data_dir):
- os.makedirs(self.data_dir)
if not os.path.exists(self.result_dir):
os.makedirs(self.result_dir)