Change HEAT package from .tag.gz to be .zip 17/67517/2
authorxudan <xudan16@huawei.com>
Wed, 10 Apr 2019 09:27:26 +0000 (05:27 -0400)
committerxudan <xudan16@huawei.com>
Fri, 26 Apr 2019 08:04:17 +0000 (04:04 -0400)
As Trevor Lovett suggests, the Heat file is a zip file. So users need to package
it different only for Dovetail testing.
It will be better to change it to be .zip to keep it the same as what they do.

JIRA: DOVETAIL-770

Change-Id: I5338720c5e1363081e1f8cdce33391a969f1cd97
Signed-off-by: xudan <xudan16@huawei.com>
docs/testing/user/userguide/vnf_test_guide.rst
dovetail/report.py
etc/conf/onap-vvp_config.yml
etc/userconfig/env_config.sh.onap.sample

index 1e269fb..e35d418 100644 (file)
@@ -104,13 +104,13 @@ For TOSCA based VNFs, it should look like this:
 
    $ cat ${DOVETAIL_HOME}/pre_config/env_config.sh
    export HOST_URL="http://<docker host ip>:8702"
-   export CSAR_FILE="/path/to/VNF/copied/in/container/name.csar"
+   export CSAR_FILE="/opt/name.csar"
 
 
 For HEAT based VNFs, the user should copy an archive of the HEAT template VNF
-packages to `pre_config`. The archive must be in gzip tar (tar.gz) format.
-In addition, the archive must contain only a directory with the same name
-(e.g. vnf_a.tar.gz must only include a directory named vnf_a).
+packages to `pre_config`. The archive must be in zip (.zip) format.
+In addition, the zip of HEAT templates must be a flat collection of files, which
+means there should be no top-level directory and no sub-directories.
 
 Configuration file `env_config.sh` should look like this for HEAT based VNFs:
 
index 06ef415..09cfdce 100644 (file)
@@ -79,7 +79,7 @@ class Report(object):
         elif vnf_type == 'heat':
             path = os.path.join(
                 dt_cfg.dovetail_config['config_dir'],
-                os.getenv('VNF_ARCHIVE_NAME') + '.tar.gz')
+                '{}.zip'.format(os.getenv('VNF_ARCHIVE_NAME')))
 
         checksum = hashlib.sha256()
 
index d812e1f..3333cae 100644 (file)
@@ -13,10 +13,10 @@ onap-vvp:
     entrypoint: ''
   shell: '/bin/ash'
   volumes:
-    - '{{dovetail_home}}/pre_config/{{heat_templates_archive}}.tar.gz:/tmp/{{heat_templates_archive}}.tar.gz'
+    - '{{dovetail_home}}/pre_config/{{heat_templates_archive}}.zip:/tmp/{{heat_templates_archive}}.zip'
     - '{{dovetail_home}}/results:{{result_dir}}'
   pre_condition:
-    - 'tar xf /tmp/{{heat_templates_archive}}.tar.gz -C /vvp'
+    - 'unzip -o -d /vvp/{{heat_templates_archive}} /tmp/{{heat_templates_archive}}.zip'
   cmds:
     - 'pytest tests --template-directory=/vvp/{{heat_templates_archive}} --output-directory={{result_dir}} --report-format=json --continue-on-failure'
   post_condition:
index 4f173a6..7644f0d 100644 (file)
@@ -3,10 +3,11 @@
 # The url under which the VNF SDK container is accessible through the host.
 export HOST_URL="http://<docker host ip>:8702"
 
-# Absolute path of CSAR file, and should be copied to vtp container.
+# Absolute path of the CSAR file in container 'refrepo'.
 export CSAR_FILE="/opt/test.csar"
 
 ## Special environment parameters for Heat validation tests.
 
-# The VNF archive should be put at $DOVETAIL_HOME/pre_config.
+# The VNF archive should be zip file and put at $DOVETAIL_HOME/pre_config.
+# Here should give the name without postfix .zip.
 export VNF_ARCHIVE_NAME="vnf_archive_name"