aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--docker/vnf/Dockerfile5
-rw-r--r--functest/ci/config_functest.yaml2
-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
-rw-r--r--requirements.txt1
7 files changed, 12 insertions, 40 deletions
diff --git a/docker/vnf/Dockerfile b/docker/vnf/Dockerfile
index d081ff17f..9df7753d0 100644
--- a/docker/vnf/Dockerfile
+++ b/docker/vnf/Dockerfile
@@ -47,6 +47,11 @@ RUN apk --no-cache add --update \
(cd /src/opnfv-vnf-vyos-blueprint && \
git fetch --tags https://github.com/oolorg/opnfv-vnf-vyos-blueprint.git $VROUTER_TAG && \
git checkout FETCH_HEAD) && \
+ mkdir -p /home/opnfv/functest/data/router && \
+ git init /home/opnfv/functest/data/router/opnfv-vnf-data && \
+ (cd /home/opnfv/functest/data/router/opnfv-vnf-data && \
+ git fetch --tags https://github.com/oolorg/opnfv-vnf-data.git $VROUTER_TAG && \
+ git checkout FETCH_HEAD) && \
git init /src/epc-requirements/abot_charm && \
(cd /src/epc-requirements/abot_charm && \
git fetch --tags https://github.com/RebacaInc/abot_charm.git $ABOT_CHARM && \
diff --git a/functest/ci/config_functest.yaml b/functest/ci/config_functest.yaml
index 7e51ee790..557a67b94 100644
--- a/functest/ci/config_functest.yaml
+++ b/functest/ci/config_functest.yaml
@@ -12,7 +12,7 @@ general:
functest_data: /home/opnfv/functest/data
ims_data: /home/opnfv/functest/data/ims/
refstack_data: /home/opnfv/functest/data/refstack
- router_data: /home/opnfv/functest/data/router/
+ router_data: /home/opnfv/functest/data/router/opnfv-vnf-data
functest_images: /home/opnfv/functest/images
rally_inst: /root/.rally
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)
diff --git a/requirements.txt b/requirements.txt
index 3b82370b4..14515ba8e 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -3,7 +3,6 @@
# process, which may cause wedges in the gate later.
pbr!=2.1.0,>=2.0.0 # Apache-2.0
PyYAML>=3.12 # MIT
-GitPython>=1.0.1 # BSD License (3 clause)
requests>=2.14.2 # Apache-2.0
robotframework>=3.0
scp