summaryrefslogtreecommitdiffstats
path: root/tests/validator/test_aria_validator.py
diff options
context:
space:
mode:
authorLianhao Lu <lianhao.lu@intel.com>2018-03-24 00:04:37 +0800
committerLianhao Lu <lianhao.lu@intel.com>2018-04-12 10:35:13 +0800
commit1210f741d01f26609b687e6680e5180fb1be5efe (patch)
treeb087864f78a67021471fbcb911154d1e0ec400a2 /tests/validator/test_aria_validator.py
parentcd02d1f9b64957a63ad4b16bac639116975edb22 (diff)
Fix aria validation error in import case2.0.0-ONAPbeijing2.0.0-ONAP
Previously, we assume all the yaml files in the csar package are located under definition directory. This is not always true according to SOL-004. We need to change the way how we call aria to validate the vnfd content within the csar pacakge. Also added the unit test for vnfsdk_pkgtools/validator. Issue-ID: VNFSDK-231 Change-Id: Ia112b21b3bbf64ab980dd4e98aab0e87131f28e0 Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Diffstat (limited to 'tests/validator/test_aria_validator.py')
-rw-r--r--tests/validator/test_aria_validator.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/validator/test_aria_validator.py b/tests/validator/test_aria_validator.py
new file mode 100644
index 0000000..8ae5eab
--- /dev/null
+++ b/tests/validator/test_aria_validator.py
@@ -0,0 +1,27 @@
+# Copyright (c) 2018 Intel Corp. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+
+import logging
+import os
+
+from vnfsdk_pkgtools.packager import csar
+from vnfsdk_pkgtools.validator import aria_validator
+
+CSAR_PATH = 'tests/resources/test_import.csar'
+
+def test_validate(tmpdir):
+ reader = csar._CSARReader(CSAR_PATH, str(tmpdir.mkdir('validate')), logging)
+ validator = aria_validator.AriaValidator()
+ validator.validate(reader)