diff options
Diffstat (limited to 'vnftest/onap')
45 files changed, 579 insertions, 166 deletions
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/v1/__init__.py b/vnftest/onap/onboard/v1/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/vnftest/onap/onboard/v1/__init__.py diff --git a/vnftest/onap/onboard/accept_resource_test.yaml b/vnftest/onap/onboard/v1/accept_resource_test_v1.yaml index 2479f52..2479f52 100644 --- a/vnftest/onap/onboard/accept_resource_test.yaml +++ b/vnftest/onap/onboard/v1/accept_resource_test_v1.yaml diff --git a/vnftest/onap/onboard/accept_service_test.yaml b/vnftest/onap/onboard/v1/accept_service_test_v1.yaml index 6d38244..6d38244 100644 --- a/vnftest/onap/onboard/accept_service_test.yaml +++ b/vnftest/onap/onboard/v1/accept_service_test_v1.yaml diff --git a/vnftest/onap/onboard/add_resource_instance.yaml b/vnftest/onap/onboard/v1/add_resource_instance_v1.yaml index e217bd7..e217bd7 100644 --- a/vnftest/onap/onboard/add_resource_instance.yaml +++ b/vnftest/onap/onboard/v1/add_resource_instance_v1.yaml diff --git a/vnftest/onap/onboard/add_service.yaml b/vnftest/onap/onboard/v1/add_service_v1.yaml index 91a6eff..91a6eff 100644 --- a/vnftest/onap/onboard/add_service.yaml +++ b/vnftest/onap/onboard/v1/add_service_v1.yaml diff --git a/vnftest/onap/onboard/approve_distribution.yaml b/vnftest/onap/onboard/v1/approve_distribution_v1.yaml index a0f6a0d..a0f6a0d 100644 --- a/vnftest/onap/onboard/approve_distribution.yaml +++ b/vnftest/onap/onboard/v1/approve_distribution_v1.yaml diff --git a/vnftest/onap/onboard/checkin_vlm.yaml b/vnftest/onap/onboard/v1/checkin_vlm_v1.yaml index be77446..08fe493 100644 --- a/vnftest/onap/onboard/checkin_vlm.yaml +++ b/vnftest/onap/onboard/v1/checkin_vlm_v1.yaml @@ -14,7 +14,7 @@ --- method: PUT -url: http://{{sdc_ip}}:{{sdc_port}}/onboarding-api/v1.0/vendor-license-models/{{vendor_id}}/versions/0.1/actions +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== diff --git a/vnftest/onap/onboard/checkin_vsp.yaml b/vnftest/onap/onboard/v1/checkin_vsp_v1.yaml index d0b9067..95fb7e9 100644 --- a/vnftest/onap/onboard/checkin_vsp.yaml +++ b/vnftest/onap/onboard/v1/checkin_vsp_v1.yaml @@ -13,7 +13,7 @@ ############################################################################## --- method: PUT -url: http://{{sdc_ip}}:{{sdc_port}}/onboarding-api/v1.0/vendor-software-products/{{vsp_id}}/versions/0.1/actions +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== diff --git a/vnftest/onap/onboard/create_package_vsp.yaml b/vnftest/onap/onboard/v1/create_package_vsp_v1.yaml index 85a7bc5..b023555 100644 --- a/vnftest/onap/onboard/create_package_vsp.yaml +++ b/vnftest/onap/onboard/v1/create_package_vsp_v1.yaml @@ -13,7 +13,7 @@ ############################################################################## --- method: PUT -url: http://{{sdc_ip}}:{{sdc_port}}/onboarding-api/v1.0/vendor-software-products/{{vsp_id}}/versions/0.1/actions +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== diff --git a/vnftest/onap/onboard/create_vlm.yaml b/vnftest/onap/onboard/v1/create_vlm_v1.yaml index 25418a9..4ca4c4c 100644 --- a/vnftest/onap/onboard/create_vlm.yaml +++ b/vnftest/onap/onboard/v1/create_vlm_v1.yaml @@ -14,7 +14,7 @@ --- method: POST -url: http://{{sdc_ip}}:{{sdc_port}}/onboarding-api/v1.0/vendor-license-models +url: http://{{sdc_ip}}:{{sdc_port}}/sdc1/feProxy/onboarding-api/v1.0/vendor-license-models headers: Content-Type: application/json Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== diff --git a/vnftest/onap/onboard/create_vsp.yaml b/vnftest/onap/onboard/v1/create_vsp_v1.yaml index 01d5d64..4a3ac62 100644 --- a/vnftest/onap/onboard/create_vsp.yaml +++ b/vnftest/onap/onboard/v1/create_vsp_v1.yaml @@ -13,7 +13,7 @@ ############################################################################## --- method: POST -url: http://{{sdc_ip}}:{{sdc_port}}/onboarding-api/v1.0/vendor-software-products +url: http://{{sdc_ip}}:{{sdc_port}}/sdc1/feProxy/onboarding-api/v1.0/vendor-software-products headers: Content-Type: application/json Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== diff --git a/vnftest/onap/onboard/distribute.yaml b/vnftest/onap/onboard/v1/distribute_v1.yaml index 70415bf..70415bf 100644 --- a/vnftest/onap/onboard/distribute.yaml +++ b/vnftest/onap/onboard/v1/distribute_v1.yaml diff --git a/vnftest/onap/onboard/import_vsp.yaml b/vnftest/onap/onboard/v1/import_vsp_v1.yaml index 539b427..539b427 100644 --- a/vnftest/onap/onboard/import_vsp.yaml +++ b/vnftest/onap/onboard/v1/import_vsp_v1.yaml diff --git a/vnftest/onap/onboard/monitor_distribution.yaml b/vnftest/onap/onboard/v1/monitor_distribution_v1.yaml index 40ad7ad..40ad7ad 100644 --- a/vnftest/onap/onboard/monitor_distribution.yaml +++ b/vnftest/onap/onboard/v1/monitor_distribution_v1.yaml diff --git a/vnftest/onap/onboard/process_package.yaml b/vnftest/onap/onboard/v1/process_package_v1.yaml index 20dc082..3716571 100644 --- a/vnftest/onap/onboard/process_package.yaml +++ b/vnftest/onap/onboard/v1/process_package_v1.yaml @@ -13,7 +13,7 @@ ############################################################################## --- method: PUT -url: http://{{sdc_ip}}:{{sdc_port}}/onboarding-api/v1.0/vendor-software-products/{{vsp_id}}/versions/0.1/orchestration-template-candidate/process +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== diff --git a/vnftest/onap/onboard/start_resource_test.yaml b/vnftest/onap/onboard/v1/start_resource_test_v1.yaml index b55c909..b55c909 100644 --- a/vnftest/onap/onboard/start_resource_test.yaml +++ b/vnftest/onap/onboard/v1/start_resource_test_v1.yaml diff --git a/vnftest/onap/onboard/start_service_test.yaml b/vnftest/onap/onboard/v1/start_service_test_v1.yaml index dff74b9..dff74b9 100644 --- a/vnftest/onap/onboard/start_service_test.yaml +++ b/vnftest/onap/onboard/v1/start_service_test_v1.yaml diff --git a/vnftest/onap/onboard/submit_resource_for_testing.yaml b/vnftest/onap/onboard/v1/submit_resource_for_testing_v1.yaml index 22dbb64..22dbb64 100644 --- a/vnftest/onap/onboard/submit_resource_for_testing.yaml +++ b/vnftest/onap/onboard/v1/submit_resource_for_testing_v1.yaml diff --git a/vnftest/onap/onboard/submit_service_for_testing.yaml b/vnftest/onap/onboard/v1/submit_service_for_testing_v1.yaml index 1910695..1910695 100644 --- a/vnftest/onap/onboard/submit_service_for_testing.yaml +++ b/vnftest/onap/onboard/v1/submit_service_for_testing_v1.yaml diff --git a/vnftest/onap/onboard/submit_vlm.yaml b/vnftest/onap/onboard/v1/submit_vlm_v1.yaml index 8fcd234..ab86627 100644 --- a/vnftest/onap/onboard/submit_vlm.yaml +++ b/vnftest/onap/onboard/v1/submit_vlm_v1.yaml @@ -14,7 +14,7 @@ --- method: PUT -url: http://{{sdc_ip}}:{{sdc_port}}/onboarding-api/v1.0/vendor-license-models/{{vendor_id}}/versions/0.1/actions +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== diff --git a/vnftest/onap/onboard/submit_vsp.yaml b/vnftest/onap/onboard/v1/submit_vsp_v1.yaml index 38fe218..6b991fe 100644 --- a/vnftest/onap/onboard/submit_vsp.yaml +++ b/vnftest/onap/onboard/v1/submit_vsp_v1.yaml @@ -13,7 +13,7 @@ ############################################################################## --- method: PUT -url: http://{{sdc_ip}}:{{sdc_port}}/onboarding-api/v1.0/vendor-software-products/{{vsp_id}}/versions/0.1/actions +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== diff --git a/vnftest/onap/onboard/upload_package.yaml b/vnftest/onap/onboard/v1/upload_package_v1.yaml index 43bdae3..33f1b6a 100644 --- a/vnftest/onap/onboard/upload_package.yaml +++ b/vnftest/onap/onboard/v1/upload_package_v1.yaml @@ -13,7 +13,7 @@ ############################################################################## --- method: POST -url: http://{{sdc_ip}}:{{sdc_port}}/onboarding-api/v1.0/vendor-software-products/{{vsp_id}}/versions/0.1/orchestration-template-candidate +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== diff --git a/vnftest/onap/onboard/v2/__init__.py b/vnftest/onap/onboard/v2/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/vnftest/onap/onboard/v2/__init__.py 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'] |