From 5e5e493a5ec5048c0a340e2acd72f52869779fdf Mon Sep 17 00:00:00 2001 From: Moshe Date: Wed, 15 Aug 2018 12:19:07 +0300 Subject: versionize tests due to API changes in ONAP Issue-ID: VNFSDK-301 Change-Id: I1fdf1b42fc2cd44021c2f33695c86bbbdc8bb62b Signed-off-by: Moshe fix tests Issue-ID: VNFSDK-301 Change-Id: I87abc962b13956af07ad8bf7355ea681343664dc Signed-off-by: Moshe --- vnftest/__init__.py | 15 +- vnftest/cmd/commands/task.py | 1 + vnftest/common/constants.py | 35 +- vnftest/common/html_template.py | 1 + vnftest/common/import_utils.py | 38 ++ vnftest/common/openstack_utils.py | 55 ++- vnftest/common/utils.py | 50 +-- vnftest/contexts/base.py | 19 +- vnftest/core/__init__.py | 1 + vnftest/core/task.py | 3 +- vnftest/core/testsuite.py | 4 +- vnftest/dispatcher/__init__.py | 4 +- vnftest/onap/onap_api_call.py | 152 -------- vnftest/onap/onboard/accept_resource_test.yaml | 26 -- vnftest/onap/onboard/accept_service_test.yaml | 24 -- vnftest/onap/onboard/add_resource_instance.yaml | 32 -- vnftest/onap/onboard/add_service.yaml | 57 --- vnftest/onap/onboard/approve_distribution.yaml | 23 -- vnftest/onap/onboard/checkin_vlm.yaml | 24 -- vnftest/onap/onboard/checkin_vsp.yaml | 24 -- vnftest/onap/onboard/create_package_vsp.yaml | 24 -- vnftest/onap/onboard/create_vlm.yaml | 27 -- vnftest/onap/onboard/create_vsp.yaml | 32 -- vnftest/onap/onboard/distribute.yaml | 23 -- vnftest/onap/onboard/import_vsp.yaml | 64 ---- vnftest/onap/onboard/monitor_distribution.yaml | 23 -- vnftest/onap/onboard/process_package.yaml | 21 -- vnftest/onap/onboard/start_resource_test.yaml | 23 -- vnftest/onap/onboard/start_service_test.yaml | 22 -- .../onap/onboard/submit_resource_for_testing.yaml | 24 -- .../onap/onboard/submit_service_for_testing.yaml | 24 -- vnftest/onap/onboard/submit_vlm.yaml | 25 -- vnftest/onap/onboard/submit_vsp.yaml | 24 -- vnftest/onap/onboard/upload_package.yaml | 22 -- vnftest/onap/onboard/v1/__init__.py | 0 .../onap/onboard/v1/accept_resource_test_v1.yaml | 26 ++ .../onap/onboard/v1/accept_service_test_v1.yaml | 24 ++ .../onap/onboard/v1/add_resource_instance_v1.yaml | 32 ++ vnftest/onap/onboard/v1/add_service_v1.yaml | 57 +++ .../onap/onboard/v1/approve_distribution_v1.yaml | 23 ++ vnftest/onap/onboard/v1/checkin_vlm_v1.yaml | 24 ++ vnftest/onap/onboard/v1/checkin_vsp_v1.yaml | 24 ++ vnftest/onap/onboard/v1/create_package_vsp_v1.yaml | 24 ++ vnftest/onap/onboard/v1/create_vlm_v1.yaml | 27 ++ vnftest/onap/onboard/v1/create_vsp_v1.yaml | 32 ++ vnftest/onap/onboard/v1/distribute_v1.yaml | 23 ++ vnftest/onap/onboard/v1/import_vsp_v1.yaml | 64 ++++ .../onap/onboard/v1/monitor_distribution_v1.yaml | 23 ++ vnftest/onap/onboard/v1/process_package_v1.yaml | 21 ++ .../onap/onboard/v1/start_resource_test_v1.yaml | 23 ++ vnftest/onap/onboard/v1/start_service_test_v1.yaml | 22 ++ .../onboard/v1/submit_resource_for_testing_v1.yaml | 24 ++ .../onboard/v1/submit_service_for_testing_v1.yaml | 24 ++ vnftest/onap/onboard/v1/submit_vlm_v1.yaml | 25 ++ vnftest/onap/onboard/v1/submit_vsp_v1.yaml | 24 ++ vnftest/onap/onboard/v1/upload_package_v1.yaml | 22 ++ vnftest/onap/onboard/v2/__init__.py | 0 .../onap/onboard/v2/accept_resource_test_v2.yaml | 26 ++ .../onap/onboard/v2/accept_service_test_v2.yaml | 24 ++ .../onap/onboard/v2/add_resource_instance_v2.yaml | 32 ++ vnftest/onap/onboard/v2/add_service_v2.yaml | 57 +++ .../onap/onboard/v2/approve_distribution_v2.yaml | 23 ++ vnftest/onap/onboard/v2/checkin_vsp_v2.yaml | 24 ++ vnftest/onap/onboard/v2/create_package_vsp_v2.yaml | 24 ++ vnftest/onap/onboard/v2/create_vlm_v2.yaml | 27 ++ vnftest/onap/onboard/v2/create_vsp_v2.yaml | 32 ++ vnftest/onap/onboard/v2/distribute_v2.yaml | 23 ++ vnftest/onap/onboard/v2/import_vsp_v2.yaml | 64 ++++ .../onap/onboard/v2/monitor_distribution_v2.yaml | 23 ++ vnftest/onap/onboard/v2/process_package_v2.yaml | 21 ++ .../onap/onboard/v2/start_resource_test_v2.yaml | 23 ++ vnftest/onap/onboard/v2/start_service_test_v2.yaml | 22 ++ .../onboard/v2/submit_resource_for_testing_v2.yaml | 24 ++ .../onboard/v2/submit_service_for_testing_v2.yaml | 24 ++ vnftest/onap/onboard/v2/submit_vlm_v2.yaml | 25 ++ vnftest/onap/onboard/v2/submit_vsp_v2.yaml | 24 ++ vnftest/onap/onboard/v2/upload_package_v2.yaml | 22 ++ .../onap/steps/validation/vf_module_validator.py | 11 +- vnftest/runners/base.py | 1 - vnftest/steps/rest_call.py | 151 ++++++++ .../test_cases/onap_vnftest_instantiate-v1.yaml | 363 +++++++++++++++++++ .../onap/test_cases/onap_vnftest_onboard-v1.yaml | 374 ++++++++++++++++++++ .../onap/test_cases/onap_vnftest_onboard-v2.yaml | 387 +++++++++++++++++++++ .../onap/test_cases/onap_vnftest_tc001.yaml | 374 -------------------- .../onap/test_cases/onap_vnftest_tc002.yaml | 363 ------------------- .../onap/test_cases/onap_vnftest_tc003.yaml | 95 ----- .../onap/test_cases/onap_vnftest_terminate.yaml | 95 +++++ .../onap/test_suites/onap_basic_lifecycle-v1.yaml | 26 ++ .../onap/test_suites/onap_basic_lifecycle-v2.yaml | 26 ++ .../onap/test_suites/onap_basic_lifecycle.yaml | 26 -- vnftest/tests/unit/common/test_utils.py | 5 +- vnftest/tests/unit/core/test_commands.py | 15 +- vnftest/tests/unit/core/test_testcase.py | 2 +- vnftest/tests/unit/onap/test_onap_api_call.py | 60 ---- vnftest/tests/unit/onap/test_rest_call.py | 58 +++ 95 files changed, 2761 insertions(+), 1789 deletions(-) create mode 100644 vnftest/common/import_utils.py delete mode 100644 vnftest/onap/onap_api_call.py delete mode 100644 vnftest/onap/onboard/accept_resource_test.yaml delete mode 100644 vnftest/onap/onboard/accept_service_test.yaml delete mode 100644 vnftest/onap/onboard/add_resource_instance.yaml delete mode 100644 vnftest/onap/onboard/add_service.yaml delete mode 100644 vnftest/onap/onboard/approve_distribution.yaml delete mode 100644 vnftest/onap/onboard/checkin_vlm.yaml delete mode 100644 vnftest/onap/onboard/checkin_vsp.yaml delete mode 100644 vnftest/onap/onboard/create_package_vsp.yaml delete mode 100644 vnftest/onap/onboard/create_vlm.yaml delete mode 100644 vnftest/onap/onboard/create_vsp.yaml delete mode 100644 vnftest/onap/onboard/distribute.yaml delete mode 100644 vnftest/onap/onboard/import_vsp.yaml delete mode 100644 vnftest/onap/onboard/monitor_distribution.yaml delete mode 100644 vnftest/onap/onboard/process_package.yaml delete mode 100644 vnftest/onap/onboard/start_resource_test.yaml delete mode 100644 vnftest/onap/onboard/start_service_test.yaml delete mode 100644 vnftest/onap/onboard/submit_resource_for_testing.yaml delete mode 100644 vnftest/onap/onboard/submit_service_for_testing.yaml delete mode 100644 vnftest/onap/onboard/submit_vlm.yaml delete mode 100644 vnftest/onap/onboard/submit_vsp.yaml delete mode 100644 vnftest/onap/onboard/upload_package.yaml create mode 100644 vnftest/onap/onboard/v1/__init__.py create mode 100644 vnftest/onap/onboard/v1/accept_resource_test_v1.yaml create mode 100644 vnftest/onap/onboard/v1/accept_service_test_v1.yaml create mode 100644 vnftest/onap/onboard/v1/add_resource_instance_v1.yaml create mode 100644 vnftest/onap/onboard/v1/add_service_v1.yaml create mode 100644 vnftest/onap/onboard/v1/approve_distribution_v1.yaml create mode 100644 vnftest/onap/onboard/v1/checkin_vlm_v1.yaml create mode 100644 vnftest/onap/onboard/v1/checkin_vsp_v1.yaml create mode 100644 vnftest/onap/onboard/v1/create_package_vsp_v1.yaml create mode 100644 vnftest/onap/onboard/v1/create_vlm_v1.yaml create mode 100644 vnftest/onap/onboard/v1/create_vsp_v1.yaml create mode 100644 vnftest/onap/onboard/v1/distribute_v1.yaml create mode 100644 vnftest/onap/onboard/v1/import_vsp_v1.yaml create mode 100644 vnftest/onap/onboard/v1/monitor_distribution_v1.yaml create mode 100644 vnftest/onap/onboard/v1/process_package_v1.yaml create mode 100644 vnftest/onap/onboard/v1/start_resource_test_v1.yaml create mode 100644 vnftest/onap/onboard/v1/start_service_test_v1.yaml create mode 100644 vnftest/onap/onboard/v1/submit_resource_for_testing_v1.yaml create mode 100644 vnftest/onap/onboard/v1/submit_service_for_testing_v1.yaml create mode 100644 vnftest/onap/onboard/v1/submit_vlm_v1.yaml create mode 100644 vnftest/onap/onboard/v1/submit_vsp_v1.yaml create mode 100644 vnftest/onap/onboard/v1/upload_package_v1.yaml create mode 100644 vnftest/onap/onboard/v2/__init__.py create mode 100644 vnftest/onap/onboard/v2/accept_resource_test_v2.yaml create mode 100644 vnftest/onap/onboard/v2/accept_service_test_v2.yaml create mode 100644 vnftest/onap/onboard/v2/add_resource_instance_v2.yaml create mode 100644 vnftest/onap/onboard/v2/add_service_v2.yaml create mode 100644 vnftest/onap/onboard/v2/approve_distribution_v2.yaml create mode 100644 vnftest/onap/onboard/v2/checkin_vsp_v2.yaml create mode 100644 vnftest/onap/onboard/v2/create_package_vsp_v2.yaml create mode 100644 vnftest/onap/onboard/v2/create_vlm_v2.yaml create mode 100644 vnftest/onap/onboard/v2/create_vsp_v2.yaml create mode 100644 vnftest/onap/onboard/v2/distribute_v2.yaml create mode 100644 vnftest/onap/onboard/v2/import_vsp_v2.yaml create mode 100644 vnftest/onap/onboard/v2/monitor_distribution_v2.yaml create mode 100644 vnftest/onap/onboard/v2/process_package_v2.yaml create mode 100644 vnftest/onap/onboard/v2/start_resource_test_v2.yaml create mode 100644 vnftest/onap/onboard/v2/start_service_test_v2.yaml create mode 100644 vnftest/onap/onboard/v2/submit_resource_for_testing_v2.yaml create mode 100644 vnftest/onap/onboard/v2/submit_service_for_testing_v2.yaml create mode 100644 vnftest/onap/onboard/v2/submit_vlm_v2.yaml create mode 100644 vnftest/onap/onboard/v2/submit_vsp_v2.yaml create mode 100644 vnftest/onap/onboard/v2/upload_package_v2.yaml create mode 100644 vnftest/steps/rest_call.py create mode 100644 vnftest/test_config/onap/test_cases/onap_vnftest_instantiate-v1.yaml create mode 100644 vnftest/test_config/onap/test_cases/onap_vnftest_onboard-v1.yaml create mode 100644 vnftest/test_config/onap/test_cases/onap_vnftest_onboard-v2.yaml delete mode 100644 vnftest/test_config/onap/test_cases/onap_vnftest_tc001.yaml delete mode 100644 vnftest/test_config/onap/test_cases/onap_vnftest_tc002.yaml delete mode 100644 vnftest/test_config/onap/test_cases/onap_vnftest_tc003.yaml create mode 100644 vnftest/test_config/onap/test_cases/onap_vnftest_terminate.yaml create mode 100644 vnftest/test_config/onap/test_suites/onap_basic_lifecycle-v1.yaml create mode 100644 vnftest/test_config/onap/test_suites/onap_basic_lifecycle-v2.yaml delete mode 100644 vnftest/test_config/onap/test_suites/onap_basic_lifecycle.yaml delete mode 100644 vnftest/tests/unit/onap/test_onap_api_call.py create mode 100644 vnftest/tests/unit/onap/test_rest_call.py (limited to 'vnftest') diff --git a/vnftest/__init__.py b/vnftest/__init__.py index 6456fc1..af1cdc3 100644 --- a/vnftest/__init__.py +++ b/vnftest/__init__.py @@ -21,7 +21,7 @@ import errno # not require loggers to be created, so this cannot # include vnftest.common.utils from vnftest.common import constants -import vnftest.common.utils as utils +import vnftest.common.import_utils as import_utils try: # do not use vnftest.common.utils.makedirs @@ -43,7 +43,7 @@ LOG = logging.getLogger(__name__) def _init_logging(): - + print ("initializing logging. log file: " + str(LOG_FILE)) LOG.setLevel(logging.DEBUG) _LOG_STREAM_HDLR.setFormatter(_LOG_FORMATTER) @@ -61,8 +61,9 @@ def _init_logging(): logging.root.addHandler(_LOG_FILE_HDLR) logging.debug("logging.root.handlers = %s", logging.root.handlers) -utils.import_modules_from_package("vnftest.contexts") -utils.import_modules_from_package("vnftest.runners") -utils.import_modules_from_package("vnftest.steps") -utils.import_modules_from_package("vnftest.crawlers") -utils.import_modules_from_package("vnftest.openstack") +import_utils.import_modules_from_package("vnftest.contexts") +import_utils.import_modules_from_package("vnftest.runners") +import_utils.import_modules_from_package("vnftest.steps") +import_utils.import_modules_from_package("vnftest.crawlers") +import_utils.import_modules_from_package("vnftest.openstack") +import_utils.import_modules_from_package("vnftest.onap") diff --git a/vnftest/cmd/commands/task.py b/vnftest/cmd/commands/task.py index 3e2a071..e0bf7e5 100644 --- a/vnftest/cmd/commands/task.py +++ b/vnftest/cmd/commands/task.py @@ -29,6 +29,7 @@ class TaskCommands(object): # pragma: no cover Set of commands to manage benchmark tasks. """ + @cliargs("environment", type=str, help="path to environment file", metavar="environment") @cliargs("vnfdescriptor", type=str, help="path to vnf descriptor file", metavar="vnf-descriptor") @cliargs("inputfile", type=str, help="path to task or suite file", metavar="input-file") @cliargs("--task-args", dest="task_args", diff --git a/vnftest/common/constants.py b/vnftest/common/constants.py index 46db92c..acf14ea 100644 --- a/vnftest/common/constants.py +++ b/vnftest/common/constants.py @@ -83,48 +83,23 @@ if not SERVER_IP: # dir CONF_DIR = get_param('dir.conf', join(VNFTEST_ROOT_PATH, 'etc/vnftest')) +IMAGE_DIR = get_param('dir.images', join(VNFTEST_ROOT_PATH, 'home/onap/images/')) +PACKAGE_DIR = get_param('dir.packages', join(VNFTEST_ROOT_PATH, 'home/onap/packages/')) CONF_FILE = join(CONF_DIR, 'vnftest.conf') REPOS_DIR = get_param('dir.repos', join(VNFTEST_ROOT_PATH, 'home/onap/repos/vnftest')) -LOG_DIR = get_param('dir.log', join(VNFTEST_ROOT_PATH, 'tmp/vnftest/')) +LOG_DIR = get_param('dir.log', join(VNFTEST_ROOT_PATH, 'var/log/vnftest/')) TASK_LOG_DIR = get_param('dir.tasklog', join(VNFTEST_ROOT_PATH, 'var/log/vnftest/')) CONF_SAMPLE_DIR = join(REPOS_DIR, 'etc/vnftest/') SAMPLE_CASE_DIR = join(REPOS_DIR, 'samples') -TESTCASE_DIR = join(VNFTEST_ROOT_PATH, 'vnftest/test_config/onap/test_cases/') -TESTSUITE_DIR = join(VNFTEST_ROOT_PATH, 'vnftest/test_config/onap/test_suites/') +TESTCASE_DIR = join(REPOS_DIR, 'vnftest/test_config/onap/test_cases/') +TESTSUITE_DIR = join(REPOS_DIR, 'vnftest/test_config/onap/test_suites/') # file DEFAULT_OUTPUT_FILE = get_param('file.output_file', join(VNFTEST_ROOT_PATH, 'tmp/vnftest.out')) DEFAULT_HTML_FILE = get_param('file.html_file', join(VNFTEST_ROOT_PATH, 'tmp/vnftest.htm')) REPORTING_FILE = get_param('file.reporting_file', join(VNFTEST_ROOT_PATH, 'tmp/report.html')) -# components -AAI_IP = get_param('component.aai_ip') -AAI_PORT = get_param('component.aai_port') -AAI_SSL_PORT = get_param('component.aai_ssl_port') -MSO_IP = get_param('component.mso_ip') -SDC_IP = get_param('component.sdc_ip') -SDC_PORT = get_param('component.sdc_port') -SDC_CATALOG_PORT = get_param('component.sdc_catalog_port') -SDC_DESIGNER_USER = get_param('component.sdc_designer_user') -SDC_TESTER_USER = get_param('component.sdc_tester_user') -SDC_GOVERNANCE_USER = get_param('component.sdc_governance_user') -SDC_OPERATIONS_USER = get_param('component.sdc_operations_user') - -component_constants = {} -component_constants['aai_ip'] = AAI_IP -component_constants['aai_port'] = AAI_PORT -component_constants['aai_ssl_port'] = AAI_SSL_PORT -component_constants['mso_ip'] = MSO_IP -component_constants['sdc_ip'] = SDC_IP -component_constants['sdc_port'] = SDC_PORT -component_constants['sdc_catalog_port'] = SDC_CATALOG_PORT -component_constants['sdc_designer_user'] = SDC_DESIGNER_USER -component_constants['sdc_tester_user'] = SDC_TESTER_USER -component_constants['sdc_governance_user'] = SDC_GOVERNANCE_USER -component_constants['sdc_operations_user'] = SDC_OPERATIONS_USER - - # api API_PORT = 5000 DOCKER_URL = 'unix://var/run/docker.sock' diff --git a/vnftest/common/html_template.py b/vnftest/common/html_template.py index 572d47f..7a91781 100644 --- a/vnftest/common/html_template.py +++ b/vnftest/common/html_template.py @@ -184,6 +184,7 @@ report_template = """ {{ loop.index }} {{key}} {{value.criteria}} + {{value.output}} {% endfor %} diff --git a/vnftest/common/import_utils.py b/vnftest/common/import_utils.py new file mode 100644 index 0000000..1cff864 --- /dev/null +++ b/vnftest/common/import_utils.py @@ -0,0 +1,38 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 importlib + +import os +import sys +import vnftest + + +def import_modules_from_package(package): + """Import modules given a package name + :param: package - Full package name. For example: rally.deploy.engines + """ + vnftest_root = os.path.dirname(os.path.dirname(vnftest.__file__)) + path = os.path.join(vnftest_root, *package.split('.')) + for root, _, files in os.walk(path): + matches = (filename for filename in files if filename.endswith('.py') + and not filename.startswith('__')) + new_package = os.path.relpath(root, vnftest_root).replace(os.sep, + '.') + module_names = set( + '{}.{}'.format(new_package, filename.rsplit('.py', 1)[0]) + for filename in matches) + # Find modules which haven't already been imported + missing_modules = module_names.difference(sys.modules) + for module_name in missing_modules: + importlib.import_module(module_name) diff --git a/vnftest/common/openstack_utils.py b/vnftest/common/openstack_utils.py index 829b916..c8842d8 100644 --- a/vnftest/common/openstack_utils.py +++ b/vnftest/common/openstack_utils.py @@ -40,35 +40,34 @@ creds = {} # ********************************************* # CREDENTIALS # ********************************************* +def initialize(openstack_env_config): + keystone_api_version = openstack_env_config.get('OS_IDENTITY_API_VERSION', None) + + if keystone_api_version is None or keystone_api_version == '2': + keystone_v3 = False + creds['tenant_name'] = openstack_env_config['OS_TENANT_NAME'] + else: + keystone_v3 = True + creds['tenant_name'] = openstack_env_config['OS_PROJECT_NAME'] + creds['project_name'] = openstack_env_config['OS_PROJECT_NAME'] + + creds["username"] = openstack_env_config["OS_USERNAME"] + creds["password"] = openstack_env_config["OS_PASSWORD"] + creds["auth_url"] = openstack_env_config["OS_AUTH_URL"] + creds["tenant_id"] = openstack_env_config["OS_TENANT_ID"] + + if keystone_v3: + if 'OS_USER_DOMAIN_NAME' in openstack_env_config: + creds.update({ + "user_domain_name": openstack_env_config['OS_USER_DOMAIN_NAME'] + }) + if 'OS_PROJECT_DOMAIN_NAME' in openstack_env_config: + creds.update({ + "project_domain_name": openstack_env_config['OS_PROJECT_DOMAIN_NAME'] + }) + + def get_credentials(): - """Returns a creds dictionary filled with parsed from env""" - if len(creds) == 0: - # The most common way to pass these info to the script is to do it - # through environment variables. - keystone_api_version = os.getenv('OS_IDENTITY_API_VERSION') - - if keystone_api_version is None or keystone_api_version == '2': - keystone_v3 = False - creds['tenant_name'] = os.environ.get('OS_TENANT_NAME') - else: - keystone_v3 = True - creds['tenant_name'] = os.environ.get('OS_PROJECT_NAME') - creds['project_name'] = os.environ.get('OS_PROJECT_NAME') - - creds["username"] = os.environ.get("OS_USERNAME") - creds["password"] = os.environ.get("OS_PASSWORD") - creds["auth_url"] = os.environ.get("OS_AUTH_URL") - creds["tenant_id"] = os.environ.get("OS_TENANT_ID") - - if keystone_v3: - if os.getenv('OS_USER_DOMAIN_NAME') is not None: - creds.update({ - "user_domain_name": os.getenv('OS_USER_DOMAIN_NAME') - }) - if os.getenv('OS_PROJECT_DOMAIN_NAME') is not None: - creds.update({ - "project_domain_name": os.getenv('OS_PROJECT_DOMAIN_NAME') - }) return creds diff --git a/vnftest/common/utils.py b/vnftest/common/utils.py index 10edc05..9e2496e 100644 --- a/vnftest/common/utils.py +++ b/vnftest/common/utils.py @@ -15,11 +15,9 @@ # yardstick/common/utils.py import collections -import formatter from contextlib import closing import datetime import errno -import importlib from string import Formatter import ipaddress @@ -28,7 +26,6 @@ import os import random import socket import subprocess -import sys import pkg_resources import six @@ -36,7 +33,6 @@ from flask import jsonify from six.moves import configparser from oslo_serialization import jsonutils import xml.etree.ElementTree -import vnftest from vnftest.common.exceptions import ResourceNotFound @@ -74,31 +70,6 @@ def findsubclasses(cls): return class_implementations[cls.__name__] -def import_modules_from_package(package): - """Import modules given a package name - - :param: package - Full package name. For example: rally.deploy.engines - """ - vnftest_root = os.path.dirname(os.path.dirname(vnftest.__file__)) - path = os.path.join(vnftest_root, *package.split('.')) - for root, _, files in os.walk(path): - matches = (filename for filename in files if filename.endswith('.py') - and not filename.startswith('__')) - new_package = os.path.relpath(root, vnftest_root).replace(os.sep, - '.') - module_names = set( - '{}.{}'.format(new_package, filename.rsplit('.py', 1)[0]) - for filename in matches) - # Find modules which haven't already been imported - missing_modules = module_names.difference(sys.modules) - logger.debug('Importing modules: %s', missing_modules) - for module_name in missing_modules: - try: - importlib.import_module(module_name) - except (ImportError, SyntaxError): - logger.exception('Unable to import module %s', module_name) - - def makedirs(d): try: os.makedirs(d) @@ -496,19 +467,20 @@ def element_tree_to_dict(element_tree): def resource_as_string(path): - split_path = os.path.split(path) - package = split_path[0].replace("/", ".") - if not pkg_resources.resource_exists(package, split_path[1]): - raise ResourceNotFound(resource=path) - return pkg_resources.resource_string(package, split_path[1]) + resource = load_resource(path) + return resource.read() def load_resource(path): - split_path = os.path.split(path) - package = split_path[0].replace("/", ".") - if not pkg_resources.resource_exists(package, split_path[1]): - raise ResourceNotFound(resource=path) - return pkg_resources.resource_stream(package, split_path[1]) + try: + return open(path) + except Exception: + logger.info("path not loaded as file, trying load as package") + split_path = os.path.split(path) + package = split_path[0].replace("/", ".") + if not pkg_resources.resource_exists(package, split_path[1]): + raise ResourceNotFound(resource=path) + return pkg_resources.resource_stream(package, split_path[1]) def format(st, params): diff --git a/vnftest/contexts/base.py b/vnftest/contexts/base.py index 47dbf01..c6f3992 100644 --- a/vnftest/contexts/base.py +++ b/vnftest/contexts/base.py @@ -17,21 +17,32 @@ from vnftest.common import openstack_utils import vnftest.common.utils as utils import yaml - +import logging +LOG = logging.getLogger(__name__) @six.add_metaclass(abc.ABCMeta) class Context(object): """Class that represents a context in the logical model""" list = [] vnf_descriptor = {} + onap_env_config = {} creds = {} @classmethod - def initialize(cls, vnf_descriptor_path): + def initialize(cls, vnf_descriptor_path, environment_path): + LOG.info('vnf descriptor path: %s', str(vnf_descriptor_path)) + LOG.info('environment path: %s', str(environment_path)) with open(vnf_descriptor_path) as f: cls.vnf_descriptor = yaml.safe_load(f) - for key, value in openstack_utils.get_credentials().iteritems(): - cls.creds[key] = value + with open(environment_path) as f: + environment_config = yaml.safe_load(f) + openstack_env_config = environment_config['openstack'] + openstack_utils.initialize(openstack_env_config) + cls.onap_env_config = environment_config['onap'] + + cls.creds = openstack_utils.get_credentials() + + @staticmethod def split_name(name, sep='.'): diff --git a/vnftest/core/__init__.py b/vnftest/core/__init__.py index 6ef8d70..d734360 100644 --- a/vnftest/core/__init__.py +++ b/vnftest/core/__init__.py @@ -25,6 +25,7 @@ class Param(object): def __init__(self, kwargs): # list + self.environment = kwargs.get('environment') self.vnfdescriptor = kwargs.get('vnfdescriptor') self.inputfile = kwargs.get('inputfile') self.task_args = kwargs.get('task-args') diff --git a/vnftest/core/task.py b/vnftest/core/task.py index 5e0267f..91e3d3c 100644 --- a/vnftest/core/task.py +++ b/vnftest/core/task.py @@ -72,7 +72,7 @@ class Task(object): # pragma: no cover output_config['DEFAULT']['dispatcher'] = out_types def start(self, args, **kwargs): - Context.initialize(args.vnfdescriptor) + Context.initialize(args.vnfdescriptor, args.environment) atexit.register(self.atexit_handler) task_id = getattr(args, 'task_id') @@ -195,7 +195,6 @@ class Task(object): # pragma: no cover output_config.setdefault('dispatcher_http', {}) output_config.setdefault('dispatcher_file', {}) output_config.setdefault('dispatcher_influxdb', {}) - output_config.setdefault('nsb', {}) def _set_output_config(self, output_config, file_path): try: diff --git a/vnftest/core/testsuite.py b/vnftest/core/testsuite.py index 986982a..9c58886 100644 --- a/vnftest/core/testsuite.py +++ b/vnftest/core/testsuite.py @@ -18,6 +18,8 @@ from __future__ import absolute_import from __future__ import print_function +import fnmatch + import os import logging @@ -41,7 +43,7 @@ class Testsuite(object): def _get_testsuite_file_list(self): try: - testsuite_files = sorted(os.listdir(consts.TESTSUITE_DIR)) + testsuite_files = sorted(fnmatch.filter(os.listdir(consts.TESTSUITE_DIR), '*.yaml')) except OSError: LOG.exception('Failed to list dir:\n%s\n', consts.TESTSUITE_DIR) raise diff --git a/vnftest/dispatcher/__init__.py b/vnftest/dispatcher/__init__.py index 232233f..998094d 100644 --- a/vnftest/dispatcher/__init__.py +++ b/vnftest/dispatcher/__init__.py @@ -17,9 +17,9 @@ from __future__ import absolute_import from oslo_config import cfg -import vnftest.common.utils as utils +import vnftest.common.import_utils as import_utils -utils.import_modules_from_package("vnftest.dispatcher") +import_utils.import_modules_from_package("vnftest.dispatcher") CONF = cfg.CONF OPTS = [ diff --git a/vnftest/onap/onap_api_call.py b/vnftest/onap/onap_api_call.py deleted file mode 100644 index 9ab95e7..0000000 --- a/vnftest/onap/onap_api_call.py +++ /dev/null @@ -1,152 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## -from __future__ import absolute_import -import copy -import logging -import time - -import os -import yaml - -from vnftest.common import constants as consts, utils -from vnftest.common import rest_client -from vnftest.common.utils import dotdict -from vnftest.common.exceptions import MandatoryKeyException, InputParameterMissing -from vnftest.crawlers.base import Crawler -from vnftest.onap.common.vf_module_crawler import VfModuleCrawler -from vnftest.steps import base -import jinja2 -import jinja2.meta - -LOG = logging.getLogger(__name__) - - -class OnapApiCall(base.Step): - """Call ONAP API - """ - __step_type__ = "OnapApiCall" - - def __init__(self, step_cfg, context, input_params): - self.step_cfg = step_cfg - self.context = context - self.input_params = input_params - self.input_cfg = None - self.output_cfg = None - - self.rest_def_file = None - self.delay = None - self.setup_done = False - - def setup(self): - options = self.step_cfg['options'] - self.rest_def_file = options.get("file") - self.delay = options.get("delay", 0) - self.input_cfg = options.get("input", {}) - self.output_cfg = options.get("output", {}) - self.sla_cfg = self.step_cfg.get('sla', {'retries': 0}) - context_dict = {} - context_dict['creds'] = dotdict(self.context.creds) - context_dict['vnf_descriptor'] = dotdict(self.context.vnf_descriptor) - self.input_params['context'] = dotdict(context_dict) - self.setup_done = True - - def eval_input(self, params): - for input_parameter in self.input_cfg: - param_name = input_parameter['parameter_name'] - value = None - if 'value' in input_parameter: - value_def = input_parameter['value'] - value = utils.format(value_def, self.input_params) - if value is None or value == "": - raise InputParameterMissing(param_name=param_name, source="task configuration") - params[param_name] = value - - def run(self, result, attempt=0): - LOG.info("** Handling: " + str(self.rest_def_file)) - output = self.run_impl(result) - try: - self.handle_sla(output) - except AssertionError as e: - LOG.info(str(e)) - if attempt < self.sla_cfg['retries']: - time.sleep(self.sla_cfg['interval']) - LOG.info("retry operation") - attempt = attempt + 1 - return self.run(result, attempt) - else: - raise e - return output - - def run_impl(self, result): - if not self.setup_done: - self.setup() - params = copy.deepcopy(consts.component_constants) - self.eval_input(params) - execution_result = self.execute_operation(params) - result_body = execution_result['body'] - output = Crawler.crawl(result_body, self.output_cfg) - result.update(output) - return output - - def execute_operation(self, params, attempt=0): - if self.delay > 0: - time.sleep(self.delay) - try: - return self.execute_operation_impl(params) - except Exception as e: - LOG.info(str(e)) - if attempt < 3: - time.sleep(15) - LOG.info("############# retry operation ##########") - attempt = attempt + 1 - return self.execute_operation(params, attempt) - else: - raise e - - def execute_operation_impl(self, params): - operation = self.load_file(params) - url = operation['url'] - headers = operation.get('headers', {}) or {} - body = operation.get('body', {}) or {} - LOG.info(url) - LOG.info(headers) - LOG.info(body) - if 'file' in operation: - file_path = operation['file'] - LOG.info(file_path) - files = {'upload': open(file_path)} - result = rest_client.upload_file(url, headers, files, LOG) - else: - result = rest_client.call(url, - operation['method'], - headers, - body, - LOG) - if result['return_code'] >= 300: - raise RuntimeError( - "Operation failed. return_code:{}, message:{}".format(result['return_code'], result['body'])) - LOG.info("Results: " + str(result)) - return result - - def handle_sla(self, output): - if self.sla_cfg.get('action', "") == 'assert' and 'equals' in self.sla_cfg: - value_def = self.sla_cfg['value'] - value = utils.format(value_def, output) - expected_value = self.sla_cfg['equals'] - assert value == expected_value - - def load_file(self, params): - operation_template = utils.resource_as_string(self.rest_def_file) - operation = jinja2.Template(operation_template).render(**params) - return yaml.load(operation) diff --git a/vnftest/onap/onboard/accept_resource_test.yaml b/vnftest/onap/onboard/accept_resource_test.yaml deleted file mode 100644 index 2479f52..0000000 --- a/vnftest/onap/onboard/accept_resource_test.yaml +++ /dev/null @@ -1,26 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## - ---- -method: POST -url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/resources/{{resource_id}}/lifecycleState/certify -headers: - Content-Type: application/json - Authorization: Basic YmVlcDpib29w - USER_ID: {{sdc_tester_user}} - Accept: application/json - -body: - userRemarks: certified - diff --git a/vnftest/onap/onboard/accept_service_test.yaml b/vnftest/onap/onboard/accept_service_test.yaml deleted file mode 100644 index 6d38244..0000000 --- a/vnftest/onap/onboard/accept_service_test.yaml +++ /dev/null @@ -1,24 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## - ---- -method: POST -url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/services/{{sdc_service_id}}/lifecycleState/certify -headers: - Content-Type: application/json - Authorization: Basic YmVlcDpib29w - USER_ID: {{sdc_tester_user}} - Accept: application/json -body: - userRemarks: certified diff --git a/vnftest/onap/onboard/add_resource_instance.yaml b/vnftest/onap/onboard/add_resource_instance.yaml deleted file mode 100644 index e217bd7..0000000 --- a/vnftest/onap/onboard/add_resource_instance.yaml +++ /dev/null @@ -1,32 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## - ---- -method: POST -url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/services/{{sdc_service_id}}/resourceInstance -headers: - Content-Type: application/json - Authorization: Basic YmVlcDpib29w - USER_ID: {{sdc_designer_user}} - Accept: application/json - -body: - uniqueId: {{resource_instance_unique_id}} - posX: 500 - posY: 100 - name: {{resource_instance_name}} - componentVersion: 1.0 - originType: VF - icon: defaulticon - componentUid: {{resource_version_id}} diff --git a/vnftest/onap/onboard/add_service.yaml b/vnftest/onap/onboard/add_service.yaml deleted file mode 100644 index 91a6eff..0000000 --- a/vnftest/onap/onboard/add_service.yaml +++ /dev/null @@ -1,57 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## ---- -method: POST -url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/services -headers: - Content-Type: application/json - Authorization: Basic YmVlcDpib29w - USER_ID: {{sdc_designer_user}} - Accept: application/json - -body: - artifacts: - toscaArtifacts: - contactId: {{sdc_designer_user}} - categories: - - - name: Network L4+ - normalizedName: network l4+ - uniqueId: serviceNewCategory.network l4+ - icons: - - - network_l_4 - - subcategories: null - ownerId: null - description: service test - icon: defaulticon - componentInstancesProperties: - componentInstancesAttributes: - name: {{service_name}} - tags: - - - {{service_name}} - - capabilities: - requirements: - deploymentArtifacts: - componentType: SERVICE - projectCode: 100100 - componentInstances: [] - properties: [] - attributes: [] - groups: [] - ecompGeneratedNaming: true - serviceApiArtifacts: diff --git a/vnftest/onap/onboard/approve_distribution.yaml b/vnftest/onap/onboard/approve_distribution.yaml deleted file mode 100644 index a0f6a0d..0000000 --- a/vnftest/onap/onboard/approve_distribution.yaml +++ /dev/null @@ -1,23 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## ---- -method: POST -url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/services/{{service_version_id}}/distribution-state/approve -headers: - Content-Type: application/json - Authorization: Basic YmVlcDpib29w - USER_ID: {{sdc_governance_user}} - Accept: application/json -body: - userRemarks: approved diff --git a/vnftest/onap/onboard/checkin_vlm.yaml b/vnftest/onap/onboard/checkin_vlm.yaml deleted file mode 100644 index be77446..0000000 --- a/vnftest/onap/onboard/checkin_vlm.yaml +++ /dev/null @@ -1,24 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## - ---- -method: PUT -url: http://{{sdc_ip}}:{{sdc_port}}/onboarding-api/v1.0/vendor-license-models/{{vendor_id}}/versions/0.1/actions -headers: - Content-Type: application/json - Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== - USER_ID: {{sdc_designer_user}} - Accept: application/json -body: - action: Checkin diff --git a/vnftest/onap/onboard/checkin_vsp.yaml b/vnftest/onap/onboard/checkin_vsp.yaml deleted file mode 100644 index d0b9067..0000000 --- a/vnftest/onap/onboard/checkin_vsp.yaml +++ /dev/null @@ -1,24 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## ---- -method: PUT -url: http://{{sdc_ip}}:{{sdc_port}}/onboarding-api/v1.0/vendor-software-products/{{vsp_id}}/versions/0.1/actions -headers: - Content-Type: application/json - Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== - USER_ID: {{sdc_designer_user}} - Accept: application/json - -body: - action: Checkin diff --git a/vnftest/onap/onboard/create_package_vsp.yaml b/vnftest/onap/onboard/create_package_vsp.yaml deleted file mode 100644 index 85a7bc5..0000000 --- a/vnftest/onap/onboard/create_package_vsp.yaml +++ /dev/null @@ -1,24 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense Version2.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 -# -# 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 -############################################################################## ---- -method: PUT -url: http://{{sdc_ip}}:{{sdc_port}}/onboarding-api/v1.0/vendor-software-products/{{vsp_id}}/versions/0.1/actions -headers: - Content-Type: application/json - Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== - USER_ID: {{sdc_designer_user}} - Accept: application/json - -body: - action: Create_Package diff --git a/vnftest/onap/onboard/create_vlm.yaml b/vnftest/onap/onboard/create_vlm.yaml deleted file mode 100644 index 25418a9..0000000 --- a/vnftest/onap/onboard/create_vlm.yaml +++ /dev/null @@ -1,27 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## - ---- -method: POST -url: http://{{sdc_ip}}:{{sdc_port}}/onboarding-api/v1.0/vendor-license-models -headers: - Content-Type: application/json - Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== - USER_ID: {{sdc_designer_user}} - Accept: application/json - -body: - vendorName: {{vendor_name}} - description: vlm via dovetail - iconRef: icon \ No newline at end of file diff --git a/vnftest/onap/onboard/create_vsp.yaml b/vnftest/onap/onboard/create_vsp.yaml deleted file mode 100644 index 01d5d64..0000000 --- a/vnftest/onap/onboard/create_vsp.yaml +++ /dev/null @@ -1,32 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## ---- -method: POST -url: http://{{sdc_ip}}:{{sdc_port}}/onboarding-api/v1.0/vendor-software-products -headers: - Content-Type: application/json - Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== - USER_ID: {{sdc_designer_user}} - Accept: application/json - -body: - vendorId: {{vendor_id}} - name: {{vsp_name}} - category: resourceNewCategory.application l4+ - subCategory: resourceNewCategory.application l4+.firewall - description: vlm via dovetail - onboardingMethod: NetworkPackage - vendorName: dovetailVendor - icon: icon - licensingData: \ No newline at end of file diff --git a/vnftest/onap/onboard/distribute.yaml b/vnftest/onap/onboard/distribute.yaml deleted file mode 100644 index 70415bf..0000000 --- a/vnftest/onap/onboard/distribute.yaml +++ /dev/null @@ -1,23 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## ---- -method: POST -url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/services/{{service_version_id}}/distribution/PROD/activate -headers: - Content-Type: application/json - Authorization: Basic YmVlcDpib29w - USER_ID: {{sdc_operations_user}} - Accept: application/json - -body: diff --git a/vnftest/onap/onboard/import_vsp.yaml b/vnftest/onap/onboard/import_vsp.yaml deleted file mode 100644 index 539b427..0000000 --- a/vnftest/onap/onboard/import_vsp.yaml +++ /dev/null @@ -1,64 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## ---- -method: POST -url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/resources -headers: - Content-Type: application/json - Authorization: Basic YmVlcDpib29w - USER_ID: {{sdc_designer_user}} - Accept: application/json - -body: - artifacts: - toscaArtifacts: - contactId: {{sdc_designer_user}} - categories: - - - name: Application L4+ - normalizedName: application l4+ - uniqueId: resourceNewCategory.application l4+ - icons: null - subcategories: - - - name: Firewall - normalizedName: firewall - uniqueId: resourceNewCategory.application l4+.firewall - icons: - - - firewall - groupings: null - ownerId: null - ownerId: null - description: dovetail initiated - icon: defaulticon - componentInstancesProperties: - componentInstancesAttributes: - name: {{vsp_name}} - tags: - - - {{vsp_name}} - capabilities: - requirements: - deploymentArtifacts: - componentType: RESOURCE - vendorName: dovetailVendor - vendorRelease: 1.0 - componentInstances: [] - properties: [] - attributes: [] - groups: [] - resourceType: VF - csarUUID: {{vsp_id}} - csarVersion: 1.0 diff --git a/vnftest/onap/onboard/monitor_distribution.yaml b/vnftest/onap/onboard/monitor_distribution.yaml deleted file mode 100644 index 40ad7ad..0000000 --- a/vnftest/onap/onboard/monitor_distribution.yaml +++ /dev/null @@ -1,23 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## ---- -method: GET -url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/services/{{distributed_service_id}}/distribution -headers: - Content-Type: application/json - Authorization: Basic YmVlcDpib29w - USER_ID: {{sdc_operations_user}} - Accept: application/json - -body: diff --git a/vnftest/onap/onboard/process_package.yaml b/vnftest/onap/onboard/process_package.yaml deleted file mode 100644 index 20dc082..0000000 --- a/vnftest/onap/onboard/process_package.yaml +++ /dev/null @@ -1,21 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## ---- -method: PUT -url: http://{{sdc_ip}}:{{sdc_port}}/onboarding-api/v1.0/vendor-software-products/{{vsp_id}}/versions/0.1/orchestration-template-candidate/process -headers: - Content-Type: application/json - Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== - USER_ID: {{sdc_designer_user}} - Accept: application/json diff --git a/vnftest/onap/onboard/start_resource_test.yaml b/vnftest/onap/onboard/start_resource_test.yaml deleted file mode 100644 index b55c909..0000000 --- a/vnftest/onap/onboard/start_resource_test.yaml +++ /dev/null @@ -1,23 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## ---- -method: POST -url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/resources/{{resource_id}}/lifecycleState/startCertification -headers: - Content-Type: application/json - Authorization: Basic YmVlcDpib29w - USER_ID: {{sdc_tester_user}} - Accept: application/json - -body: {} diff --git a/vnftest/onap/onboard/start_service_test.yaml b/vnftest/onap/onboard/start_service_test.yaml deleted file mode 100644 index dff74b9..0000000 --- a/vnftest/onap/onboard/start_service_test.yaml +++ /dev/null @@ -1,22 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## ---- -method: POST -url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/services/{{sdc_service_id}}/lifecycleState/startCertification -headers: - Content-Type: application/json - Authorization: Basic YmVlcDpib29w - USER_ID: {{sdc_tester_user}} - Accept: application/json -body: {} diff --git a/vnftest/onap/onboard/submit_resource_for_testing.yaml b/vnftest/onap/onboard/submit_resource_for_testing.yaml deleted file mode 100644 index 22dbb64..0000000 --- a/vnftest/onap/onboard/submit_resource_for_testing.yaml +++ /dev/null @@ -1,24 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## ---- -method: POST -url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/resources/{{resource_id}}/lifecycleState/certificationRequest -headers: - Content-Type: application/json - Authorization: Basic YmVlcDpib29w - USER_ID: {{sdc_designer_user}} - Accept: application/json - -body: - userRemarks: resource submited for testing diff --git a/vnftest/onap/onboard/submit_service_for_testing.yaml b/vnftest/onap/onboard/submit_service_for_testing.yaml deleted file mode 100644 index 1910695..0000000 --- a/vnftest/onap/onboard/submit_service_for_testing.yaml +++ /dev/null @@ -1,24 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## ---- -method: POST -url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/services/{{sdc_service_id}}/lifecycleState/certificationRequest -headers: - Content-Type: application/json - Authorization: Basic YmVlcDpib29w - USER_ID: {{sdc_designer_user}} - Accept: application/json - -body: - userRemarks: resource submited for testing diff --git a/vnftest/onap/onboard/submit_vlm.yaml b/vnftest/onap/onboard/submit_vlm.yaml deleted file mode 100644 index 8fcd234..0000000 --- a/vnftest/onap/onboard/submit_vlm.yaml +++ /dev/null @@ -1,25 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## - ---- -method: PUT -url: http://{{sdc_ip}}:{{sdc_port}}/onboarding-api/v1.0/vendor-license-models/{{vendor_id}}/versions/0.1/actions -headers: - Content-Type: application/json - Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== - USER_ID: {{sdc_designer_user}} - Accept: application/json - -body: - action: Submit diff --git a/vnftest/onap/onboard/submit_vsp.yaml b/vnftest/onap/onboard/submit_vsp.yaml deleted file mode 100644 index 38fe218..0000000 --- a/vnftest/onap/onboard/submit_vsp.yaml +++ /dev/null @@ -1,24 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## ---- -method: PUT -url: http://{{sdc_ip}}:{{sdc_port}}/onboarding-api/v1.0/vendor-software-products/{{vsp_id}}/versions/0.1/actions -headers: - Content-Type: application/json - Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== - USER_ID: {{sdc_designer_user}} - Accept: application/json - -body: - action: Submit diff --git a/vnftest/onap/onboard/upload_package.yaml b/vnftest/onap/onboard/upload_package.yaml deleted file mode 100644 index 43bdae3..0000000 --- a/vnftest/onap/onboard/upload_package.yaml +++ /dev/null @@ -1,22 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## ---- -method: POST -url: http://{{sdc_ip}}:{{sdc_port}}/onboarding-api/v1.0/vendor-software-products/{{vsp_id}}/versions/0.1/orchestration-template-candidate -headers: - Content-Type: multipart/form-data - Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== - USER_ID: {{sdc_designer_user}} - Accept: application/json -file: {{package_file_path}} \ No newline at end of file diff --git a/vnftest/onap/onboard/v1/__init__.py b/vnftest/onap/onboard/v1/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/vnftest/onap/onboard/v1/accept_resource_test_v1.yaml b/vnftest/onap/onboard/v1/accept_resource_test_v1.yaml new file mode 100644 index 0000000..2479f52 --- /dev/null +++ b/vnftest/onap/onboard/v1/accept_resource_test_v1.yaml @@ -0,0 +1,26 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## + +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/resources/{{resource_id}}/lifecycleState/certify +headers: + Content-Type: application/json + Authorization: Basic YmVlcDpib29w + USER_ID: {{sdc_tester_user}} + Accept: application/json + +body: + userRemarks: certified + diff --git a/vnftest/onap/onboard/v1/accept_service_test_v1.yaml b/vnftest/onap/onboard/v1/accept_service_test_v1.yaml new file mode 100644 index 0000000..6d38244 --- /dev/null +++ b/vnftest/onap/onboard/v1/accept_service_test_v1.yaml @@ -0,0 +1,24 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## + +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/services/{{sdc_service_id}}/lifecycleState/certify +headers: + Content-Type: application/json + Authorization: Basic YmVlcDpib29w + USER_ID: {{sdc_tester_user}} + Accept: application/json +body: + userRemarks: certified diff --git a/vnftest/onap/onboard/v1/add_resource_instance_v1.yaml b/vnftest/onap/onboard/v1/add_resource_instance_v1.yaml new file mode 100644 index 0000000..e217bd7 --- /dev/null +++ b/vnftest/onap/onboard/v1/add_resource_instance_v1.yaml @@ -0,0 +1,32 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## + +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/services/{{sdc_service_id}}/resourceInstance +headers: + Content-Type: application/json + Authorization: Basic YmVlcDpib29w + USER_ID: {{sdc_designer_user}} + Accept: application/json + +body: + uniqueId: {{resource_instance_unique_id}} + posX: 500 + posY: 100 + name: {{resource_instance_name}} + componentVersion: 1.0 + originType: VF + icon: defaulticon + componentUid: {{resource_version_id}} diff --git a/vnftest/onap/onboard/v1/add_service_v1.yaml b/vnftest/onap/onboard/v1/add_service_v1.yaml new file mode 100644 index 0000000..91a6eff --- /dev/null +++ b/vnftest/onap/onboard/v1/add_service_v1.yaml @@ -0,0 +1,57 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/services +headers: + Content-Type: application/json + Authorization: Basic YmVlcDpib29w + USER_ID: {{sdc_designer_user}} + Accept: application/json + +body: + artifacts: + toscaArtifacts: + contactId: {{sdc_designer_user}} + categories: + - + name: Network L4+ + normalizedName: network l4+ + uniqueId: serviceNewCategory.network l4+ + icons: + - + network_l_4 + + subcategories: null + ownerId: null + description: service test + icon: defaulticon + componentInstancesProperties: + componentInstancesAttributes: + name: {{service_name}} + tags: + - + {{service_name}} + + capabilities: + requirements: + deploymentArtifacts: + componentType: SERVICE + projectCode: 100100 + componentInstances: [] + properties: [] + attributes: [] + groups: [] + ecompGeneratedNaming: true + serviceApiArtifacts: diff --git a/vnftest/onap/onboard/v1/approve_distribution_v1.yaml b/vnftest/onap/onboard/v1/approve_distribution_v1.yaml new file mode 100644 index 0000000..a0f6a0d --- /dev/null +++ b/vnftest/onap/onboard/v1/approve_distribution_v1.yaml @@ -0,0 +1,23 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/services/{{service_version_id}}/distribution-state/approve +headers: + Content-Type: application/json + Authorization: Basic YmVlcDpib29w + USER_ID: {{sdc_governance_user}} + Accept: application/json +body: + userRemarks: approved diff --git a/vnftest/onap/onboard/v1/checkin_vlm_v1.yaml b/vnftest/onap/onboard/v1/checkin_vlm_v1.yaml new file mode 100644 index 0000000..08fe493 --- /dev/null +++ b/vnftest/onap/onboard/v1/checkin_vlm_v1.yaml @@ -0,0 +1,24 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## + +--- +method: PUT +url: http://{{sdc_ip}}:{{sdc_port}}/sdc1/feProxy/onboarding-api/v1.0/vendor-license-models/{{vendor_id}}/versions/0.1/actions +headers: + Content-Type: application/json + Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== + USER_ID: {{sdc_designer_user}} + Accept: application/json +body: + action: Checkin diff --git a/vnftest/onap/onboard/v1/checkin_vsp_v1.yaml b/vnftest/onap/onboard/v1/checkin_vsp_v1.yaml new file mode 100644 index 0000000..95fb7e9 --- /dev/null +++ b/vnftest/onap/onboard/v1/checkin_vsp_v1.yaml @@ -0,0 +1,24 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: PUT +url: http://{{sdc_ip}}:{{sdc_port}}/sdc1/feProxy/onboarding-api/v1.0/vendor-software-products/{{vsp_id}}/versions/0.1/actions +headers: + Content-Type: application/json + Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== + USER_ID: {{sdc_designer_user}} + Accept: application/json + +body: + action: Checkin diff --git a/vnftest/onap/onboard/v1/create_package_vsp_v1.yaml b/vnftest/onap/onboard/v1/create_package_vsp_v1.yaml new file mode 100644 index 0000000..b023555 --- /dev/null +++ b/vnftest/onap/onboard/v1/create_package_vsp_v1.yaml @@ -0,0 +1,24 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense Version2.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 +# +# 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 +############################################################################## +--- +method: PUT +url: http://{{sdc_ip}}:{{sdc_port}}/sdc1/feProxy/onboarding-api/v1.0/vendor-software-products/{{vsp_id}}/versions/0.1/actions +headers: + Content-Type: application/json + Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== + USER_ID: {{sdc_designer_user}} + Accept: application/json + +body: + action: Create_Package diff --git a/vnftest/onap/onboard/v1/create_vlm_v1.yaml b/vnftest/onap/onboard/v1/create_vlm_v1.yaml new file mode 100644 index 0000000..4ca4c4c --- /dev/null +++ b/vnftest/onap/onboard/v1/create_vlm_v1.yaml @@ -0,0 +1,27 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## + +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_port}}/sdc1/feProxy/onboarding-api/v1.0/vendor-license-models +headers: + Content-Type: application/json + Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== + USER_ID: {{sdc_designer_user}} + Accept: application/json + +body: + vendorName: {{vendor_name}} + description: vlm via dovetail + iconRef: icon \ No newline at end of file diff --git a/vnftest/onap/onboard/v1/create_vsp_v1.yaml b/vnftest/onap/onboard/v1/create_vsp_v1.yaml new file mode 100644 index 0000000..4a3ac62 --- /dev/null +++ b/vnftest/onap/onboard/v1/create_vsp_v1.yaml @@ -0,0 +1,32 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_port}}/sdc1/feProxy/onboarding-api/v1.0/vendor-software-products +headers: + Content-Type: application/json + Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== + USER_ID: {{sdc_designer_user}} + Accept: application/json + +body: + vendorId: {{vendor_id}} + name: {{vsp_name}} + category: resourceNewCategory.application l4+ + subCategory: resourceNewCategory.application l4+.firewall + description: vlm via dovetail + onboardingMethod: NetworkPackage + vendorName: dovetailVendor + icon: icon + licensingData: \ No newline at end of file diff --git a/vnftest/onap/onboard/v1/distribute_v1.yaml b/vnftest/onap/onboard/v1/distribute_v1.yaml new file mode 100644 index 0000000..70415bf --- /dev/null +++ b/vnftest/onap/onboard/v1/distribute_v1.yaml @@ -0,0 +1,23 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/services/{{service_version_id}}/distribution/PROD/activate +headers: + Content-Type: application/json + Authorization: Basic YmVlcDpib29w + USER_ID: {{sdc_operations_user}} + Accept: application/json + +body: diff --git a/vnftest/onap/onboard/v1/import_vsp_v1.yaml b/vnftest/onap/onboard/v1/import_vsp_v1.yaml new file mode 100644 index 0000000..539b427 --- /dev/null +++ b/vnftest/onap/onboard/v1/import_vsp_v1.yaml @@ -0,0 +1,64 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/resources +headers: + Content-Type: application/json + Authorization: Basic YmVlcDpib29w + USER_ID: {{sdc_designer_user}} + Accept: application/json + +body: + artifacts: + toscaArtifacts: + contactId: {{sdc_designer_user}} + categories: + - + name: Application L4+ + normalizedName: application l4+ + uniqueId: resourceNewCategory.application l4+ + icons: null + subcategories: + - + name: Firewall + normalizedName: firewall + uniqueId: resourceNewCategory.application l4+.firewall + icons: + - + firewall + groupings: null + ownerId: null + ownerId: null + description: dovetail initiated + icon: defaulticon + componentInstancesProperties: + componentInstancesAttributes: + name: {{vsp_name}} + tags: + - + {{vsp_name}} + capabilities: + requirements: + deploymentArtifacts: + componentType: RESOURCE + vendorName: dovetailVendor + vendorRelease: 1.0 + componentInstances: [] + properties: [] + attributes: [] + groups: [] + resourceType: VF + csarUUID: {{vsp_id}} + csarVersion: 1.0 diff --git a/vnftest/onap/onboard/v1/monitor_distribution_v1.yaml b/vnftest/onap/onboard/v1/monitor_distribution_v1.yaml new file mode 100644 index 0000000..40ad7ad --- /dev/null +++ b/vnftest/onap/onboard/v1/monitor_distribution_v1.yaml @@ -0,0 +1,23 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: GET +url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/services/{{distributed_service_id}}/distribution +headers: + Content-Type: application/json + Authorization: Basic YmVlcDpib29w + USER_ID: {{sdc_operations_user}} + Accept: application/json + +body: diff --git a/vnftest/onap/onboard/v1/process_package_v1.yaml b/vnftest/onap/onboard/v1/process_package_v1.yaml new file mode 100644 index 0000000..3716571 --- /dev/null +++ b/vnftest/onap/onboard/v1/process_package_v1.yaml @@ -0,0 +1,21 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: PUT +url: http://{{sdc_ip}}:{{sdc_port}}/sdc1/feProxy/onboarding-api/v1.0/vendor-software-products/{{vsp_id}}/versions/0.1/orchestration-template-candidate/process +headers: + Content-Type: application/json + Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== + USER_ID: {{sdc_designer_user}} + Accept: application/json diff --git a/vnftest/onap/onboard/v1/start_resource_test_v1.yaml b/vnftest/onap/onboard/v1/start_resource_test_v1.yaml new file mode 100644 index 0000000..b55c909 --- /dev/null +++ b/vnftest/onap/onboard/v1/start_resource_test_v1.yaml @@ -0,0 +1,23 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/resources/{{resource_id}}/lifecycleState/startCertification +headers: + Content-Type: application/json + Authorization: Basic YmVlcDpib29w + USER_ID: {{sdc_tester_user}} + Accept: application/json + +body: {} diff --git a/vnftest/onap/onboard/v1/start_service_test_v1.yaml b/vnftest/onap/onboard/v1/start_service_test_v1.yaml new file mode 100644 index 0000000..dff74b9 --- /dev/null +++ b/vnftest/onap/onboard/v1/start_service_test_v1.yaml @@ -0,0 +1,22 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/services/{{sdc_service_id}}/lifecycleState/startCertification +headers: + Content-Type: application/json + Authorization: Basic YmVlcDpib29w + USER_ID: {{sdc_tester_user}} + Accept: application/json +body: {} diff --git a/vnftest/onap/onboard/v1/submit_resource_for_testing_v1.yaml b/vnftest/onap/onboard/v1/submit_resource_for_testing_v1.yaml new file mode 100644 index 0000000..22dbb64 --- /dev/null +++ b/vnftest/onap/onboard/v1/submit_resource_for_testing_v1.yaml @@ -0,0 +1,24 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/resources/{{resource_id}}/lifecycleState/certificationRequest +headers: + Content-Type: application/json + Authorization: Basic YmVlcDpib29w + USER_ID: {{sdc_designer_user}} + Accept: application/json + +body: + userRemarks: resource submited for testing diff --git a/vnftest/onap/onboard/v1/submit_service_for_testing_v1.yaml b/vnftest/onap/onboard/v1/submit_service_for_testing_v1.yaml new file mode 100644 index 0000000..1910695 --- /dev/null +++ b/vnftest/onap/onboard/v1/submit_service_for_testing_v1.yaml @@ -0,0 +1,24 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/services/{{sdc_service_id}}/lifecycleState/certificationRequest +headers: + Content-Type: application/json + Authorization: Basic YmVlcDpib29w + USER_ID: {{sdc_designer_user}} + Accept: application/json + +body: + userRemarks: resource submited for testing diff --git a/vnftest/onap/onboard/v1/submit_vlm_v1.yaml b/vnftest/onap/onboard/v1/submit_vlm_v1.yaml new file mode 100644 index 0000000..ab86627 --- /dev/null +++ b/vnftest/onap/onboard/v1/submit_vlm_v1.yaml @@ -0,0 +1,25 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## + +--- +method: PUT +url: http://{{sdc_ip}}:{{sdc_port}}/sdc1/feProxy/onboarding-api/v1.0/vendor-license-models/{{vendor_id}}/versions/0.1/actions +headers: + Content-Type: application/json + Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== + USER_ID: {{sdc_designer_user}} + Accept: application/json + +body: + action: Submit diff --git a/vnftest/onap/onboard/v1/submit_vsp_v1.yaml b/vnftest/onap/onboard/v1/submit_vsp_v1.yaml new file mode 100644 index 0000000..6b991fe --- /dev/null +++ b/vnftest/onap/onboard/v1/submit_vsp_v1.yaml @@ -0,0 +1,24 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: PUT +url: http://{{sdc_ip}}:{{sdc_port}}/sdc1/feProxy/onboarding-api/v1.0/vendor-software-products/{{vsp_id}}/versions/0.1/actions +headers: + Content-Type: application/json + Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== + USER_ID: {{sdc_designer_user}} + Accept: application/json + +body: + action: Submit diff --git a/vnftest/onap/onboard/v1/upload_package_v1.yaml b/vnftest/onap/onboard/v1/upload_package_v1.yaml new file mode 100644 index 0000000..33f1b6a --- /dev/null +++ b/vnftest/onap/onboard/v1/upload_package_v1.yaml @@ -0,0 +1,22 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_port}}/sdc1/feProxy/onboarding-api/v1.0/vendor-software-products/{{vsp_id}}/versions/0.1/orchestration-template-candidate +headers: + Content-Type: multipart/form-data + Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== + USER_ID: {{sdc_designer_user}} + Accept: application/json +file: {{package_file_path}} \ No newline at end of file diff --git a/vnftest/onap/onboard/v2/__init__.py b/vnftest/onap/onboard/v2/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/vnftest/onap/onboard/v2/accept_resource_test_v2.yaml b/vnftest/onap/onboard/v2/accept_resource_test_v2.yaml new file mode 100644 index 0000000..2479f52 --- /dev/null +++ b/vnftest/onap/onboard/v2/accept_resource_test_v2.yaml @@ -0,0 +1,26 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## + +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/resources/{{resource_id}}/lifecycleState/certify +headers: + Content-Type: application/json + Authorization: Basic YmVlcDpib29w + USER_ID: {{sdc_tester_user}} + Accept: application/json + +body: + userRemarks: certified + diff --git a/vnftest/onap/onboard/v2/accept_service_test_v2.yaml b/vnftest/onap/onboard/v2/accept_service_test_v2.yaml new file mode 100644 index 0000000..6d38244 --- /dev/null +++ b/vnftest/onap/onboard/v2/accept_service_test_v2.yaml @@ -0,0 +1,24 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## + +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/services/{{sdc_service_id}}/lifecycleState/certify +headers: + Content-Type: application/json + Authorization: Basic YmVlcDpib29w + USER_ID: {{sdc_tester_user}} + Accept: application/json +body: + userRemarks: certified diff --git a/vnftest/onap/onboard/v2/add_resource_instance_v2.yaml b/vnftest/onap/onboard/v2/add_resource_instance_v2.yaml new file mode 100644 index 0000000..e217bd7 --- /dev/null +++ b/vnftest/onap/onboard/v2/add_resource_instance_v2.yaml @@ -0,0 +1,32 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## + +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/services/{{sdc_service_id}}/resourceInstance +headers: + Content-Type: application/json + Authorization: Basic YmVlcDpib29w + USER_ID: {{sdc_designer_user}} + Accept: application/json + +body: + uniqueId: {{resource_instance_unique_id}} + posX: 500 + posY: 100 + name: {{resource_instance_name}} + componentVersion: 1.0 + originType: VF + icon: defaulticon + componentUid: {{resource_version_id}} diff --git a/vnftest/onap/onboard/v2/add_service_v2.yaml b/vnftest/onap/onboard/v2/add_service_v2.yaml new file mode 100644 index 0000000..91a6eff --- /dev/null +++ b/vnftest/onap/onboard/v2/add_service_v2.yaml @@ -0,0 +1,57 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/services +headers: + Content-Type: application/json + Authorization: Basic YmVlcDpib29w + USER_ID: {{sdc_designer_user}} + Accept: application/json + +body: + artifacts: + toscaArtifacts: + contactId: {{sdc_designer_user}} + categories: + - + name: Network L4+ + normalizedName: network l4+ + uniqueId: serviceNewCategory.network l4+ + icons: + - + network_l_4 + + subcategories: null + ownerId: null + description: service test + icon: defaulticon + componentInstancesProperties: + componentInstancesAttributes: + name: {{service_name}} + tags: + - + {{service_name}} + + capabilities: + requirements: + deploymentArtifacts: + componentType: SERVICE + projectCode: 100100 + componentInstances: [] + properties: [] + attributes: [] + groups: [] + ecompGeneratedNaming: true + serviceApiArtifacts: diff --git a/vnftest/onap/onboard/v2/approve_distribution_v2.yaml b/vnftest/onap/onboard/v2/approve_distribution_v2.yaml new file mode 100644 index 0000000..a0f6a0d --- /dev/null +++ b/vnftest/onap/onboard/v2/approve_distribution_v2.yaml @@ -0,0 +1,23 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/services/{{service_version_id}}/distribution-state/approve +headers: + Content-Type: application/json + Authorization: Basic YmVlcDpib29w + USER_ID: {{sdc_governance_user}} + Accept: application/json +body: + userRemarks: approved diff --git a/vnftest/onap/onboard/v2/checkin_vsp_v2.yaml b/vnftest/onap/onboard/v2/checkin_vsp_v2.yaml new file mode 100644 index 0000000..5db1930 --- /dev/null +++ b/vnftest/onap/onboard/v2/checkin_vsp_v2.yaml @@ -0,0 +1,24 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: PUT +url: http://{{sdc_ip}}:{{sdc_port}}/sdc1/feProxy/onboarding-api/v1.0/vendor-software-products/{{vsp_id}}/versions/{{vsp_version_id}}/actions +headers: + Content-Type: application/json + Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== + USER_ID: {{sdc_designer_user}} + Accept: application/json + +body: + action: Checkin diff --git a/vnftest/onap/onboard/v2/create_package_vsp_v2.yaml b/vnftest/onap/onboard/v2/create_package_vsp_v2.yaml new file mode 100644 index 0000000..dadc34a --- /dev/null +++ b/vnftest/onap/onboard/v2/create_package_vsp_v2.yaml @@ -0,0 +1,24 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense Version2.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 +# +# 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 +############################################################################## +--- +method: PUT +url: http://{{sdc_ip}}:{{sdc_port}}/sdc1/feProxy/onboarding-api/v1.0/vendor-software-products/{{vsp_id}}/versions/{{vsp_version_id}}/actions +headers: + Content-Type: application/json + Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== + USER_ID: {{sdc_designer_user}} + Accept: application/json + +body: + action: Create_Package diff --git a/vnftest/onap/onboard/v2/create_vlm_v2.yaml b/vnftest/onap/onboard/v2/create_vlm_v2.yaml new file mode 100644 index 0000000..4ca4c4c --- /dev/null +++ b/vnftest/onap/onboard/v2/create_vlm_v2.yaml @@ -0,0 +1,27 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## + +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_port}}/sdc1/feProxy/onboarding-api/v1.0/vendor-license-models +headers: + Content-Type: application/json + Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== + USER_ID: {{sdc_designer_user}} + Accept: application/json + +body: + vendorName: {{vendor_name}} + description: vlm via dovetail + iconRef: icon \ No newline at end of file diff --git a/vnftest/onap/onboard/v2/create_vsp_v2.yaml b/vnftest/onap/onboard/v2/create_vsp_v2.yaml new file mode 100644 index 0000000..4a3ac62 --- /dev/null +++ b/vnftest/onap/onboard/v2/create_vsp_v2.yaml @@ -0,0 +1,32 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_port}}/sdc1/feProxy/onboarding-api/v1.0/vendor-software-products +headers: + Content-Type: application/json + Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== + USER_ID: {{sdc_designer_user}} + Accept: application/json + +body: + vendorId: {{vendor_id}} + name: {{vsp_name}} + category: resourceNewCategory.application l4+ + subCategory: resourceNewCategory.application l4+.firewall + description: vlm via dovetail + onboardingMethod: NetworkPackage + vendorName: dovetailVendor + icon: icon + licensingData: \ No newline at end of file diff --git a/vnftest/onap/onboard/v2/distribute_v2.yaml b/vnftest/onap/onboard/v2/distribute_v2.yaml new file mode 100644 index 0000000..70415bf --- /dev/null +++ b/vnftest/onap/onboard/v2/distribute_v2.yaml @@ -0,0 +1,23 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/services/{{service_version_id}}/distribution/PROD/activate +headers: + Content-Type: application/json + Authorization: Basic YmVlcDpib29w + USER_ID: {{sdc_operations_user}} + Accept: application/json + +body: diff --git a/vnftest/onap/onboard/v2/import_vsp_v2.yaml b/vnftest/onap/onboard/v2/import_vsp_v2.yaml new file mode 100644 index 0000000..539b427 --- /dev/null +++ b/vnftest/onap/onboard/v2/import_vsp_v2.yaml @@ -0,0 +1,64 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/resources +headers: + Content-Type: application/json + Authorization: Basic YmVlcDpib29w + USER_ID: {{sdc_designer_user}} + Accept: application/json + +body: + artifacts: + toscaArtifacts: + contactId: {{sdc_designer_user}} + categories: + - + name: Application L4+ + normalizedName: application l4+ + uniqueId: resourceNewCategory.application l4+ + icons: null + subcategories: + - + name: Firewall + normalizedName: firewall + uniqueId: resourceNewCategory.application l4+.firewall + icons: + - + firewall + groupings: null + ownerId: null + ownerId: null + description: dovetail initiated + icon: defaulticon + componentInstancesProperties: + componentInstancesAttributes: + name: {{vsp_name}} + tags: + - + {{vsp_name}} + capabilities: + requirements: + deploymentArtifacts: + componentType: RESOURCE + vendorName: dovetailVendor + vendorRelease: 1.0 + componentInstances: [] + properties: [] + attributes: [] + groups: [] + resourceType: VF + csarUUID: {{vsp_id}} + csarVersion: 1.0 diff --git a/vnftest/onap/onboard/v2/monitor_distribution_v2.yaml b/vnftest/onap/onboard/v2/monitor_distribution_v2.yaml new file mode 100644 index 0000000..40ad7ad --- /dev/null +++ b/vnftest/onap/onboard/v2/monitor_distribution_v2.yaml @@ -0,0 +1,23 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: GET +url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/services/{{distributed_service_id}}/distribution +headers: + Content-Type: application/json + Authorization: Basic YmVlcDpib29w + USER_ID: {{sdc_operations_user}} + Accept: application/json + +body: diff --git a/vnftest/onap/onboard/v2/process_package_v2.yaml b/vnftest/onap/onboard/v2/process_package_v2.yaml new file mode 100644 index 0000000..4d8d3a3 --- /dev/null +++ b/vnftest/onap/onboard/v2/process_package_v2.yaml @@ -0,0 +1,21 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: PUT +url: http://{{sdc_ip}}:{{sdc_port}}/sdc1/feProxy/onboarding-api/v1.0/vendor-software-products/{{vsp_id}}/versions/{{vsp_version_id}}/orchestration-template-candidate/process +headers: + Content-Type: application/json + Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== + USER_ID: {{sdc_designer_user}} + Accept: application/json diff --git a/vnftest/onap/onboard/v2/start_resource_test_v2.yaml b/vnftest/onap/onboard/v2/start_resource_test_v2.yaml new file mode 100644 index 0000000..b55c909 --- /dev/null +++ b/vnftest/onap/onboard/v2/start_resource_test_v2.yaml @@ -0,0 +1,23 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/resources/{{resource_id}}/lifecycleState/startCertification +headers: + Content-Type: application/json + Authorization: Basic YmVlcDpib29w + USER_ID: {{sdc_tester_user}} + Accept: application/json + +body: {} diff --git a/vnftest/onap/onboard/v2/start_service_test_v2.yaml b/vnftest/onap/onboard/v2/start_service_test_v2.yaml new file mode 100644 index 0000000..dff74b9 --- /dev/null +++ b/vnftest/onap/onboard/v2/start_service_test_v2.yaml @@ -0,0 +1,22 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/services/{{sdc_service_id}}/lifecycleState/startCertification +headers: + Content-Type: application/json + Authorization: Basic YmVlcDpib29w + USER_ID: {{sdc_tester_user}} + Accept: application/json +body: {} diff --git a/vnftest/onap/onboard/v2/submit_resource_for_testing_v2.yaml b/vnftest/onap/onboard/v2/submit_resource_for_testing_v2.yaml new file mode 100644 index 0000000..22dbb64 --- /dev/null +++ b/vnftest/onap/onboard/v2/submit_resource_for_testing_v2.yaml @@ -0,0 +1,24 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/resources/{{resource_id}}/lifecycleState/certificationRequest +headers: + Content-Type: application/json + Authorization: Basic YmVlcDpib29w + USER_ID: {{sdc_designer_user}} + Accept: application/json + +body: + userRemarks: resource submited for testing diff --git a/vnftest/onap/onboard/v2/submit_service_for_testing_v2.yaml b/vnftest/onap/onboard/v2/submit_service_for_testing_v2.yaml new file mode 100644 index 0000000..1910695 --- /dev/null +++ b/vnftest/onap/onboard/v2/submit_service_for_testing_v2.yaml @@ -0,0 +1,24 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_catalog_port}}/sdc1/feProxy/rest/v1/catalog/services/{{sdc_service_id}}/lifecycleState/certificationRequest +headers: + Content-Type: application/json + Authorization: Basic YmVlcDpib29w + USER_ID: {{sdc_designer_user}} + Accept: application/json + +body: + userRemarks: resource submited for testing diff --git a/vnftest/onap/onboard/v2/submit_vlm_v2.yaml b/vnftest/onap/onboard/v2/submit_vlm_v2.yaml new file mode 100644 index 0000000..b05331f --- /dev/null +++ b/vnftest/onap/onboard/v2/submit_vlm_v2.yaml @@ -0,0 +1,25 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## + +--- +method: PUT +url: http://{{sdc_ip}}:{{sdc_port}}/sdc1/feProxy/onboarding-api/v1.0/vendor-license-models/{{vendor_id}}/versions/{{vlm_version_id}}/actions +headers: + Content-Type: application/json + Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== + USER_ID: {{sdc_designer_user}} + Accept: application/json + +body: + action: Submit diff --git a/vnftest/onap/onboard/v2/submit_vsp_v2.yaml b/vnftest/onap/onboard/v2/submit_vsp_v2.yaml new file mode 100644 index 0000000..a85f63f --- /dev/null +++ b/vnftest/onap/onboard/v2/submit_vsp_v2.yaml @@ -0,0 +1,24 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: PUT +url: http://{{sdc_ip}}:{{sdc_port}}/sdc1/feProxy/onboarding-api/v1.0/vendor-software-products/{{vsp_id}}/versions/{{vsp_version_id}}/actions +headers: + Content-Type: application/json + Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== + USER_ID: {{sdc_designer_user}} + Accept: application/json + +body: + action: Submit diff --git a/vnftest/onap/onboard/v2/upload_package_v2.yaml b/vnftest/onap/onboard/v2/upload_package_v2.yaml new file mode 100644 index 0000000..e623438 --- /dev/null +++ b/vnftest/onap/onboard/v2/upload_package_v2.yaml @@ -0,0 +1,22 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +--- +method: POST +url: http://{{sdc_ip}}:{{sdc_port}}/sdc1/feProxy/onboarding-api/v1.0/vendor-software-products/{{vsp_id}}/versions/{{vsp_version_id}}/orchestration-template-candidate +headers: + Content-Type: multipart/form-data + Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== + USER_ID: {{sdc_designer_user}} + Accept: application/json +file: {{package_file_path}} \ No newline at end of file diff --git a/vnftest/onap/steps/validation/vf_module_validator.py b/vnftest/onap/steps/validation/vf_module_validator.py index 63caf58..1b54fad 100644 --- a/vnftest/onap/steps/validation/vf_module_validator.py +++ b/vnftest/onap/steps/validation/vf_module_validator.py @@ -14,11 +14,11 @@ from __future__ import absolute_import -from vnftest.common import openstack_utils, utils - -from vnftest.onap.onap_api_call import OnapApiCall import logging +from vnftest.steps.rest_call import RestCall + +from vnftest.common import openstack_utils, utils from vnftest.steps import base LOG = logging.getLogger(__name__) @@ -57,7 +57,8 @@ class VfModuleValidator(base.Step): 'value': self.vf_module_instance_id} ] step_conf['output'] = {'heat_stack_id': '[heat-stack-id]'} - onap_api_call = OnapApiCall(step_conf, self.context, self.input_params) - output = onap_api_call.run({}) + options = {'options': step_conf} + rest_call = RestCall(options, self.context, self.input_params) + output = rest_call.run({}) return output['heat_stack_id'] diff --git a/vnftest/runners/base.py b/vnftest/runners/base.py index 7310d9b..28127af 100755 --- a/vnftest/runners/base.py +++ b/vnftest/runners/base.py @@ -26,7 +26,6 @@ from Queue import Empty import vnftest.common.utils as utils from vnftest.steps import base as base_step -from vnftest.onap.onap_api_call import OnapApiCall log = logging.getLogger(__name__) diff --git a/vnftest/steps/rest_call.py b/vnftest/steps/rest_call.py new file mode 100644 index 0000000..f8b1cf7 --- /dev/null +++ b/vnftest/steps/rest_call.py @@ -0,0 +1,151 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## +from __future__ import absolute_import +import copy +import logging +import time + +import os +import yaml + +from vnftest.common import constants as consts, utils +from vnftest.common import rest_client +from vnftest.common.utils import dotdict +from vnftest.common.exceptions import MandatoryKeyException, InputParameterMissing +from vnftest.crawlers.base import Crawler +from vnftest.steps import base +import jinja2 +import jinja2.meta + +LOG = logging.getLogger(__name__) + + +class RestCall(base.Step): + """Call REST API + """ + __step_type__ = "RestCall" + + def __init__(self, step_cfg, context, input_params): + self.step_cfg = step_cfg + self.context = context + self.input_params = input_params + self.input_cfg = None + self.output_cfg = None + + self.rest_def_file = None + self.delay = None + self.setup_done = False + + def setup(self): + options = self.step_cfg['options'] + self.rest_def_file = options.get("file") + self.delay = options.get("delay", 0) + self.input_cfg = options.get("input", {}) + self.output_cfg = options.get("output", {}) + self.sla_cfg = self.step_cfg.get('sla', {'retries': 0}) + context_dict = {} + context_dict['creds'] = dotdict(self.context.creds) + context_dict['vnf_descriptor'] = dotdict(self.context.vnf_descriptor) + self.input_params['context'] = dotdict(context_dict) + self.setup_done = True + + def eval_input(self, params): + for input_parameter in self.input_cfg: + param_name = input_parameter['parameter_name'] + value = None + if 'value' in input_parameter: + value_def = input_parameter['value'] + value = utils.format(value_def, self.input_params) + if value is None or value == "": + raise InputParameterMissing(param_name=param_name, source="task configuration") + params[param_name] = value + + def run(self, result, attempt=0): + LOG.info("** Handling: " + str(self.rest_def_file)) + output = self.run_impl(result) + try: + self.handle_sla(output) + except AssertionError as e: + LOG.info(str(e)) + if attempt < self.sla_cfg['retries']: + time.sleep(self.sla_cfg['interval']) + LOG.info("retry operation") + attempt = attempt + 1 + return self.run(result, attempt) + else: + raise e + return output + + def run_impl(self, result): + if not self.setup_done: + self.setup() + params = copy.deepcopy(self.context.onap_env_config) + self.eval_input(params) + execution_result = self.execute_operation(params) + result_body = execution_result['body'] + output = Crawler.crawl(result_body, self.output_cfg) + result.update(output) + return output + + def execute_operation(self, params, attempt=0): + if self.delay > 0: + time.sleep(self.delay) + try: + return self.execute_operation_impl(params) + except Exception as e: + LOG.info(str(e)) + if attempt < 3: + time.sleep(15) + LOG.info("############# retry operation ##########") + attempt = attempt + 1 + return self.execute_operation(params, attempt) + else: + raise e + + def execute_operation_impl(self, params): + operation = self.load_file(params) + url = operation['url'] + headers = operation.get('headers', {}) or {} + body = operation.get('body', {}) or {} + LOG.info(url) + LOG.info(headers) + LOG.info(body) + if 'file' in operation: + file_path = operation['file'] + LOG.info(file_path) + files = {'upload': open(file_path)} + result = rest_client.upload_file(url, headers, files, LOG) + else: + result = rest_client.call(url, + operation['method'], + headers, + body, + LOG) + if result['return_code'] >= 300: + raise RuntimeError( + "Operation failed. return_code:{}, message:{}".format(result['return_code'], result['body'])) + LOG.info("Results: " + str(result)) + return result + + def handle_sla(self, output): + if self.sla_cfg.get('action', "") == 'assert' and 'equals' in self.sla_cfg: + value_def = self.sla_cfg['value'] + value = utils.format(value_def, output) + expected_value = self.sla_cfg['equals'] + assert value == expected_value + + def load_file(self, params): + operation_template = utils.resource_as_string(self.rest_def_file) + operation = jinja2.Template(operation_template).render(**params) + return yaml.load(operation) diff --git a/vnftest/test_config/onap/test_cases/onap_vnftest_instantiate-v1.yaml b/vnftest/test_config/onap/test_cases/onap_vnftest_instantiate-v1.yaml new file mode 100644 index 0000000..addee64 --- /dev/null +++ b/vnftest/test_config/onap/test_cases/onap_vnftest_instantiate-v1.yaml @@ -0,0 +1,363 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## + +--- +schema: "vnftest:task:0.1" +description: > + Vnftest TC002 config file; + Instantiate VNF + +{% set rnd = rnd or range(10000)|random %} +# Optional input parameters +{% set cloud_owner = cloud_owner or ['test_cloud_', rnd ]|join %} +{% set customer_name = customer_name or ['test_customer_', rnd ]|join %} +{% set service_instance_name = service_instance_name or ['test_service_instance_', rnd ]|join %} +{% set vnf_instance_name = vnf_instance_name or ['test_vnf_instance_', rnd ]|join %} + +# Mandatory input parameters +{% set service_model_version_id = service_model_version_id or '\"\u007Bservice_model_version_id\u007D\"' %} +{% set service_model_version = service_model_version or '\"\u007Bservice_model_version\u007D\"' %} +{% set service_model_normalized_name = service_model_normalized_name or '\"\u007Bservice_model_normalized_name\u007D\"' %} +{% set service_model_invariant_id = service_model_invariant_id or '\"\u007Bservice_model_invariant_id\u007D\"' %} +{% set service_model_name = service_model_name or '\"\u007Bservice_model_name\u007D\"' %} +{% set service_model_customization_id = service_model_customization_id or '\"\u007Bservice_model_customization_id\u007D\"' %} +{% set resource_model_invariant_id = resource_model_invariant_id or '\"\u007Bresource_model_invariant_id\u007D\"' %} +{% set resource_model_version_id = resource_model_version_id or '\"\u007Bresource_model_version_id\u007D\"' %} +{% set resource_model_name = resource_model_name or '\"\u007Bresource_model_name\u007D\"' %} +{% set resource_model_version = resource_model_version or '\"\u007Bresource_model_version\u007D\"' %} +{% set resource_model_customization_id = resource_model_customization_id or '\"\u007Bresource_model_customization_id\u007D\"' %} +{% set resource_model_customization_name = resource_model_customization_name or '\"\u007Bresource_model_customization_name\u007D\"' %} +{% set distributed_service_id = distributed_service_id or '\"\u007Bdistributed_service_id\u007D\"' %} +{% set resource_instance_model_name = resource_instance_model_name or '\"\u007Bresource_instance_model_name\u007D\"' %} +{% set vf_modules_list = vf_modules_list or {}%} + +steps: +- + type: RestCall + options: + file: "vnftest/onap/lifecycle/create_region.yaml" + input: + - + parameter_name: "cloud_owner" + value: {{cloud_owner}} + - + parameter_name: "tenant_id" + value: "{context.creds.tenant_id}" + - + parameter_name: "tenant_name" + value: "{context.creds.tenant_name}" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/lifecycle/create_service.yaml" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/lifecycle/create_customer.yaml" + input: + - + parameter_name: "customer_name" + value: {{customer_name}} + - + parameter_name: "cloud_owner" + value: {{cloud_owner}} + - + parameter_name: "tenant_id" + value: "{context.creds.tenant_id}" +- + type: RestCall + options: + file: "vnftest/onap/lifecycle/create_service_instance.yaml" + delay: 60 + input: + - + parameter_name: "service_instance_name" + value: {{service_instance_name}} + - + parameter_name: "service_model_version_id" + value: {{service_model_version_id}} + - + parameter_name: "service_model_version" + value: {{service_model_version}} + - + parameter_name: "service_model_normalized_name" + value: {{service_model_normalized_name}} + - + parameter_name: "service_model_invariant_id" + value: {{service_model_invariant_id}} + - + parameter_name: "customer_name" + value: {{customer_name}} + output: + - + parameter_name: "service_instance_id" + value: "[requestReferences][instanceId]" + - + parameter_name: "request_id" + value: "[requestReferences][requestId]" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/lifecycle/monitor_request.yaml" + input: + - + parameter_name: "request_id" + value: "{request_id}" + output: + - + parameter_name: "request_state" + value: "[request][requestStatus][requestState]" + sla: + action: assert + value: "{request_state}" + equals: "COMPLETE" + retries: 15 + interval: 5 + +- + type: RestCall + options: + file: "vnftest/onap/lifecycle/create_vnf_instance.yaml" + delay: 30 + input: + - + parameter_name: "service_instance_id" + value: "{service_instance_id}" + - + parameter_name: "vnf_instance_name" + value: {{vnf_instance_name}} + - + parameter_name: "resource_model_invariant_id" + value: {{resource_model_invariant_id}} + - + parameter_name: "resource_model_version_id" + value: {{resource_model_version_id}} + - + parameter_name: "resource_model_name" + value: {{resource_model_name}} + - + parameter_name: "resource_model_version" + value: {{resource_model_version}} + - + parameter_name: "resource_model_customization_id" + value: {{resource_model_customization_id}} + - + parameter_name: "resource_model_customization_name" + value: {{resource_model_customization_name}} + - + parameter_name: "tenant_id" + value: "{context.creds.tenant_id}" + - + parameter_name: "service_model_name" + value: {{service_model_name}} + - + parameter_name: "service_model_invariant_id" + value: {{service_model_invariant_id}} + - + parameter_name: "service_model_version" + value: {{service_model_version}} + - + parameter_name: "distributed_service_id" + value: {{distributed_service_id}} + + output: + - + parameter_name: "vnf_instance_id" + value: "[requestReferences][instanceId]" + - + parameter_name: "request_id" + value: "[requestReferences][requestId]" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/lifecycle/monitor_request.yaml" + input: + - + parameter_name: "request_id" + value: "{request_id}" + output: + - + parameter_name: "request_state" + value: "[request][requestStatus][requestState]" + sla: + action: assert + value: "{request_state}" + equals: "COMPLETE" + retries: 15 + interval: 5 + runner: + type: Iteration + run_step: "setup,run" + +{% for vf_module_definition in vnf_descriptor.vf_modules %} + {% set vf_module = vf_modules_list[vf_module_definition.module_name] %} + {% set vnf_name = ['test_vnf_', rnd, '_', vf_module_definition.module_name ]|join %} +- + type: RestCall + options: + file: "vnftest/onap/lifecycle/preload_sdnc.yaml" + input: + - + parameter_name: "vnf_parameters" + value: {{vf_module_definition.vnf_parameters}} + - + parameter_name: "vnf_name" + value: {{vnf_name}} + - + parameter_name: "vnf_instance_name" + value: {{vnf_instance_name}} + - + parameter_name: "service_model_name" + value: {{service_model_name}} + - + parameter_name: "resource_instance_model_name" + value: {{resource_instance_model_name}} + - + parameter_name: "service_instance_id" + value: "{service_instance_id}" + - + parameter_name: "vnf_type" + value: {{vf_module.groupName}} + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/lifecycle/create_vf_module.yaml" + delay: 30 + input: + - + parameter_name: "user_parameters" + value: {{vf_module_definition.user_parameters}} + - + parameter_name: "service_instance_id" + value: "{service_instance_id}" + - + parameter_name: "vnf_instance_id" + value: "{vnf_instance_id}" + - + parameter_name: "vnf_name" + value: {{vnf_name}} + - + parameter_name: "module_model_invariant_id" + value: {{vf_module.invariantUUID}} + - + parameter_name: "module_model_version_id" + value: {{vf_module.groupUUID}} + - + parameter_name: "vnf_type" + value: {{vf_module.groupName}} + - + parameter_name: "module_model_version" + value: {{vf_module.version}} + - + parameter_name: "module_model_customization_id" + value: {{vf_module.customizationUUID}} + - + parameter_name: "tenant_id" + value: "{context.creds.tenant_id}" + - + parameter_name: "service_model_name" + value: {{service_model_name}} + - + parameter_name: "service_model_invariant_id" + value: {{service_model_invariant_id}} + - + parameter_name: "service_model_version" + value: {{service_model_version}} + - + parameter_name: "distributed_service_id" + value: {{distributed_service_id}} + - + parameter_name: "resource_model_name" + value: {{resource_model_name}} + - + parameter_name: "resource_model_invariant_id" + value: {{resource_model_invariant_id}} + - + parameter_name: "resource_model_version" + value: {{resource_model_version}} + - + parameter_name: "resource_model_version_id" + value: {{resource_model_version_id}} + - + parameter_name: "resource_model_customization_id" + value: {{resource_model_customization_id}} + - + parameter_name: "resource_model_customization_name" + value: {{resource_model_customization_name}} + + output: + - + parameter_name: "vf_module_instance_id" + value: "[requestReferences][instanceId]" + - + parameter_name: "request_id" + value: "[requestReferences][requestId]" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/lifecycle/monitor_request.yaml" + input: + - + parameter_name: "request_id" + value: "{request_id}" + output: + - + parameter_name: "request_state" + value: "[request][requestStatus][requestState]" + sla: + action: assert + value: "{request_state}" + equals: "COMPLETE" + retries: 15 + interval: 5 + + runner: + type: Iteration + run_step: "setup,run" +- + type: VfModuleValidator + options: + vnf_instance_id: "{vnf_instance_id}" + vf_module_instance_id: "{vf_module_instance_id}" + runner: + type: Iteration + run_step: "setup,run" + +{% endfor %} +context: + type: CSAR \ No newline at end of file diff --git a/vnftest/test_config/onap/test_cases/onap_vnftest_onboard-v1.yaml b/vnftest/test_config/onap/test_cases/onap_vnftest_onboard-v1.yaml new file mode 100644 index 0000000..c0fcc84 --- /dev/null +++ b/vnftest/test_config/onap/test_cases/onap_vnftest_onboard-v1.yaml @@ -0,0 +1,374 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## + +--- +schema: "vnftest:task:0.1" +description: > + Vnftest TC001 config file; + Onboard VNF package to SDC +{% set rnd = range(10000)|random %} +{% set vsp_name = vsp_name or ['test_vsp_', rnd ]|join %} +{% set vendor_name = vendor_name or ['test_vendor_', rnd ]|join %} +{% set service_name = service_name or ['test_service_', rnd ]|join %} +{% set resource_instance_name = resource_instance_name or ["test_resource_instance_", rnd ]|join %} +{% set resource_instance_unique_id = resource_instance_unique_id or ['\"\u007Bresource_version_id\u007D_', rnd, '\"']|join %} +steps: +- + type: RestCall + options: + file: "vnftest/onap/onboard/v1/create_vlm_v1.yaml" + input: + - + parameter_name: "vendor_name" + value: {{vendor_name}} + output: + - + parameter_name: "vendor_id" + value: "[value]" + runner: + type: Iteration + run_step: "setup,run" +- + type: RestCall + options: + file: "vnftest/onap/onboard/v1/checkin_vlm_v1.yaml" + input: + - + parameter_name: "vendor_id" + value: "{vendor_id}" + runner: + type: Iteration + run_step: "setup,run" +- + type: RestCall + options: + file: "vnftest/onap/onboard/v1/submit_vlm_v1.yaml" + input: + - + parameter_name: "vendor_id" + value: "{vendor_id}" + runner: + type: Iteration + run_step: "setup,run" +- + type: RestCall + options: + file: "vnftest/onap/onboard/v1/create_vsp_v1.yaml" + input: + - + parameter_name: "vendor_id" + value: "{vendor_id}" + - + parameter_name: "vsp_name" + value: {{vsp_name}} + output: + - + parameter_name: "vsp_id" + value: "[vspId]" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v1/upload_package_v1.yaml" + input: + - + parameter_name: "vsp_id" + value: "{vsp_id}" + - + parameter_name: "package_file_path" + value: "{context.vnf_descriptor.package_location}" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v1/process_package_v1.yaml" + input: + - + parameter_name: "vsp_id" + value: "{vsp_id}" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v1/checkin_vsp_v1.yaml" + input: + - + parameter_name: "vsp_id" + value: "{vsp_id}" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v1/submit_vsp_v1.yaml" + input: + - + parameter_name: "vsp_id" + value: "{vsp_id}" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v1/create_package_vsp_v1.yaml" + input: + - + parameter_name: "vsp_id" + value: "{vsp_id}" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v1/import_vsp_v1.yaml" + input: + - + parameter_name: "vsp_name" + value: {{vsp_name}} + - + parameter_name: "vsp_id" + value: "{vsp_id}" + output: + - + parameter_name: "resource_id" + value: "[uniqueId]" + + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v1/submit_resource_for_testing_v1.yaml" + input: + - + parameter_name: "resource_id" + value: "{resource_id}" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v1/start_resource_test_v1.yaml" + input: + - + parameter_name: "resource_id" + value: "{resource_id}" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v1/accept_resource_test_v1.yaml" + input: + - + parameter_name: "resource_id" + value: "{resource_id}" + output: + - + parameter_name: "resource_version_id" + value: "[allVersions][1.0]" + - + parameter_name: "resource_model_invariant_id" + value: "[invariantUUID]" + - + parameter_name: "resource_model_version_id" + value: "[uuid]" + - + parameter_name: "resource_model_name" + value: "[name]" + - + parameter_name: "resource_model_version" + value: "[version]" + + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v1/add_service_v1.yaml" + input: + - + parameter_name: "service_name" + value: {{service_name}} + output: + - + parameter_name: "sdc_service_id" + value: "[uniqueId]" + - + parameter_name: "service_model_name" + value: "[name]" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v1/add_resource_instance_v1.yaml" + input: + - + parameter_name: "resource_instance_unique_id" + value: {{resource_instance_unique_id}} + - + parameter_name: "resource_instance_name" + value: {{resource_instance_name}} + - + parameter_name: "sdc_service_id" + value: "{sdc_service_id}" + - + parameter_name: "resource_version_id" + value: "{resource_version_id}" + output: + - + parameter_name: "resource_model_customization_id" + value: "[customizationUUID]" + - + parameter_name: "resource_model_customization_name" + value: "[normalizedName]" + - + parameter_name: "resource_instance_model_name" + value: "[name]" + + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v1/submit_service_for_testing_v1.yaml" + input: + - + parameter_name: "sdc_service_id" + value: "{sdc_service_id}" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v1/start_service_test_v1.yaml" + input: + - + parameter_name: "sdc_service_id" + value: "{sdc_service_id}" + runner: + type: Iteration + run_step: "setup,run" +- + type: RestCall + options: + file: "vnftest/onap/onboard/v1/accept_service_test_v1.yaml" + input: + - + parameter_name: "sdc_service_id" + value: "{sdc_service_id}" + output: + - + parameter_name: "service_version_id" + value: "[allVersions][1.0]" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v1/approve_distribution_v1.yaml" + input: + - + parameter_name: "service_version_id" + value: "{service_version_id}" + runner: + type: Iteration + run_step: "setup,run" +- + type: RestCall + options: + file: "vnftest/onap/onboard/v1/distribute_v1.yaml" + input: + - + parameter_name: "service_version_id" + value: "{service_version_id}" + output: + - + parameter_name: "distributed_service_id" + value: "[uuid]" + - + parameter_name: "service_model_invariant_id" + value: "[invariantUUID]" + - + parameter_name: "service_model_version_id" + value: "[uuid]" + - + parameter_name: "service_model_normalized_name" + value: "[normalizedName]" + - + parameter_name: "service_model_name" + value: "[name]" + - + parameter_name: "service_model_version" + value: "[version]" + - + parameter_name: "vf_modules_list" + type: VfModuleCrawler + + runner: + type: Iteration + run_step: "setup,run" +- + type: RestCall + options: + file: "vnftest/onap/onboard/v1/monitor_distribution_v1.yaml" + input: + - + parameter_name: "distributed_service_id" + value: "{distributed_service_id}" + output: + - + parameter_name: "distribution_status" + value: "[distributionStatusOfServiceList][0][deployementStatus]" + sla: + action: assert + value: "{distribution_status}" + equals: "Distributed" + retries: 5 + interval: 5 + +context: + type: CSAR \ No newline at end of file diff --git a/vnftest/test_config/onap/test_cases/onap_vnftest_onboard-v2.yaml b/vnftest/test_config/onap/test_cases/onap_vnftest_onboard-v2.yaml new file mode 100644 index 0000000..931974e --- /dev/null +++ b/vnftest/test_config/onap/test_cases/onap_vnftest_onboard-v2.yaml @@ -0,0 +1,387 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## + +--- +schema: "vnftest:task:0.1" +description: > + Vnftest TC001 config file; + Onboard VNF package to SDC +{% set rnd = range(10000)|random %} +{% set vsp_name = vsp_name or ['test_vsp_', rnd ]|join %} +{% set vendor_name = vendor_name or ['test_vendor_', rnd ]|join %} +{% set service_name = service_name or ['test_service_', rnd ]|join %} +{% set resource_instance_name = resource_instance_name or ["test_resource_instance_", rnd ]|join %} +{% set resource_instance_unique_id = resource_instance_unique_id or ['\"\u007Bresource_version_id\u007D_', rnd, '\"']|join %} +steps: +- + type: RestCall + options: + file: "vnftest/onap/onboard/v2/create_vlm_v2.yaml" + input: + - + parameter_name: "vendor_name" + value: {{vendor_name}} + output: + - + parameter_name: "vendor_id" + value: "[itemId]" + - + parameter_name: "vlm_version_id" + value: "[version][id]" + runner: + type: Iteration + run_step: "setup,run" +- + type: RestCall + options: + file: "vnftest/onap/onboard/v2/submit_vlm_v2.yaml" + input: + - + parameter_name: "vendor_id" + value: "{vendor_id}" + - + parameter_name: "vlm_version_id" + value: "{vlm_version_id}" + runner: + type: Iteration + run_step: "setup,run" +- + type: RestCall + options: + file: "vnftest/onap/onboard/v2/create_vsp_v2.yaml" + input: + - + parameter_name: "vendor_id" + value: "{vendor_id}" + - + parameter_name: "vsp_name" + value: {{vsp_name}} + output: + - + parameter_name: "vsp_id" + value: "[itemId]" + - + parameter_name: "vsp_version_id" + value: "[version][id]" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v2/upload_package_v2.yaml" + input: + - + parameter_name: "vsp_id" + value: "{vsp_id}" + - + parameter_name: "vsp_version_id" + value: "{vsp_version_id}" + - + parameter_name: "package_file_path" + value: "{context.vnf_descriptor.package_location}" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v2/process_package_v2.yaml" + input: + - + parameter_name: "vsp_id" + value: "{vsp_id}" + - + parameter_name: "vsp_version_id" + value: "{vsp_version_id}" + runner: + type: Iteration + run_step: "setup,run" + +#- +# type: RestCall +# options: +# file: "vnftest/onap/onboard/v2/checkin_vsp_v2.yaml" +# input: +# - +# parameter_name: "vsp_id" +# value: "{vsp_id}" +# - +# parameter_name: "vsp_version_id" +# value: "{vsp_version_id}" +# runner: +# type: Iteration +# run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v2/submit_vsp_v2.yaml" + input: + - + parameter_name: "vsp_id" + value: "{vsp_id}" + - + parameter_name: "vsp_version_id" + value: "{vsp_version_id}" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v2/create_package_vsp_v2.yaml" + input: + - + parameter_name: "vsp_id" + value: "{vsp_id}" + - + parameter_name: "vsp_version_id" + value: "{vsp_version_id}" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v2/import_vsp_v2.yaml" + input: + - + parameter_name: "vsp_name" + value: {{vsp_name}} + - + parameter_name: "vsp_id" + value: "{vsp_id}" + output: + - + parameter_name: "resource_id" + value: "[uniqueId]" + + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v2/submit_resource_for_testing_v2.yaml" + input: + - + parameter_name: "resource_id" + value: "{resource_id}" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v2/start_resource_test_v2.yaml" + input: + - + parameter_name: "resource_id" + value: "{resource_id}" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v2/accept_resource_test_v2.yaml" + input: + - + parameter_name: "resource_id" + value: "{resource_id}" + output: + - + parameter_name: "resource_version_id" + value: "[allVersions][1.0]" + - + parameter_name: "resource_model_invariant_id" + value: "[invariantUUID]" + - + parameter_name: "resource_model_version_id" + value: "[uuid]" + - + parameter_name: "resource_model_name" + value: "[name]" + - + parameter_name: "resource_model_version" + value: "[version]" + + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v2/add_service_v2.yaml" + input: + - + parameter_name: "service_name" + value: {{service_name}} + output: + - + parameter_name: "sdc_service_id" + value: "[uniqueId]" + - + parameter_name: "service_model_name" + value: "[name]" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v2/add_resource_instance_v2.yaml" + input: + - + parameter_name: "resource_instance_unique_id" + value: {{resource_instance_unique_id}} + - + parameter_name: "resource_instance_name" + value: {{resource_instance_name}} + - + parameter_name: "sdc_service_id" + value: "{sdc_service_id}" + - + parameter_name: "resource_version_id" + value: "{resource_version_id}" + output: + - + parameter_name: "resource_model_customization_id" + value: "[customizationUUID]" + - + parameter_name: "resource_model_customization_name" + value: "[normalizedName]" + - + parameter_name: "resource_instance_model_name" + value: "[name]" + + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v2/submit_service_for_testing_v2.yaml" + input: + - + parameter_name: "sdc_service_id" + value: "{sdc_service_id}" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v2/start_service_test_v2.yaml" + input: + - + parameter_name: "sdc_service_id" + value: "{sdc_service_id}" + runner: + type: Iteration + run_step: "setup,run" +- + type: RestCall + options: + file: "vnftest/onap/onboard/v2/accept_service_test_v2.yaml" + input: + - + parameter_name: "sdc_service_id" + value: "{sdc_service_id}" + output: + - + parameter_name: "service_version_id" + value: "[allVersions][1.0]" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/onboard/v2/approve_distribution_v2.yaml" + input: + - + parameter_name: "service_version_id" + value: "{service_version_id}" + runner: + type: Iteration + run_step: "setup,run" +- + type: RestCall + options: + file: "vnftest/onap/onboard/v2/distribute_v2.yaml" + input: + - + parameter_name: "service_version_id" + value: "{service_version_id}" + output: + - + parameter_name: "distributed_service_id" + value: "[uuid]" + - + parameter_name: "service_model_invariant_id" + value: "[invariantUUID]" + - + parameter_name: "service_model_version_id" + value: "[uuid]" + - + parameter_name: "service_model_normalized_name" + value: "[normalizedName]" + - + parameter_name: "service_model_name" + value: "[name]" + - + parameter_name: "service_model_version" + value: "[version]" + - + parameter_name: "vf_modules_list" + type: VfModuleCrawler + + runner: + type: Iteration + run_step: "setup,run" +- + type: RestCall + options: + file: "vnftest/onap/onboard/v2/monitor_distribution_v2.yaml" + input: + - + parameter_name: "distributed_service_id" + value: "{distributed_service_id}" + output: + - + parameter_name: "distribution_status" + value: "[distributionStatusOfServiceList][0][deployementStatus]" + sla: + action: assert + value: "{distribution_status}" + equals: "Distributed" + retries: 5 + interval: 5 + +context: + type: CSAR \ No newline at end of file diff --git a/vnftest/test_config/onap/test_cases/onap_vnftest_tc001.yaml b/vnftest/test_config/onap/test_cases/onap_vnftest_tc001.yaml deleted file mode 100644 index 882d172..0000000 --- a/vnftest/test_config/onap/test_cases/onap_vnftest_tc001.yaml +++ /dev/null @@ -1,374 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## - ---- -schema: "vnftest:task:0.1" -description: > - Vnftest TC001 config file; - Onboard VNF package to SDC -{% set rnd = range(10000)|random %} -{% set vsp_name = vsp_name or ['test_vsp_', rnd ]|join %} -{% set vendor_name = vendor_name or ['test_vendor_', rnd ]|join %} -{% set service_name = service_name or ['test_service_', rnd ]|join %} -{% set resource_instance_name = resource_instance_name or ["test_resource_instance_", rnd ]|join %} -{% set resource_instance_unique_id = resource_instance_unique_id or ['\"\u007Bresource_version_id\u007D_', rnd, '\"']|join %} -steps: -- - type: OnapApiCall - options: - file: "onap/onboard/create_vlm.yaml" - input: - - - parameter_name: "vendor_name" - value: {{vendor_name}} - output: - - - parameter_name: "vendor_id" - value: "[value]" - runner: - type: Iteration - run_step: "setup,run" -- - type: OnapApiCall - options: - file: "onap/onboard/checkin_vlm.yaml" - input: - - - parameter_name: "vendor_id" - value: "{vendor_id}" - runner: - type: Iteration - run_step: "setup,run" -- - type: OnapApiCall - options: - file: "onap/onboard/submit_vlm.yaml" - input: - - - parameter_name: "vendor_id" - value: "{vendor_id}" - runner: - type: Iteration - run_step: "setup,run" -- - type: OnapApiCall - options: - file: "onap/onboard/create_vsp.yaml" - input: - - - parameter_name: "vendor_id" - value: "{vendor_id}" - - - parameter_name: "vsp_name" - value: {{vsp_name}} - output: - - - parameter_name: "vsp_id" - value: "[vspId]" - runner: - type: Iteration - run_step: "setup,run" - -- - type: OnapApiCall - options: - file: "onap/onboard/upload_package.yaml" - input: - - - parameter_name: "vsp_id" - value: "{vsp_id}" - - - parameter_name: "package_file_path" - value: "{context.vnf_descriptor.package_location}" - runner: - type: Iteration - run_step: "setup,run" - -- - type: OnapApiCall - options: - file: "onap/onboard/process_package.yaml" - input: - - - parameter_name: "vsp_id" - value: "{vsp_id}" - runner: - type: Iteration - run_step: "setup,run" - -- - type: OnapApiCall - options: - file: "onap/onboard/checkin_vsp.yaml" - input: - - - parameter_name: "vsp_id" - value: "{vsp_id}" - runner: - type: Iteration - run_step: "setup,run" - -- - type: OnapApiCall - options: - file: "onap/onboard/submit_vsp.yaml" - input: - - - parameter_name: "vsp_id" - value: "{vsp_id}" - runner: - type: Iteration - run_step: "setup,run" - -- - type: OnapApiCall - options: - file: "onap/onboard/create_package_vsp.yaml" - input: - - - parameter_name: "vsp_id" - value: "{vsp_id}" - runner: - type: Iteration - run_step: "setup,run" - -- - type: OnapApiCall - options: - file: "onap/onboard/import_vsp.yaml" - input: - - - parameter_name: "vsp_name" - value: {{vsp_name}} - - - parameter_name: "vsp_id" - value: "{vsp_id}" - output: - - - parameter_name: "resource_id" - value: "[uniqueId]" - - runner: - type: Iteration - run_step: "setup,run" - -- - type: OnapApiCall - options: - file: "onap/onboard/submit_resource_for_testing.yaml" - input: - - - parameter_name: "resource_id" - value: "{resource_id}" - runner: - type: Iteration - run_step: "setup,run" - -- - type: OnapApiCall - options: - file: "onap/onboard/start_resource_test.yaml" - input: - - - parameter_name: "resource_id" - value: "{resource_id}" - runner: - type: Iteration - run_step: "setup,run" - -- - type: OnapApiCall - options: - file: "onap/onboard/accept_resource_test.yaml" - input: - - - parameter_name: "resource_id" - value: "{resource_id}" - output: - - - parameter_name: "resource_version_id" - value: "[allVersions][1.0]" - - - parameter_name: "resource_model_invariant_id" - value: "[invariantUUID]" - - - parameter_name: "resource_model_version_id" - value: "[uuid]" - - - parameter_name: "resource_model_name" - value: "[name]" - - - parameter_name: "resource_model_version" - value: "[version]" - - runner: - type: Iteration - run_step: "setup,run" - -- - type: OnapApiCall - options: - file: "onap/onboard/add_service.yaml" - input: - - - parameter_name: "service_name" - value: {{service_name}} - output: - - - parameter_name: "sdc_service_id" - value: "[uniqueId]" - - - parameter_name: "service_model_name" - value: "[name]" - runner: - type: Iteration - run_step: "setup,run" - -- - type: OnapApiCall - options: - file: "onap/onboard/add_resource_instance.yaml" - input: - - - parameter_name: "resource_instance_unique_id" - value: {{resource_instance_unique_id}} - - - parameter_name: "resource_instance_name" - value: {{resource_instance_name}} - - - parameter_name: "sdc_service_id" - value: "{sdc_service_id}" - - - parameter_name: "resource_version_id" - value: "{resource_version_id}" - output: - - - parameter_name: "resource_model_customization_id" - value: "[customizationUUID]" - - - parameter_name: "resource_model_customization_name" - value: "[normalizedName]" - - - parameter_name: "resource_instance_model_name" - value: "[name]" - - runner: - type: Iteration - run_step: "setup,run" - -- - type: OnapApiCall - options: - file: "onap/onboard/submit_service_for_testing.yaml" - input: - - - parameter_name: "sdc_service_id" - value: "{sdc_service_id}" - runner: - type: Iteration - run_step: "setup,run" - -- - type: OnapApiCall - options: - file: "onap/onboard/start_service_test.yaml" - input: - - - parameter_name: "sdc_service_id" - value: "{sdc_service_id}" - runner: - type: Iteration - run_step: "setup,run" -- - type: OnapApiCall - options: - file: "onap/onboard/accept_service_test.yaml" - input: - - - parameter_name: "sdc_service_id" - value: "{sdc_service_id}" - output: - - - parameter_name: "service_version_id" - value: "[allVersions][1.0]" - runner: - type: Iteration - run_step: "setup,run" - -- - type: OnapApiCall - options: - file: "onap/onboard/approve_distribution.yaml" - input: - - - parameter_name: "service_version_id" - value: "{service_version_id}" - runner: - type: Iteration - run_step: "setup,run" -- - type: OnapApiCall - options: - file: "onap/onboard/distribute.yaml" - input: - - - parameter_name: "service_version_id" - value: "{service_version_id}" - output: - - - parameter_name: "distributed_service_id" - value: "[uuid]" - - - parameter_name: "service_model_invariant_id" - value: "[invariantUUID]" - - - parameter_name: "service_model_version_id" - value: "[uuid]" - - - parameter_name: "service_model_normalized_name" - value: "[normalizedName]" - - - parameter_name: "service_model_name" - value: "[name]" - - - parameter_name: "service_model_version" - value: "[version]" - - - parameter_name: "vf_modules_list" - type: VfModuleCrawler - - runner: - type: Iteration - run_step: "setup,run" -- - type: OnapApiCall - options: - file: "onap/onboard/monitor_distribution.yaml" - input: - - - parameter_name: "distributed_service_id" - value: "{distributed_service_id}" - output: - - - parameter_name: "distribution_status" - value: "[distributionStatusOfServiceList][0][deployementStatus]" - sla: - action: assert - value: "{distribution_status}" - equals: "Distributed" - retries: 5 - interval: 5 - -context: - type: CSAR \ No newline at end of file diff --git a/vnftest/test_config/onap/test_cases/onap_vnftest_tc002.yaml b/vnftest/test_config/onap/test_cases/onap_vnftest_tc002.yaml deleted file mode 100644 index 5688f30..0000000 --- a/vnftest/test_config/onap/test_cases/onap_vnftest_tc002.yaml +++ /dev/null @@ -1,363 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## - ---- -schema: "vnftest:task:0.1" -description: > - Vnftest TC002 config file; - Instantiate VNF - -{% set rnd = rnd or range(10000)|random %} -# Optional input parameters -{% set cloud_owner = cloud_owner or ['test_cloud_', rnd ]|join %} -{% set customer_name = customer_name or ['test_customer_', rnd ]|join %} -{% set service_instance_name = service_instance_name or ['test_service_instance_', rnd ]|join %} -{% set vnf_instance_name = vnf_instance_name or ['test_vnf_instance_', rnd ]|join %} - -# Mandatory input parameters -{% set service_model_version_id = service_model_version_id or '\"\u007Bservice_model_version_id\u007D\"' %} -{% set service_model_version = service_model_version or '\"\u007Bservice_model_version\u007D\"' %} -{% set service_model_normalized_name = service_model_normalized_name or '\"\u007Bservice_model_normalized_name\u007D\"' %} -{% set service_model_invariant_id = service_model_invariant_id or '\"\u007Bservice_model_invariant_id\u007D\"' %} -{% set service_model_name = service_model_name or '\"\u007Bservice_model_name\u007D\"' %} -{% set service_model_customization_id = service_model_customization_id or '\"\u007Bservice_model_customization_id\u007D\"' %} -{% set resource_model_invariant_id = resource_model_invariant_id or '\"\u007Bresource_model_invariant_id\u007D\"' %} -{% set resource_model_version_id = resource_model_version_id or '\"\u007Bresource_model_version_id\u007D\"' %} -{% set resource_model_name = resource_model_name or '\"\u007Bresource_model_name\u007D\"' %} -{% set resource_model_version = resource_model_version or '\"\u007Bresource_model_version\u007D\"' %} -{% set resource_model_customization_id = resource_model_customization_id or '\"\u007Bresource_model_customization_id\u007D\"' %} -{% set resource_model_customization_name = resource_model_customization_name or '\"\u007Bresource_model_customization_name\u007D\"' %} -{% set distributed_service_id = distributed_service_id or '\"\u007Bdistributed_service_id\u007D\"' %} -{% set resource_instance_model_name = resource_instance_model_name or '\"\u007Bresource_instance_model_name\u007D\"' %} -{% set vf_modules_list = vf_modules_list or {}%} - -steps: -- - type: OnapApiCall - options: - file: "onap/lifecycle/create_region.yaml" - input: - - - parameter_name: "cloud_owner" - value: {{cloud_owner}} - - - parameter_name: "tenant_id" - value: "{context.creds.tenant_id}" - - - parameter_name: "tenant_name" - value: "{context.creds.tenant_name}" - runner: - type: Iteration - run_step: "setup,run" - -- - type: OnapApiCall - options: - file: "onap/lifecycle/create_service.yaml" - runner: - type: Iteration - run_step: "setup,run" - -- - type: OnapApiCall - options: - file: "onap/lifecycle/create_customer.yaml" - input: - - - parameter_name: "customer_name" - value: {{customer_name}} - - - parameter_name: "cloud_owner" - value: {{cloud_owner}} - - - parameter_name: "tenant_id" - value: "{context.creds.tenant_id}" -- - type: OnapApiCall - options: - file: "onap/lifecycle/create_service_instance.yaml" - delay: 60 - input: - - - parameter_name: "service_instance_name" - value: {{service_instance_name}} - - - parameter_name: "service_model_version_id" - value: {{service_model_version_id}} - - - parameter_name: "service_model_version" - value: {{service_model_version}} - - - parameter_name: "service_model_normalized_name" - value: {{service_model_normalized_name}} - - - parameter_name: "service_model_invariant_id" - value: {{service_model_invariant_id}} - - - parameter_name: "customer_name" - value: {{customer_name}} - output: - - - parameter_name: "service_instance_id" - value: "[requestReferences][instanceId]" - - - parameter_name: "request_id" - value: "[requestReferences][requestId]" - runner: - type: Iteration - run_step: "setup,run" - -- - type: OnapApiCall - options: - file: "onap/lifecycle/monitor_request.yaml" - input: - - - parameter_name: "request_id" - value: "{request_id}" - output: - - - parameter_name: "request_state" - value: "[request][requestStatus][requestState]" - sla: - action: assert - value: "{request_state}" - equals: "COMPLETE" - retries: 15 - interval: 5 - -- - type: OnapApiCall - options: - file: "onap/lifecycle/create_vnf_instance.yaml" - delay: 30 - input: - - - parameter_name: "service_instance_id" - value: "{service_instance_id}" - - - parameter_name: "vnf_instance_name" - value: {{vnf_instance_name}} - - - parameter_name: "resource_model_invariant_id" - value: {{resource_model_invariant_id}} - - - parameter_name: "resource_model_version_id" - value: {{resource_model_version_id}} - - - parameter_name: "resource_model_name" - value: {{resource_model_name}} - - - parameter_name: "resource_model_version" - value: {{resource_model_version}} - - - parameter_name: "resource_model_customization_id" - value: {{resource_model_customization_id}} - - - parameter_name: "resource_model_customization_name" - value: {{resource_model_customization_name}} - - - parameter_name: "tenant_id" - value: "{context.creds.tenant_id}" - - - parameter_name: "service_model_name" - value: {{service_model_name}} - - - parameter_name: "service_model_invariant_id" - value: {{service_model_invariant_id}} - - - parameter_name: "service_model_version" - value: {{service_model_version}} - - - parameter_name: "distributed_service_id" - value: {{distributed_service_id}} - - output: - - - parameter_name: "vnf_instance_id" - value: "[requestReferences][instanceId]" - - - parameter_name: "request_id" - value: "[requestReferences][requestId]" - runner: - type: Iteration - run_step: "setup,run" - -- - type: OnapApiCall - options: - file: "onap/lifecycle/monitor_request.yaml" - input: - - - parameter_name: "request_id" - value: "{request_id}" - output: - - - parameter_name: "request_state" - value: "[request][requestStatus][requestState]" - sla: - action: assert - value: "{request_state}" - equals: "COMPLETE" - retries: 15 - interval: 5 - runner: - type: Iteration - run_step: "setup,run" - -{% for vf_module_definition in vnf_descriptor.vf_modules %} - {% set vf_module = vf_modules_list[vf_module_definition.module_name] %} - {% set vnf_name = ['test_vnf_', rnd, '_', vf_module_definition.module_name ]|join %} -- - type: OnapApiCall - options: - file: "onap/lifecycle/preload_sdnc.yaml" - input: - - - parameter_name: "vnf_parameters" - value: {{vf_module_definition.vnf_parameters}} - - - parameter_name: "vnf_name" - value: {{vnf_name}} - - - parameter_name: "vnf_instance_name" - value: {{vnf_instance_name}} - - - parameter_name: "service_model_name" - value: {{service_model_name}} - - - parameter_name: "resource_instance_model_name" - value: {{resource_instance_model_name}} - - - parameter_name: "service_instance_id" - value: "{service_instance_id}" - - - parameter_name: "vnf_type" - value: {{vf_module.groupName}} - runner: - type: Iteration - run_step: "setup,run" - -- - type: OnapApiCall - options: - file: "onap/lifecycle/create_vf_module.yaml" - delay: 30 - input: - - - parameter_name: "user_parameters" - value: {{vf_module_definition.user_parameters}} - - - parameter_name: "service_instance_id" - value: "{service_instance_id}" - - - parameter_name: "vnf_instance_id" - value: "{vnf_instance_id}" - - - parameter_name: "vnf_name" - value: {{vnf_name}} - - - parameter_name: "module_model_invariant_id" - value: {{vf_module.invariantUUID}} - - - parameter_name: "module_model_version_id" - value: {{vf_module.groupUUID}} - - - parameter_name: "vnf_type" - value: {{vf_module.groupName}} - - - parameter_name: "module_model_version" - value: {{vf_module.version}} - - - parameter_name: "module_model_customization_id" - value: {{vf_module.customizationUUID}} - - - parameter_name: "tenant_id" - value: "{context.creds.tenant_id}" - - - parameter_name: "service_model_name" - value: {{service_model_name}} - - - parameter_name: "service_model_invariant_id" - value: {{service_model_invariant_id}} - - - parameter_name: "service_model_version" - value: {{service_model_version}} - - - parameter_name: "distributed_service_id" - value: {{distributed_service_id}} - - - parameter_name: "resource_model_name" - value: {{resource_model_name}} - - - parameter_name: "resource_model_invariant_id" - value: {{resource_model_invariant_id}} - - - parameter_name: "resource_model_version" - value: {{resource_model_version}} - - - parameter_name: "resource_model_version_id" - value: {{resource_model_version_id}} - - - parameter_name: "resource_model_customization_id" - value: {{resource_model_customization_id}} - - - parameter_name: "resource_model_customization_name" - value: {{resource_model_customization_name}} - - output: - - - parameter_name: "vf_module_instance_id" - value: "[requestReferences][instanceId]" - - - parameter_name: "request_id" - value: "[requestReferences][requestId]" - runner: - type: Iteration - run_step: "setup,run" - -- - type: OnapApiCall - options: - file: "onap/lifecycle/monitor_request.yaml" - input: - - - parameter_name: "request_id" - value: "{request_id}" - output: - - - parameter_name: "request_state" - value: "[request][requestStatus][requestState]" - sla: - action: assert - value: "{request_state}" - equals: "COMPLETE" - retries: 15 - interval: 5 - - runner: - type: Iteration - run_step: "setup,run" -- - type: VfModuleValidator - options: - vnf_instance_id: "{vnf_instance_id}" - vf_module_instance_id: "{vf_module_instance_id}" - runner: - type: Iteration - run_step: "setup,run" - -{% endfor %} -context: - type: CSAR \ No newline at end of file diff --git a/vnftest/test_config/onap/test_cases/onap_vnftest_tc003.yaml b/vnftest/test_config/onap/test_cases/onap_vnftest_tc003.yaml deleted file mode 100644 index 278f8ef..0000000 --- a/vnftest/test_config/onap/test_cases/onap_vnftest_tc003.yaml +++ /dev/null @@ -1,95 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## - ---- -schema: "vnftest:task:0.1" -description: > - Vnftest TC003 config file; - Delete VF module - -{% set service_instance_id = service_instance_id or '\"\u007Bservice_instance_id\u007D\"' %} -{% set vnf_instance_id = vnf_instance_id or '\"\u007Bvnf_instance_id\u007D\"' %} -{% set vf_module_instance_id = vf_module_instance_id or '\"\u007Bvf_module_instance_id\u007D\"' %} -{% set service_model_customization_id = service_model_customization_id or '\"\u007Bservice_model_customization_id\u007D\"' %} -{% set vf_modules_list = vf_modules_list or {}%} - -steps: -{% for vf_module_definition in vnf_descriptor.vf_modules %} - {% set vf_module = vf_modules_list[vf_module_definition.module_name] %} -- - type: OnapApiCall - options: - file: "onap/lifecycle/delete_vf_module.yaml" - input: - - - parameter_name: "service_instance_id" - value: {{service_instance_id}} - - - parameter_name: "vnf_instance_id" - value: {{vnf_instance_id}} - - - parameter_name: "vf_module_instance_id" - value: {{vf_module_instance_id}} - - - parameter_name: "module_model_invariant_id" - value: {{vf_module.invariantUUID}} - - - parameter_name: "module_model_version_id" - value: {{vf_module.groupUUID}} - - - parameter_name: "vnf_type" - value: {{vf_module.name}} - - - parameter_name: "module_model_version" - value: {{vf_module.version}} - - - parameter_name: "service_model_customization_id" - value: {{service_model_customization_id}} - - - parameter_name: "tenant_id" - value: "{context|creds|tenant_id}" - - output: - - - parameter_name: "request_id" - value: "[requestReferences][requestId]" - runner: - type: Iteration - run_step: "setup,run" - -- - type: OnapApiCall - options: - file: "onap/lifecycle/monitor_request.yaml" - input: - - - parameter_name: "request_id" - value: "{request_id}" - output: - - - parameter_name: "request_state" - value: "[request][requestStatus][requestState]" - sla: - action: assert - value: "{request_state}" - equals: "COMPLETE" - retries: 15 - interval: 5 -{% endfor %} - runner: - type: Iteration - run_step: "setup,run" - -context: - type: CSAR \ No newline at end of file diff --git a/vnftest/test_config/onap/test_cases/onap_vnftest_terminate.yaml b/vnftest/test_config/onap/test_cases/onap_vnftest_terminate.yaml new file mode 100644 index 0000000..59aed7b --- /dev/null +++ b/vnftest/test_config/onap/test_cases/onap_vnftest_terminate.yaml @@ -0,0 +1,95 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## + +--- +schema: "vnftest:task:0.1" +description: > + Vnftest TC003 config file; + Delete VF module + +{% set service_instance_id = service_instance_id or '\"\u007Bservice_instance_id\u007D\"' %} +{% set vnf_instance_id = vnf_instance_id or '\"\u007Bvnf_instance_id\u007D\"' %} +{% set vf_module_instance_id = vf_module_instance_id or '\"\u007Bvf_module_instance_id\u007D\"' %} +{% set service_model_customization_id = service_model_customization_id or '\"\u007Bservice_model_customization_id\u007D\"' %} +{% set vf_modules_list = vf_modules_list or {}%} + +steps: +{% for vf_module_definition in vnf_descriptor.vf_modules %} + {% set vf_module = vf_modules_list[vf_module_definition.module_name] %} +- + type: RestCall + options: + file: "vnftest/onap/lifecycle/delete_vf_module.yaml" + input: + - + parameter_name: "service_instance_id" + value: {{service_instance_id}} + - + parameter_name: "vnf_instance_id" + value: {{vnf_instance_id}} + - + parameter_name: "vf_module_instance_id" + value: {{vf_module_instance_id}} + - + parameter_name: "module_model_invariant_id" + value: {{vf_module.invariantUUID}} + - + parameter_name: "module_model_version_id" + value: {{vf_module.groupUUID}} + - + parameter_name: "vnf_type" + value: {{vf_module.name}} + - + parameter_name: "module_model_version" + value: {{vf_module.version}} + - + parameter_name: "service_model_customization_id" + value: {{service_model_customization_id}} + - + parameter_name: "tenant_id" + value: "{context|creds|tenant_id}" + + output: + - + parameter_name: "request_id" + value: "[requestReferences][requestId]" + runner: + type: Iteration + run_step: "setup,run" + +- + type: RestCall + options: + file: "vnftest/onap/lifecycle/monitor_request.yaml" + input: + - + parameter_name: "request_id" + value: "{request_id}" + output: + - + parameter_name: "request_state" + value: "[request][requestStatus][requestState]" + sla: + action: assert + value: "{request_state}" + equals: "COMPLETE" + retries: 15 + interval: 5 +{% endfor %} + runner: + type: Iteration + run_step: "setup,run" + +context: + type: CSAR \ No newline at end of file diff --git a/vnftest/test_config/onap/test_suites/onap_basic_lifecycle-v1.yaml b/vnftest/test_config/onap/test_suites/onap_basic_lifecycle-v1.yaml new file mode 100644 index 0000000..b3cd1d3 --- /dev/null +++ b/vnftest/test_config/onap/test_suites/onap_basic_lifecycle-v1.yaml @@ -0,0 +1,26 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## + +--- + +schema: "vnftest:suite:0.1" + +name: "onap-basic-lifecycle" +test_cases: +- + file_name: vnftest/test_config/onap/test_cases/onap_vnftest_onboard-v1.yaml +- + file_name: vnftest/test_config/onap/test_cases/onap_vnftest_instantiate-v1.yaml +#- +# file_name: vnftest/test_config/onap/test_cases/onap_vnftest_terminate.yaml diff --git a/vnftest/test_config/onap/test_suites/onap_basic_lifecycle-v2.yaml b/vnftest/test_config/onap/test_suites/onap_basic_lifecycle-v2.yaml new file mode 100644 index 0000000..670196d --- /dev/null +++ b/vnftest/test_config/onap/test_suites/onap_basic_lifecycle-v2.yaml @@ -0,0 +1,26 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 +############################################################################## + +--- + +schema: "vnftest:suite:0.1" + +name: "onap-basic-lifecycle" +test_cases: +- + file_name: vnftest/test_config/onap/test_cases/onap_vnftest_onboard-v2.yaml +- + file_name: vnftest/test_config/onap/test_cases/onap_vnftest_instantiate-v1.yaml +#- +# file_name: vnftest/test_config/onap/test_cases/onap_vnftest_terminate.yaml diff --git a/vnftest/test_config/onap/test_suites/onap_basic_lifecycle.yaml b/vnftest/test_config/onap/test_suites/onap_basic_lifecycle.yaml deleted file mode 100644 index 773a8e0..0000000 --- a/vnftest/test_config/onap/test_suites/onap_basic_lifecycle.yaml +++ /dev/null @@ -1,26 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 -############################################################################## - ---- - -schema: "vnftest:suite:0.1" - -name: "onap-basic-lifecycle" -test_cases: -- - file_name: test_config/onap/test_cases/onap_vnftest_tc001.yaml -- - file_name: test_config/onap/test_cases/onap_vnftest_tc002.yaml -#- -# file_name: test_config/onap/test_cases/onap_vnftest_tc003.yaml diff --git a/vnftest/tests/unit/common/test_utils.py b/vnftest/tests/unit/common/test_utils.py index e8860cb..d152a98 100644 --- a/vnftest/tests/unit/common/test_utils.py +++ b/vnftest/tests/unit/common/test_utils.py @@ -28,6 +28,7 @@ import unittest import vnftest from vnftest import ssh from vnftest.common import utils +from vnftest.common import import_utils from vnftest.common import constants @@ -62,7 +63,7 @@ class ImportModulesFromPackageTestCase(unittest.TestCase): (os.path.join(vnftest_root, 'foo', 'bar'), [], ['baz.txt', 'qux.rst']) ]) - utils.import_modules_from_package('foo.bar') + import_utils.import_modules_from_package('foo.bar') @mock.patch('vnftest.common.utils.os.walk') @mock.patch.object(importlib, 'import_module') @@ -73,7 +74,7 @@ class ImportModulesFromPackageTestCase(unittest.TestCase): (os.path.join(vnftest_root, 'foo', os.pardir, 'bar'), [], ['baz.py']) ]) - utils.import_modules_from_package('foo.bar') + import_utils.import_modules_from_package('foo.bar') mock_import_module.assert_called_once_with('bar.baz') diff --git a/vnftest/tests/unit/core/test_commands.py b/vnftest/tests/unit/core/test_commands.py index 35660bd..fee15a3 100755 --- a/vnftest/tests/unit/core/test_commands.py +++ b/vnftest/tests/unit/core/test_commands.py @@ -14,18 +14,15 @@ # vnftest comment: this is a modified copy of # yardstick/tests/functional/test_cli_runner.py +import sys import unittest +from cStringIO import StringIO from vnftest.cmd.commands.runner import RunnerCommands from vnftest.cmd.commands.step import StepCommands from vnftest.core import Param from vnftest.core.runner import Runners from vnftest.core.step import Steps -from vnftest.runners.iteration import IterationRunner -from vnftest.runners.duration import DurationRunner -from vnftest.onap.onap_api_call import OnapApiCall -from cStringIO import StringIO -import sys class Capture(list): @@ -56,7 +53,7 @@ class CommandsTestCase(unittest.TestCase): step_cmd = StepCommands() with Capture() as output: step_cmd.do_list(None) - self.assert_text_in_lines(output, ["OnapApiCall"]) + self.assert_text_in_lines(output, ["RestCall"]) def test_runner_show_Duration(self): param = Param({}) @@ -72,12 +69,12 @@ class CommandsTestCase(unittest.TestCase): Runners().show(param) self.assert_text_in_lines(output, ["iterations - amount of times"]) - def test_step_show_OnapApiCall(self): + def test_step_show_RestCall(self): param = Param({}) - setattr(param, 'type', ['OnapApiCall']) + setattr(param, 'type', ['RestCall']) with Capture() as output: Steps().show(param) - self.assert_text_in_lines(output, ["Call ONAP API"]) + self.assert_text_in_lines(output, ["Call REST API"]) def assert_text_in_lines(self, lines, texts): for text in texts: diff --git a/vnftest/tests/unit/core/test_testcase.py b/vnftest/tests/unit/core/test_testcase.py index 0ba4873..5b1146d 100644 --- a/vnftest/tests/unit/core/test_testcase.py +++ b/vnftest/tests/unit/core/test_testcase.py @@ -23,7 +23,7 @@ from vnftest.core import testcase class Arg(object): def __init__(self): - self.casename = ('onap_vnftest_tc001',) + self.casename = ('onap_vnftest_onboard-v1',) class TestcaseUT(unittest.TestCase): diff --git a/vnftest/tests/unit/onap/test_onap_api_call.py b/vnftest/tests/unit/onap/test_onap_api_call.py deleted file mode 100644 index 2b6d79d..0000000 --- a/vnftest/tests/unit/onap/test_onap_api_call.py +++ /dev/null @@ -1,60 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.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 -# -# 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 mock -import testtools - -from vnftest.contexts.base import Context -from vnftest.core import task -from vnftest.onap.onap_api_call import OnapApiCall - - -class OnapApiCallTestCase(testtools.TestCase): - - step = { - 'type': 'OnapApiCall', - 'options': { - 'file': "dummy.yaml", - 'input': - [{ - 'parameter_name': "input1", - 'value': "value1" - }], - 'output': - [{ - 'parameter_name': "output1", - 'value': "[value]" - }]}, - 'sla': { - 'action': 'assert', - 'value': "{output1}", - 'equals': "output1", - 'retries': 5, - 'interval': 5} - } - NAME = 'sample' - - def setUp(self): - super(OnapApiCallTestCase, self).setUp() - - @mock.patch('vnftest.onap.onap_api_call.OnapApiCall.execute_operation_impl') - def test_run(self, mock_execute_operation): - mock_execute_operation.return_value = {'body': {'value': 'output1'}} - t = task.Task() - context_cfg = {} - context = Context.get("CSAR") - context.init(context_cfg) - t.context = context - output = t._run([OnapApiCallTestCase.step], False, "vnftest.out") - self.assertEquals(output[0]['data']['output1'], 'output1') diff --git a/vnftest/tests/unit/onap/test_rest_call.py b/vnftest/tests/unit/onap/test_rest_call.py new file mode 100644 index 0000000..ec3c88f --- /dev/null +++ b/vnftest/tests/unit/onap/test_rest_call.py @@ -0,0 +1,58 @@ +############################################################################## +# Copyright 2018 EuropeanSoftwareMarketingLtd. +# =================================================================== +# Licensed under the ApacheLicense, Version2.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 +# +# 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 mock +import testtools +from vnftest.contexts.base import Context +from vnftest.core import task + + +class RestCallTestCase(testtools.TestCase): + + step = { + 'type': 'RestCall', + 'options': { + 'file': "dummy.yaml", + 'input': + [{ + 'parameter_name': "input1", + 'value': "value1" + }], + 'output': + [{ + 'parameter_name': "output1", + 'value': "[value]" + }]}, + 'sla': { + 'action': 'assert', + 'value': "{output1}", + 'equals': "output1", + 'retries': 5, + 'interval': 5} + } + NAME = 'sample' + + def setUp(self): + super(RestCallTestCase, self).setUp() + + @mock.patch('vnftest.steps.rest_call.RestCall.execute_operation_impl') + def test_run(self, mock_execute_operation): + mock_execute_operation.return_value = {'body': {'value': 'output1'}} + t = task.Task() + context_cfg = {} + context = Context.get("CSAR") + context.init(context_cfg) + t.context = context + output = t._run([RestCallTestCase.step], False, "vnftest.out") + self.assertEquals(output[0]['data']['output1'], 'output1') -- cgit 1.2.3-korg