From e97e5f898a2bfeac786b9022ed151665be435376 Mon Sep 17 00:00:00 2001 From: "Lovett, Trevor" Date: Thu, 30 May 2019 08:51:43 -0500 Subject: [PATCH] [VVP] Exempt output section from nested get_param check Change-Id: Ib87b0fb1c70c5689fc7687a21a27ea60934096b1 Issue-ID: VVP-220 Signed-off-by: Lovett, Trevor --- ice_validator/heat_requirements.json | 28 ++++++++++++---------- ice_validator/tests/conftest.py | 6 ++--- .../test_nested_parameter_args/pass/pass0.yaml | 3 ++- ice_validator/tests/test_nested_parameter_args.py | 2 ++ 4 files changed, 22 insertions(+), 17 deletions(-) diff --git a/ice_validator/heat_requirements.json b/ice_validator/heat_requirements.json index b152d77..6078337 100644 --- a/ice_validator/heat_requirements.json +++ b/ice_validator/heat_requirements.json @@ -1,5 +1,5 @@ { - "created": "2019-05-24T06:32:42.966223", + "created": "2019-05-30T06:32:36.717304", "current_version": "dublin", "project": "", "versions": { @@ -45910,7 +45910,9 @@ "needs_amount": 789 }, "dublin": { - "created": "2019-05-24T06:32:42.966152", + "created": "2019-05-30T06:32:36.717169", + "filters": {}, + "filters_amount": 0, "needs": { "R-00011": { "description": "A VNF's Heat Orchestration Template's parameter defined\nin a nested YAML file\n**SHOULD NOT** have a parameter constraint defined.", @@ -49517,7 +49519,7 @@ "title_from_content": "", "type": "req", "type_name": "Requirement", - "updated": "El Alto", + "updated": "dublin", "validated_by": "", "validation_mode": "static" }, @@ -49858,7 +49860,7 @@ "validation_mode": "" }, "R-120182": { - "description": "The VNF or PNF provider **MUST** indicate specific conditions that may arise, and\nrecommend actions that may be taken at specific thresholds, or if specific\nconditions repeat within a specified time interval, using the semantics and\nsyntax described by the :doc:`VES Event Registration specification <../../../../vnfsdk/model.git/docs/files/VESEventRegistration_3_0>`.", + "description": "The VNF or PNF provider **MUST** indicate specific conditions that may arise, and\nrecommend actions that may be taken at specific thresholds, or if specific\nconditions repeat within a specified time interval, using the semantics and\nsyntax described by the :ref:`VES Event Registration specification `.", "docname": "Chapter7/Monitoring-And-Management", "full_title": "", "hide_links": "", @@ -52566,7 +52568,7 @@ "validation_mode": "static" }, "R-22346": { - "description": "The VNF or PNF package **MUST** provide :doc:`VES Event Registration <../../../../vnfsdk/model.git/docs/files/VESEventRegistration_3_0>`\nfor all VES events provided by that VNF or PNF.", + "description": "The VNF or PNF package **MUST** provide :ref:`VES Event Registration `\nfor all VES events provided by that VNF or PNF.", "docname": "Chapter7/VNF-On-boarding-and-package-management", "full_title": "", "hide_links": "", @@ -55150,7 +55152,7 @@ "validation_mode": "" }, "R-304011": { - "description": "A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource's\n\n* Resource ID (defined in R-29751)\n* property ``image`` parameter name (defined in R-58670)\n* property ``flavor`` parameter name (defined in R-45188)\n* property ``name`` parameter name (defined in R-54171 & R-87817)\n* property port referenced OS::Neutron::Port Resource ID\n (defined in R-20453)\n\n**MUST** contain the identical ``{vm-type}``\nand **MUST** follow the naming conventions defined\nin R-58670, R-45188, R-54171, R-87817, and R-29751. And the ``{index}`` in\nthe ``OS::Nova::Server`` Resource ID (defined in R-29751) **MUST** match\nthe ``{vm-type_index}`` defined in\nthe ``OS::Nova::Server`` property ``port``\nreferenced ``OS::Neutron::Port`` Resource ID (defined in R-20453).", + "description": "A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource's\n\n* Resource ID (defined in R-29751)\n* property ``image`` parameter name (defined in R-58670)\n* property ``flavor`` parameter name (defined in R-45188)\n* property ``name`` parameter name (defined in R-54171 & R-87817)\n* property ``networks`` map property ``port`` value which is a\n ``OS::Neutron::Port`` Resource ID (defined in R-20453)\n referenced using the intrinsic function ``get_attr``\n\n**MUST** contain the identical ``{vm-type}``\nand **MUST** follow the naming conventions defined\nin R-58670, R-45188, R-54171, R-87817, and R-29751. And the ``{index}`` in\nthe ``OS::Nova::Server`` Resource ID (defined in R-29751) **MUST** match\nthe ``{vm-type_index}`` defined in\nthe ``OS::Nova::Server`` property ``networks`` map property ``port``\nreferenced ``OS::Neutron::Port`` Resource ID (defined in R-20453).", "docname": "Chapter5/Heat/ONAP Heat Resource ID and Parameter Naming Convention/Nova Parameters", "full_title": "", "hide_links": "", @@ -58125,7 +58127,7 @@ "validation_mode": "" }, "R-42018": { - "description": "The VNF or PNF Package **MUST** include documentation which must include\nall events (fault, measurement for VNF or PNF Scaling, Syslogs, State Change\nand Mobile Flow), that need to be collected at each VM, VNFC (defined in `VNF Guidelines `__ ) and for the overall VNF or PNF.", + "description": "The VNF or PNF Package **MUST** include documentation which must include\nall events (fault, measurement for VNF or PNF Scaling, Syslogs, State Change\nand Mobile Flow), that need to be collected at each VM, VNFC (defined in `VNF Guidelines `__ ) and for the overall VNF or PNF.", "docname": "Chapter7/VNF-On-boarding-and-package-management", "full_title": "", "hide_links": "", @@ -60986,7 +60988,7 @@ "validation_mode": "" }, "R-520802": { - "description": "The VNF or PNF provider **MUST** provide a YAML file formatted in adherence with\nthe :doc:`VES Event Registration specification <../../../../vnfsdk/model.git/docs/files/VESEventRegistration_3_0>`\nthat defines the following information for each event produced by the VNF:\n\n* ``eventName``\n* Required fields\n* Optional fields\n* Any special handling to be performed for that event", + "description": "The VNF or PNF provider **MUST** provide a YAML file formatted in adherence with\nthe :ref:`VES Event Registration specification `\nthat defines the following information for each event produced by the VNF:\n\n* ``eventName``\n* Required fields\n* Optional fields\n* Any special handling to be performed for that event", "docname": "Chapter7/Monitoring-And-Management", "full_title": "", "hide_links": "", @@ -62322,7 +62324,7 @@ "validation_mode": "" }, "R-570134": { - "description": "The events produced by the VNF or PNF **MUST** must be compliant with the common\nevent format defined in the\n:doc:`VES Event Listener<../../../../vnfsdk/model.git/docs/files/VESEventListener_7_0_1>`\nspecification.", + "description": "The events produced by the VNF or PNF **MUST** must be compliant with the common\nevent format defined in the\n:ref:`VES Event Listener`\nspecification.", "docname": "Chapter7/Monitoring-And-Management", "full_title": "", "hide_links": "", @@ -62820,7 +62822,7 @@ "validation_mode": "" }, "R-589037": { - "description": "A VNF Heat Orchestration Template's Cinder Volume Module resources section\n**MUST** only be defined using one of the following:\n\n* one of more ``OS::Cinder::Volume`` resources\n* one or more ``OS::Heat::ResourceGroup`` resources that call a nested YAML\n file that contains only ``OS::Cinder::Volume`` resources\n* a resource that calls a nested YAML file (static nesting) that contains\n only ``OS::Cinder::Volume`` resources", + "description": "A VNF Heat Orchestration Template's Cinder Volume Module ``resources:``\nsection\n**MUST** only be defined using one of the following:\n\n* one of more ``OS::Cinder::Volume`` resources\n* one or more ``OS::Heat::ResourceGroup`` resources that call a nested YAML\n file that contains only ``OS::Cinder::Volume`` resources\n* a resource that calls a nested YAML file (static nesting) that contains\n only ``OS::Cinder::Volume`` resources", "docname": "Chapter5/Heat/ONAP Heat Orchestration Templates Overview", "full_title": "", "hide_links": "", @@ -66742,7 +66744,7 @@ "validation_mode": "static" }, "R-76057": { - "description": "VNF Heat Orchestration Template's Nested YAML file name **MUST** contain\nonly alphanumeric characters and underscores '_' and\n**MUST NOT** contain the case insensitive word ``base``.", + "description": "VNF Heat Orchestration Template's Nested YAML file name **MUST** contain\nonly alphanumeric characters and underscores '_' and\n**MUST NOT** contain the case insensitive string ``base``.", "docname": "Chapter5/Heat/ONAP Heat Orchestration Templates Overview", "full_title": "", "hide_links": "", @@ -67851,7 +67853,7 @@ "validation_mode": "static" }, "R-81339": { - "description": "A VNF Heat Orchestration Template's Base Module file name **MUST** include\ncase insensitive 'base' in the filename and\n**MUST** match one of the following four\nformats:\n\n 1.) ``base_.y[a]ml``\n\n 2.) ``_base.y[a]ml``\n\n 3.) ``base.y[a]ml``\n\n 4.) ``_base_``.y[a]ml\n\nwhere ```` **MUST** contain only alphanumeric characters and\nunderscores '_' and **MUST NOT** contain the case insensitive word ``base``.", + "description": "A VNF Heat Orchestration Template's Base Module file name **MUST** include\ncase insensitive 'base' in the filename and\n**MUST** match one of the following four\nformats:\n\n 1.) ``base_.y[a]ml``\n\n 2.) ``_base.y[a]ml``\n\n 3.) ``base.y[a]ml``\n\n 4.) ``_base_``.y[a]ml\n\nwhere ```` **MUST** contain only alphanumeric characters and\nunderscores '_' and **MUST NOT** contain the case insensitive string\n``base`` or ``volume``.", "docname": "Chapter5/Heat/ONAP Heat Orchestration Templates Overview", "full_title": "", "hide_links": "", @@ -69810,7 +69812,7 @@ "validation_mode": "" }, "R-87247": { - "description": "VNF Heat Orchestration Template's Incremental Module file name\n**MUST** contain only alphanumeric characters and underscores\n'_' and **MUST NOT** contain the case insensitive word ``base``.", + "description": "VNF Heat Orchestration Template's Incremental Module file name\n**MUST** contain only alphanumeric characters and underscores\n'_' and **MUST NOT** contain the case insensitive string ``base``.", "docname": "Chapter5/Heat/ONAP Heat Orchestration Templates Overview", "full_title": "", "hide_links": "", diff --git a/ice_validator/tests/conftest.py b/ice_validator/tests/conftest.py index db87e18..a6f83f1 100644 --- a/ice_validator/tests/conftest.py +++ b/ice_validator/tests/conftest.py @@ -58,7 +58,7 @@ from six import string_types import version import logging -logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.ERROR) +logging.basicConfig(format="%(levelname)s:%(message)s", level=logging.ERROR) __path__ = [os.path.dirname(os.path.abspath(__file__))] @@ -1058,9 +1058,9 @@ def select_heat_requirements(reqs): def is_testable(reqs): """Filters dict requirements to only those which are testable""" for key, values in reqs.items(): - if (("MUST" in values.get("keyword", "").upper()) and ( + if ("MUST" in values.get("keyword", "").upper()) and ( "none" not in values.get("validation_mode", "").lower() - )): + ): reqs[key]["testable"] = True else: reqs[key]["testable"] = False diff --git a/ice_validator/tests/fixtures/test_nested_parameter_args/pass/pass0.yaml b/ice_validator/tests/fixtures/test_nested_parameter_args/pass/pass0.yaml index e9bed41..3b95a66 100644 --- a/ice_validator/tests/fixtures/test_nested_parameter_args/pass/pass0.yaml +++ b/ice_validator/tests/fixtures/test_nested_parameter_args/pass/pass0.yaml @@ -55,4 +55,5 @@ resources: get_param: [ cdl, { get_param: num }] vf_module_id2: get_param: [ cdl, { get_param: num }] - +outputs: + prop: {get_param: [list_one, {get_param: [list_two, {get_param: index_two}]}]} \ No newline at end of file diff --git a/ice_validator/tests/test_nested_parameter_args.py b/ice_validator/tests/test_nested_parameter_args.py index 9f5e0bb..378d12f 100644 --- a/ice_validator/tests/test_nested_parameter_args.py +++ b/ice_validator/tests/test_nested_parameter_args.py @@ -53,6 +53,8 @@ class GetParamChecker: def __call__(self, keys, param_value, *args, **kwargs): if isinstance(param_value, str): return # refers to a string or parameter - this is OK + if "outputs" in keys: + return # output section is exempt from this requirement if isinstance(param_value, list): nested_get_params = (arg for arg in param_value if is_get_param(arg)) args = (call["get_param"] for call in nested_get_params) -- 2.16.6