From d0ca34eb13c5bb7f716372f59568d723b7f6bda7 Mon Sep 17 00:00:00 2001 From: shangxdy Date: Fri, 22 Sep 2017 17:29:45 +0800 Subject: Fix heat_stack_owner bug In env installed by apex, there is no role of heat_stack_owner, so it need to separate the condition in script. JIRA:PARSER-157 Change-Id: Ie40715268a1124b57f0bf36ddc566bbcdbed964b Signed-off-by: shangxdy (cherry picked from commit 51a4cb9a4026037147da64b2353ec44002c7a7a7) --- tests/functest_run.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/functest_run.sh b/tests/functest_run.sh index b866ab9..a582d76 100755 --- a/tests/functest_run.sh +++ b/tests/functest_run.sh @@ -104,15 +104,18 @@ create_parser_user_and_project() { } # 3. grant role for parser user - openstack ${debug} user role list ${PARSER_USER} --project ${PARSER_PROJECT} \ + openstack ${debug} role list ${PARSER_USER} --project ${PARSER_PROJECT} \ | grep -qow ${PARSER_ROLE} && { echo " User ${PARSER_USER} has role ${PARSER_ROLE} in project ${PARSER_PROJECT}, doesn't create." } || { openstack ${debug} role add ${PARSER_ROLE} --user ${PARSER_USER} \ --project ${PARSER_PROJECT} - openstack ${debug} role add heat_stack_owner --user ${PARSER_USER} \ - --project ${PARSER_PROJECT} - echo " Grant user ${PARSER_USER} the role ${PARSER_ROLE} and heat_stack_owner in project ${PARSER_PROJECT} successful." + echo " Grant user ${PARSER_USER} the role ${PARSER_ROLE} in project ${PARSER_PROJECT} successful." + openstack ${debug} role list | grep -qow heat_stack_owner && { + openstack ${debug} role add heat_stack_owner --user ${PARSER_USER} \ + --project ${PARSER_PROJECT} + echo " Grant user ${PARSER_USER} the role heat_stack_owner in project ${PARSER_PROJECT} successful." + } } } -- cgit 1.2.3-korg From 4525b0dc066d17e4f7818d39801ca6b8f02aca13 Mon Sep 17 00:00:00 2001 From: shangxdy Date: Wed, 27 Sep 2017 09:24:14 +0800 Subject: Fix user role list bug Currently the query misses a option of --user, the patch will fix it. JIRA: PARSER-158 Change-Id: I324d843b00271f7fb333b02c5372cb061d09ae70 Signed-off-by: shangxdy --- tests/functest_run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functest_run.sh b/tests/functest_run.sh index a582d76..abd0ece 100755 --- a/tests/functest_run.sh +++ b/tests/functest_run.sh @@ -104,7 +104,7 @@ create_parser_user_and_project() { } # 3. grant role for parser user - openstack ${debug} role list ${PARSER_USER} --project ${PARSER_PROJECT} \ + openstack ${debug} role list --user ${PARSER_USER} --project ${PARSER_PROJECT} \ | grep -qow ${PARSER_ROLE} && { echo " User ${PARSER_USER} has role ${PARSER_ROLE} in project ${PARSER_PROJECT}, doesn't create." } || { -- cgit 1.2.3-korg From 23206060d55f39e3e95c21aee9c80164653dc164 Mon Sep 17 00:00:00 2001 From: shangxdy Date: Thu, 28 Sep 2017 13:52:20 +0800 Subject: Add coverage test item Currently there is no coverage report, so it's necessary to add covrage test for parser. JIRA: PARSER-159 Change-Id: I7688b2c7e3adc8d0009e5edf33be41c7c75a5d87 Signed-off-by: shangxdy --- .gitignore | 1 + tosca2heat/heat-translator/.gitignore | 3 ++- tosca2heat/heat-translator/tox.ini | 7 +++++-- tosca2heat/tosca-parser/.gitignore | 3 ++- tosca2heat/tosca-parser/tox.ini | 7 +++++-- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 4bb3f2d..6c2bd20 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ var/ *.egg-info/ .installed.cfg *.egg +cover # PyInstaller # Usually these files are written by a python script from a template diff --git a/tosca2heat/heat-translator/.gitignore b/tosca2heat/heat-translator/.gitignore index 7dfa8ae..05b67b1 100644 --- a/tosca2heat/heat-translator/.gitignore +++ b/tosca2heat/heat-translator/.gitignore @@ -17,6 +17,7 @@ develop-eggs .installed.cfg lib lib64 +cover # Installer logs pip-log.txt @@ -50,4 +51,4 @@ ChangeLog *~ .*.swp .idea -*.iml \ No newline at end of file +*.iml diff --git a/tosca2heat/heat-translator/tox.ini b/tosca2heat/heat-translator/tox.ini index 6ba58c3..447eb6e 100644 --- a/tosca2heat/heat-translator/tox.ini +++ b/tosca2heat/heat-translator/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 1.6 -envlist = py27,pep8 +envlist = pep8,py27,cover skipsdist = True [testenv] @@ -19,7 +19,10 @@ commands = flake8 commands = {posargs} [testenv:cover] -commands = python setup.py testr --coverage --coverage-package-name=translator --testr-args='{posargs}' +commands = + coverage erase + python setup.py test --coverage --coverage-package-name=translator --testr-args='{posargs}' + coverage report [testenv:docs] commands = python setup.py build_sphinx diff --git a/tosca2heat/tosca-parser/.gitignore b/tosca2heat/tosca-parser/.gitignore index c172104..2fe4959 100644 --- a/tosca2heat/tosca-parser/.gitignore +++ b/tosca2heat/tosca-parser/.gitignore @@ -17,6 +17,7 @@ develop-eggs .installed.cfg lib lib64 +cover # Installer logs pip-log.txt @@ -53,4 +54,4 @@ ChangeLog *.iml # OSX -.DS_Store \ No newline at end of file +.DS_Store diff --git a/tosca2heat/tosca-parser/tox.ini b/tosca2heat/tosca-parser/tox.ini index 3603a18..1e27f3f 100644 --- a/tosca2heat/tosca-parser/tox.ini +++ b/tosca2heat/tosca-parser/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 2.0 -envlist = py27,pep8 +envlist = pep8,py27,cover skipsdist = True [testenv] @@ -19,7 +19,10 @@ commands = flake8 commands = {posargs} [testenv:cover] -commands = python setup.py testr --coverage --coverage-package-name=toscaparser --testr-args='{posargs}' +commands = + coverage erase + python setup.py test --coverage --coverage-package-name=toscaparser --testr-args='{posargs}' + coverage report [testenv:docs] commands = python setup.py build_sphinx -- cgit 1.2.3-korg From c5c33ff28000cf16ee8ccf4426ea0e748e8a38c9 Mon Sep 17 00:00:00 2001 From: shangxdy Date: Mon, 9 Oct 2017 17:05:09 +0800 Subject: Remove python limitation for codeship When publish nfv-toscaparser to onap through codefish, the python version of 2.7.13 doesn't support again, so it will be delete in .python-verson JIRA: PARSER-161 Change-Id: I90f1be241c539a405edc7c674e411c20de3e4ae1 Signed-off-by: shangxdy --- tosca2heat/heat-translator/.python-version | 1 - 1 file changed, 1 deletion(-) delete mode 100644 tosca2heat/heat-translator/.python-version diff --git a/tosca2heat/heat-translator/.python-version b/tosca2heat/heat-translator/.python-version deleted file mode 100644 index ecc17b8..0000000 --- a/tosca2heat/heat-translator/.python-version +++ /dev/null @@ -1 +0,0 @@ -2.7.13 -- cgit 1.2.3-korg From 9e8270d05c80712d579b627d46964bcf99458228 Mon Sep 17 00:00:00 2001 From: shangxdy Date: Mon, 9 Oct 2017 16:46:08 +0800 Subject: Fix test for apex Currently the test in apex is error, the patch will fix it. JIRA: PARSER-160 Change-Id: I0c290f7819468e1f400f1610fc87bceb72086b92 Signed-off-by: shangxdy --- tests/functest_run.sh | 6 +++--- tosca2heat/heat-translator/translator/__init__.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/functest_run.sh b/tests/functest_run.sh index abd0ece..3afbd56 100755 --- a/tests/functest_run.sh +++ b/tests/functest_run.sh @@ -104,17 +104,17 @@ create_parser_user_and_project() { } # 3. grant role for parser user - openstack ${debug} role list --user ${PARSER_USER} --project ${PARSER_PROJECT} \ + openstack ${debug} role assignment list --user ${PARSER_USER} --project ${PARSER_PROJECT} \ | grep -qow ${PARSER_ROLE} && { echo " User ${PARSER_USER} has role ${PARSER_ROLE} in project ${PARSER_PROJECT}, doesn't create." } || { openstack ${debug} role add ${PARSER_ROLE} --user ${PARSER_USER} \ --project ${PARSER_PROJECT} - echo " Grant user ${PARSER_USER} the role ${PARSER_ROLE} in project ${PARSER_PROJECT} successful." + echo " Grant user ${PARSER_USER} the role of ${PARSER_ROLE} in project ${PARSER_PROJECT} successful." openstack ${debug} role list | grep -qow heat_stack_owner && { openstack ${debug} role add heat_stack_owner --user ${PARSER_USER} \ --project ${PARSER_PROJECT} - echo " Grant user ${PARSER_USER} the role heat_stack_owner in project ${PARSER_PROJECT} successful." + echo " Grant user ${PARSER_USER} the role of heat_stack_owner in project ${PARSER_PROJECT} successful." } } diff --git a/tosca2heat/heat-translator/translator/__init__.py b/tosca2heat/heat-translator/translator/__init__.py index 3c2a807..aab5d8c 100644 --- a/tosca2heat/heat-translator/translator/__init__.py +++ b/tosca2heat/heat-translator/translator/__init__.py @@ -16,4 +16,4 @@ import pbr.version __version__ = pbr.version.VersionInfo( - 'heat-translator').version_string() + 'nfv-heattranslator').version_string() -- cgit 1.2.3-korg From 9fe6e07e6180c49e6eda3e6cabb339064709180c Mon Sep 17 00:00:00 2001 From: shangxdy Date: Tue, 10 Oct 2017 19:36:44 +0800 Subject: Fix integration error when no role of heat_stack_owner If there is no role of heat_stack_owner in openstack, integration will be error, the patch will fix it. JIRA: PARSER-162 Change-Id: I74d4e70153a312c1a64c75e0ff956b7ab2219adf Signed-off-by: shangxdy --- tests/functest_run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functest_run.sh b/tests/functest_run.sh index 3afbd56..d8aab32 100755 --- a/tests/functest_run.sh +++ b/tests/functest_run.sh @@ -115,7 +115,7 @@ create_parser_user_and_project() { openstack ${debug} role add heat_stack_owner --user ${PARSER_USER} \ --project ${PARSER_PROJECT} echo " Grant user ${PARSER_USER} the role of heat_stack_owner in project ${PARSER_PROJECT} successful." - } + } || true } } -- cgit 1.2.3-korg From 3447589a78375d4dab41608a3504f56a6e4ac9c9 Mon Sep 17 00:00:00 2001 From: shangxdy Date: Thu, 19 Oct 2017 22:47:31 +0800 Subject: Update notes for release E Update userguide and release-notes JIRA:PARSER-163 Change-Id: I3b15aa40afcb86a415997fc7e2471894bf3c9f06 Signed-off-by: shangxdy --- docs/release/release-notes/index.rst | 4 +- docs/release/release-notes/release-notes.rst | 72 ++++++++++++++++++++++++---- docs/release/userguide/feature.userguide.rst | 11 ++++- 3 files changed, 74 insertions(+), 13 deletions(-) diff --git a/docs/release/release-notes/index.rst b/docs/release/release-notes/index.rst index ca21f8f..28a4046 100644 --- a/docs/release/release-notes/index.rst +++ b/docs/release/release-notes/index.rst @@ -3,9 +3,9 @@ .. This work is licensed under a Creative Commons Attribution 4.0 International License. .. http://creativecommons.org/licenses/by/4.0 -**************************** +************************** OPNFV Parser Release Notes -**************************** +************************** .. toctree:: :maxdepth: 1 diff --git a/docs/release/release-notes/release-notes.rst b/docs/release/release-notes/release-notes.rst index 0db5c35..3c1dc70 100644 --- a/docs/release/release-notes/release-notes.rst +++ b/docs/release/release-notes/release-notes.rst @@ -19,7 +19,7 @@ Version history | 2017-03-06 | 1.0 | Howard Huang | Danube Release | | | | | | +--------------------+--------------------+--------------------+--------------------+ -| | | | | +| 2017-09-25 | 2.0 | Shang Xiaodong | Euphrates release | | | | | | +--------------------+--------------------+--------------------+--------------------+ | | | | | @@ -60,10 +60,10 @@ Release Data +--------------------------------------+--------------------------------------+ Version change -^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^ Module version changes -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~ - OpenStack tosca-parser and heat-translator have changed from 0.6 to 0.7 @@ -72,14 +72,14 @@ Module version changes - no feature changes in yang2tosca and policy2tosca since Colorado Release. Document version changes -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~ - Parser Dabube Release documentation has adoped a new format. Reason for version -^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^ Feature additions -~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~ : @@ -107,10 +107,42 @@ Feature additions +--------------------------------------+--------------------------------------+ | PARSER-121 | Add ip output in compute node | +--------------------------------------+--------------------------------------+ +| PARSER-125 | Package for funectest with docker | +| | container. | ++--------------------------------------+--------------------------------------+ +| PARSER-135 | Support costum datatype in | +| | capability. | ++--------------------------------------+--------------------------------------+ +| PARSER-136 | Support metadata validation | ++--------------------------------------+--------------------------------------+ +| PARSER-137 | Support yaml file with suffix of yml | ++--------------------------------------+--------------------------------------+ +| PARSER-138 | Support costum datatype definition | +| | cin parameters. | ++--------------------------------------+--------------------------------------+ +| PARSER-141 | Add required parameters validation | +| | for nested service | ++--------------------------------------+--------------------------------------+ +| PARSER-142 | Add parameter validation in design | +| | time for ONAP | ++--------------------------------------+--------------------------------------+ +| PARSER-144 | Add import file with suffix of yml | +| | testcases | ++--------------------------------------+--------------------------------------+ +| PARSER-146 | Support template version of | +| | tosca_simple_yaml_1_1 | ++--------------------------------------+--------------------------------------+ +| PARSER-148 | Add debug mode parameter | ++--------------------------------------+--------------------------------------+ +| PARSER-151 | Refactor heat-translator setup.py | ++--------------------------------------+--------------------------------------+ +| PARSER-154 | code optimizations about graph | +| | manipulation and formula generation. | ++--------------------------------------+--------------------------------------+ Bug corrections -~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~ **JIRA TICKETS:** @@ -123,6 +155,22 @@ Bug corrections +--------------------------------------+--------------------------------------+ | PARSER-122 | Fix docs bug | +--------------------------------------+--------------------------------------+ +| PARSER-145 | Fix exceptions overwritten when | +| | nested import service topology | ++--------------------------------------+--------------------------------------+ +| PARSER-152 | fix costum datatype definition | +| | in parameters | ++--------------------------------------+--------------------------------------+ +| PARSER-153 | Fix StatefulEntityType when | +| | entitytype is not define | ++--------------------------------------+--------------------------------------+ +| PARSER-155 | Fix substitution mapping assigned | +| | value to nodetemplate | ++--------------------------------------+--------------------------------------+ +| PARSER-156 | Fix functest_run script for role | +| | of heat_stack_owner | ++--------------------------------------+--------------------------------------+ + Deliverables ------------ @@ -191,9 +239,15 @@ Fuel@OPNFV Arno RC2 has undergone QA test runs with the following results: | **TEST-SUITE** | **Results:** | | | | +--------------------------------------+--------------------------------------+ -| | | +| Parser with functest in fuel | PASS | +--------------------------------------+--------------------------------------+ -| | | +| Parser with functest in apex | PASS | ++--------------------------------------+--------------------------------------+ +| Parser with functest in daisy | PASS | ++--------------------------------------+--------------------------------------+ +| Parser with functest in compass | PASS | ++--------------------------------------+--------------------------------------+ +| Parser with functest in joid | SKIP | +--------------------------------------+--------------------------------------+ References diff --git a/docs/release/userguide/feature.userguide.rst b/docs/release/userguide/feature.userguide.rst index 61063c2..219bc0e 100644 --- a/docs/release/userguide/feature.userguide.rst +++ b/docs/release/userguide/feature.userguide.rst @@ -35,13 +35,20 @@ check the input file and don't want to translate, please use tosaca-parser as fo .. code-block:: bash - tosca-parser --template-file= + tosca-parser --template-file= [--nrpv] [--debug] + or + tosca-parser --template-file= [--nrpv] [--debug] + or + tosca-parser --template-file= [--nrpv] [--debug] + options: + --nrpv Ignore input parameter validation when parse template. + --debug debug mode for print more details other than raise exceptions when errors happen Example: .. code-block:: bash - tosca-parser --template-file=vRNC.yaml + tosca-parser --template-file=vRNC.yaml --nrpv Parser tosca2heat References ============================ -- cgit 1.2.3-korg From 0a067a42b6d6493cbae51f75557e162a5fa497a8 Mon Sep 17 00:00:00 2001 From: shangxdy Date: Wed, 3 Jan 2018 14:32:58 +0800 Subject: Replace relative path with absolute path for functest script urrent parser script for functest is supposed that functest enterns the tests directory of parser firstly, and then call functest_parser.sh; it need to use absolute path instead of relative path as work directory. This modification is from functest patch: https://gerrit.opnfv.org/gerrit/#/c/49649/ JIRA: PARSER-171 Change-Id: I55b3ce882e6ddd48edf9f43eb8fae8334c5458aa Signed-off-by: shangxdy --- tests/functest_run.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/functest_run.sh b/tests/functest_run.sh index d8aab32..bdbe898 100755 --- a/tests/functest_run.sh +++ b/tests/functest_run.sh @@ -49,10 +49,10 @@ PARSER_ROLE=admin PARSER_STACK_NAME=vRNC_Stack -# VRNC_INPUT_TEMPLATE_FILE=../tosca2heat/tosca-parser/toscaparser/extensions/nfv/tests/data/vRNC/Definitions/vRNC.yaml -# VRNC_INPUT_TEMPLATE_RAW_FILE=../tosca2heat/heat-translator/translator/tests/data/test_tosca_nfv_sample.yaml -VRNC_INPUT_TEMPLATE_RAW_FILE=../tosca2heat/heat-translator/translator/tests/data/vRNC/Definitions/vRNC.yaml -VRNC_OUTPUT_TEMPLATE_FILE=../tosca2heat/heat-translator/translator/tests/data/vRNC/vRNC_Hot_Template.yaml +# VRNC_INPUT_TEMPLATE_FILE=${PRASER_WORK_DIR}/../tosca2heat/tosca-parser/toscaparser/extensions/nfv/tests/data/vRNC/Definitions/vRNC.yaml +# VRNC_INPUT_TEMPLATE_RAW_FILE=${PRASER_WORK_DIR}/../tosca2heat/heat-translator/translator/tests/data/test_tosca_nfv_sample.yaml +VRNC_INPUT_TEMPLATE_RAW_FILE=${PRASER_WORK_DIR}/../tosca2heat/heat-translator/translator/tests/data/vRNC/Definitions/vRNC.yaml +VRNC_OUTPUT_TEMPLATE_FILE=${PRASER_WORK_DIR}/../tosca2heat/heat-translator/translator/tests/data/vRNC/vRNC_Hot_Template.yaml VRNC_INPUT_TEMPLATE_FILE=${VRNC_INPUT_TEMPLATE_RAW_FILE%.*}_patch.yaml -- cgit 1.2.3-korg