From 06c4aa69e525c7865a9465c11594a271c3e5ffbd Mon Sep 17 00:00:00 2001 From: Jonathan Platt Date: Wed, 28 Jul 2021 13:00:04 -0400 Subject: Add A&AI Mock Response Simulator for Testing Added A&AI mock response simulator for CSIT test cases. Issue-ID: SDNC-1586 Signed-off-by: Jonathan Platt Change-Id: I89ab08598ae3628e668353097a6763c50951a14d Former-commit-id: 698315d91a4071d467bb7760f57d3584c9008c28 --- csit/scripts/aaisimulator/aaiclient.properties | 82 ++++++++++++++++++++++ .../aaisimulator/wiremock/mappings/aai.json | 41 +++++++++++ 2 files changed, 123 insertions(+) create mode 100755 csit/scripts/aaisimulator/aaiclient.properties create mode 100755 csit/scripts/aaisimulator/wiremock/mappings/aai.json (limited to 'csit/scripts/aaisimulator') diff --git a/csit/scripts/aaisimulator/aaiclient.properties b/csit/scripts/aaisimulator/aaiclient.properties new file mode 100755 index 00000000..74b5e567 --- /dev/null +++ b/csit/scripts/aaisimulator/aaiclient.properties @@ -0,0 +1,82 @@ +### +# ============LICENSE_START======================================================= +# openECOMP : SDN-C +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +### + +# +# Configuration file for A&AI Client +# + +# +# Certificate keystore and truststore +# +org.onap.ccsdk.sli.adaptors.aai.ssl.trust=/opt/onap/sdnc/data/stores/truststoreONAPall.jks +org.onap.ccsdk.sli.adaptors.aai.ssl.trust.psswd=${AAI_TRUSTSTORE_PASSWORD} +org.onap.ccsdk.sli.adaptors.aai.host.certificate.ignore=true + +org.onap.ccsdk.sli.adaptors.aai.client.name=${AAI_CLIENT_NAME} +org.onap.ccsdk.sli.adaptors.aai.client.psswd=${AAI_CLIENT_PASSWORD} + +org.onap.ccsdk.sli.adaptors.aai.application=openECOMP +# +# Configuration file for A&AI Client +# +org.onap.ccsdk.sli.adaptors.aai.uri=http://aaihost:8080 +connection.timeout=60000 +read.timeout=60000 + +# query +org.onap.ccsdk.sli.adaptors.aai.path.query=/aai/v13/search/sdn-zone-query +org.onap.ccsdk.sli.adaptors.aai.query.nodes=/aai/v13/search/nodes-query?search-node-type={node-type}&filter={entity-identifier}:EQUALS:{entity-name} +org.onap.ccsdk.sli.adaptors.aai.query.generic=/aai/v13/search/generic-query?key={identifier}:{value}&start-node-type={start-node-type}&include=complex&depth=3 + +# named query +org.onap.ccsdk.sli.adaptors.aai.query.named=/aai/search/named-query + +#update +org.onap.ccsdk.sli.adaptors.aai.update=/aai/v13/actions/update + +# UBB Notify +org.onap.ccsdk.sli.adaptors.aai.path.notify=/aai/v13/actions/notify +org.onap.ccsdk.sli.adaptors.aai.notify.selflink.fqdn=<%= @ubbUri %>/restconf/config/L3SDN-API:services/layer3-service-list/{service-instance-id} +org.onap.ccsdk.sli.adaptors.aai.notify.selflink.avpn=<%= @ubbUri %>/restconf/config/L3AVPN-EVC-API:services/service-list/{service-instance-id}/service-data/avpn-logicalchannel-information + +# P-Interfaces +org.onap.ccsdk.sli.adaptors.aai.path.pserver.pinterfaces=/aai/v13/cloud-infrastructure/pservers/pserver/{hostname}/p-interfaces +org.onap.ccsdk.sli.adaptors.aai.path.pserver.pinterface=/aai/v13/cloud-infrastructure/pservers/pserver/{hostname}/p-interfaces/p-interface/{interface-name} + +# VNF IMAGES +org.onap.ccsdk.sli.adaptors.aai.path.vnf.images=/aai/v13/service-design-and-creation/vnf-images +org.onap.ccsdk.sli.adaptors.aai.path.vnf.image=/aai/v13/service-design-and-creation/vnf-images/vnf-image/{att-uuid} +org.onap.ccsdk.sli.adaptors.aai.path.vnf.image.query=/aai/v13/service-design-and-creation/vnf-images/vnf-image?application={application_model}&application-vendor={application_vendor} + +# service instance +org.onap.ccsdk.sli.adaptors.aai.path.svcinst.query=/aai/v13/search/generic-query?key=service-instance.service-instance-id:{svc-instance-id}&start-node-type=service-instance&include=service-instance +org.onap.ccsdk.sli.adaptors.aai.path.service.instance=/aai/v13/business/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id} + +# VNF IMAGES QUERY +org.onap.ccsdk.sli.adaptors.aai.path.vnf.image.query=/aai/v13/service-design-and-creation/vnf-images/vnf-image?application={application_model}&application-vendor={application_vendor} + +# +# Formatting +# +org.onap.ccsdk.sli.adaptors.aai.param.format=filter=%s:%s +org.onap.ccsdk.sli.adaptors.aai.param.vnf_type=vnf-type +org.onap.ccsdk.sli.adaptors.aai.param.physical.location.id=physical-location-id +org.onap.ccsdk.sli.adaptors.aai.param.service.type=service-type diff --git a/csit/scripts/aaisimulator/wiremock/mappings/aai.json b/csit/scripts/aaisimulator/wiremock/mappings/aai.json new file mode 100755 index 00000000..64739068 --- /dev/null +++ b/csit/scripts/aaisimulator/wiremock/mappings/aai.json @@ -0,0 +1,41 @@ +{ + "mappings": [{ + "request": { + "method": "GET", + "url": "/aai/v24/business/customers/customer/testsvc1/service-subscriptions/service-subscription/test/service-instances/service-instance/5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca?depth=1" + }, + "response": { + "status": 200, + "jsonBody": { + "service-instance-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "service-instance-name": "Nzrdm61asmsf01_svc", + "service-type": "INFRASTRUCTURE", + "service-role": "PROVIDER-NETWORK", + "environment-context": "General_Revenue-Bearing", + "workload-context": "Testing", + "resource-version": "1616417209896", + "selflink": "restconf/config/GENERIC-RESOURCE-API:services/service/5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca/service-data/service-topology/", + "orchestration-status": "Inventoried" + } + } + }, + { + "request": { + "method": "PATCH", + "url": "/aai/v24/business/customers/customer/testsvc1/service-subscriptions/service-subscription/test/service-instances/service-instance/5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca?resource-version=1616417209896", + "bodyPatterns": [{ + "equalToJson": { + "selflink": "restconf/config/GENERIC-RESOURCE-API:services/service/5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca/service-data/service-topology/", + "resource-version": "1616417209896", + "service-instance-name": "zrdm61asmsf01_svc" + }, + "ignoreArrayOrder": true, + "ignoreExtraElements": true + }] + }, + "response": { + "status": 200 + } + } + ] +} -- cgit 1.2.3-korg