Stop cloning when running vyos_vrouter 99/61999/2
authorCédric Ollivier <cedric.ollivier@orange.com>
Fri, 7 Sep 2018 21:15:25 +0000 (23:15 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Sat, 8 Sep 2018 11:53:25 +0000 (13:53 +0200)
It moves the clone operation into docker build instead.

Change-Id: I296005d8638510a999665d383a26c4fcd48897a6
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
docker/vnf/Dockerfile
functest/ci/config_functest.yaml
functest/opnfv_tests/vnf/router/cloudify_vrouter.yaml
functest/opnfv_tests/vnf/router/test_controller/function_test_exec.py
functest/opnfv_tests/vnf/router/utilvnf.py
functest/opnfv_tests/vnf/router/vrouter_base.py
requirements.txt

index d081ff1..9df7753 100644 (file)
@@ -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 && \
index 7e51ee7..557a67b 100644 (file)
@@ -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
 
index 649cd6c..2d98dff 100644 (file)
@@ -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'
index 9d484cb..0b8a69b 100644 (file)
@@ -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()
 
index 4bb277a..a54f6cb 100644 (file)
 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()
index fe3058f..e8a933f 100644 (file)
@@ -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)
 
index 3b82370..14515ba 100644 (file)
@@ -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