X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ice_validator%2Ftests%2Ftest_non_server_name.py;h=9361389defc21ea6e18d5300e49b5c791e525cc8;hb=1bc097aa957e560147b4d9af49d25e69a6692702;hp=f47e078f2e76bdd615617f1a3f4d72353fe7bddc;hpb=48a07b6942d3956666d30947372653feb702fdae;p=vvp%2Fvalidation-scripts.git diff --git a/ice_validator/tests/test_non_server_name.py b/ice_validator/tests/test_non_server_name.py index f47e078..9361389 100644 --- a/ice_validator/tests/test_non_server_name.py +++ b/ice_validator/tests/test_non_server_name.py @@ -35,20 +35,19 @@ # # ============LICENSE_END============================================ # -# ECOMP is a trademark and service mark of AT&T Intellectual Property. # """ resource property name """ - +import os import collections - import pytest from .structures import Heat from .structures import HeatProcessor from .helpers import validates +from tests.utils import nested_files VERSION = "1.2.0" @@ -66,7 +65,7 @@ def get_non_servers(heat): @validates("R-85734") -def test_non_server_name(heat_template): +def test_non_server_name(yaml_file): """ If a VNF's Heat Orchestration Template contains the property ``name`` for a non ``OS::Nova::Server`` resource, the intrinsic function @@ -74,7 +73,7 @@ def test_non_server_name(heat_template): supplied metadata parameter ``vnf_name`` to generate a unique value. """ - h = Heat(filepath=heat_template) + h = Heat(filepath=yaml_file) if not h.resources: pytest.skip("No resources in this template") @@ -149,11 +148,15 @@ def test_non_server_name(heat_template): @validates("R-85734") -def test_non_server_name_unique(yaml_files): +def test_non_server_name_unique(heat_template): """Test name has unique value """ + list_nest = nested_files.get_list_of_nested_files( + heat_template, os.path.dirname(heat_template) + ) + list_nest.append(heat_template) non_servers = {} - for yaml_file in yaml_files: + for yaml_file in list_nest: h = Heat(filepath=yaml_file) non_servers.update(get_non_servers(h)) names = collections.defaultdict(set)