Adaptation of test env to helm chart
Restructuring to use http proxy for all access to docker containers
Adding tests for dmaap adapter and mediator
Issue-ID: NONRTRIC-618
Signed-off-by: BjornMagnussonXA <bjorn.magnusson@est.tech>
Change-Id: I43799771d73140c7abbc63db9f9b28bb353474a1
diff --git a/test/simulator-group/dmaapadp/.gitignore b/test/simulator-group/dmaapadp/.gitignore
new file mode 100644
index 0000000..4aa3a7a
--- /dev/null
+++ b/test/simulator-group/dmaapadp/.gitignore
@@ -0,0 +1,2 @@
+.tmp.json
+.dockererr
\ No newline at end of file
diff --git a/test/simulator-group/dmaapadp/app.yaml b/test/simulator-group/dmaapadp/app.yaml
new file mode 100644
index 0000000..1376f38
--- /dev/null
+++ b/test/simulator-group/dmaapadp/app.yaml
@@ -0,0 +1,45 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: $DMAAP_ADP_APP_NAME
+ namespace: $KUBE_NONRTRIC_NAMESPACE
+ labels:
+ run: $DMAAP_ADP_APP_NAME
+ autotest: DMAAPADP
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ run: $DMAAP_ADP_APP_NAME
+ template:
+ metadata:
+ labels:
+ run: $DMAAP_ADP_APP_NAME
+ autotest: DMAAPADP
+ spec:
+ containers:
+ - name: $DMAAP_ADP_APP_NAME
+ image: $DMAAP_ADP_IMAGE
+ imagePullPolicy: $KUBE_IMAGE_PULL_POLICY
+ ports:
+ - name: http
+ containerPort: $DMAAP_ADP_INTERNAL_PORT
+ - name: https
+ containerPort: $DMAAP_ADP_INTERNAL_SECURE_PORT
+ volumeMounts:
+ - mountPath: $DMAAP_ADP_CONFIG_MOUNT_PATH
+ name: dmaapadp-conf-name
+ - mountPath: $DMAAP_ADP_DATA_MOUNT_PATH
+ name: dmaapadp-data-name
+ volumes:
+ - configMap:
+ defaultMode: 420
+ name: $DMAAP_ADP_CONFIG_CONFIGMAP_NAME
+ name: dmaapadp-conf-name
+ - configMap:
+ defaultMode: 420
+ name: $DMAAP_ADP_DATA_CONFIGMAP_NAME
+ name: dmaapadp-data-name
+# Selector will be set when pod is started first time
+ nodeSelector:
+
diff --git a/test/simulator-group/dmaapadp/application.yaml b/test/simulator-group/dmaapadp/application.yaml
new file mode 100644
index 0000000..b20a9d7
--- /dev/null
+++ b/test/simulator-group/dmaapadp/application.yaml
@@ -0,0 +1,71 @@
+################################################################################
+# Copyright (c) 2021 Nordix Foundation. #
+# #
+# 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. #
+################################################################################
+
+spring:
+ profiles:
+ active: prod
+ main:
+ allow-bean-definition-overriding: true
+ aop:
+ auto: false
+management:
+ endpoints:
+ web:
+ exposure:
+ # Enabling of springboot actuator features. See springboot documentation.
+ include: "loggers,logfile,health,info,metrics,threaddump,heapdump"
+springdoc:
+ show-actuator: true
+logging:
+ # Configuration of logging
+ level:
+ ROOT: ERROR
+ org.springframework: ERROR
+ org.springframework.data: ERROR
+ org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR
+ org.oran.dmaapadapter: INFO
+ file:
+ name: /var/log/dmaap-adaptor-service/application.log
+server:
+ # Configuration of the HTTP/REST server. The parameters are defined and handeled by the springboot framework.
+ # See springboot documentation.
+ port : $DMAAP_ADP_INTERNAL_SECURE_PORT
+ http-port: $DMAAP_ADP_INTERNAL_PORT
+ ssl:
+ key-store-type: JKS
+ key-store-password: policy_agent
+ key-store: /opt/app/dmaap-adaptor-service/etc/cert/keystore.jks
+ key-password: policy_agent
+ key-alias: policy_agent
+app:
+ webclient:
+ # Configuration of the trust store used for the HTTP client (outgoing requests)
+ # The file location and the password for the truststore is only relevant if trust-store-used == true
+ # Note that the same keystore as for the server is used.
+ trust-store-used: false
+ trust-store-password: policy_agent
+ trust-store: /opt/app/dmaap-adaptor-service/etc/cert/truststore.jks
+ # Configuration of usage of HTTP Proxy for the southbound accesses.
+ # The HTTP proxy (if configured) will only be used for accessing NearRT RIC:s
+ http.proxy-host: $DMAAP_ADP_HTTP_PROXY_CONFIG_HOST_NAME
+ http.proxy-port: $DMAAP_ADP_HTTP_PROXY_CONFIG_PORT
+ ecs-base-url: $ECS_SERVICE_PATH
+ # Location of the component configuration file. The file will only be used if the Consul database is not used;
+ # configuration from the Consul will override the file.
+ configuration-filepath: /opt/app/dmaap-adaptor-service/data/application_configuration.json
+ dmaap-base-url: $MR_SERVICE_PATH
+ # The url used to adress this component. This is used as a callback url sent to other components.
+ dmaap-adapter-base-url: $DMAAP_ADP_SERVICE_PATH
\ No newline at end of file
diff --git a/test/simulator-group/dmaapadp/application_configuration.json b/test/simulator-group/dmaapadp/application_configuration.json
new file mode 100644
index 0000000..b6605e3
--- /dev/null
+++ b/test/simulator-group/dmaapadp/application_configuration.json
@@ -0,0 +1,9 @@
+{
+ "types": [
+ {
+ "id": "ExampleInformationType",
+ "dmaapTopicUrl": "/events/unauthenticated.dmaapadp.json/dmaapadapterproducer/msgs",
+ "useHttpProxy": ${DMMAAP_ADP_PROXY_FLAG}
+ }
+ ]
+}
\ No newline at end of file
diff --git a/test/simulator-group/dmaapadp/docker-compose.yml b/test/simulator-group/dmaapadp/docker-compose.yml
new file mode 100644
index 0000000..f9dee41
--- /dev/null
+++ b/test/simulator-group/dmaapadp/docker-compose.yml
@@ -0,0 +1,34 @@
+# ============LICENSE_START===============================================
+# Copyright (C) 2020 Nordix Foundation. 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=================================================
+#
+version: '3.0'
+networks:
+ default:
+ external:
+ name: ${DOCKER_SIM_NWNAME}
+services:
+ dmaap-adapter-service:
+ image: ${DMAAP_ADP_IMAGE}
+ container_name: ${DMAAP_ADP_APP_NAME}
+ ports:
+ - ${DMAAP_ADP_EXTERNAL_PORT}:${DMAAP_ADP_INTERNAL_PORT}
+ - ${DMAAP_ADP_EXTERNAL_SECURE_PORT}:${DMAAP_ADP_INTERNAL_SECURE_PORT}
+ volumes:
+ - ${DMAAP_ADP_HOST_MNT_DIR}/$DMAAP_ADP_CONFIG_FILE:${DMAAP_ADP_CONFIG_MOUNT_PATH}/$DMAAP_ADP_CONFIG_FILE
+ - ${DMAAP_ADP_HOST_MNT_DIR}/$DMAAP_ADP_DATA_FILE:${DMAAP_ADP_DATA_MOUNT_PATH}/$DMAAP_ADP_DATA_FILE
+ labels:
+ - "nrttest_app=DMAAPADP"
+ - "nrttest_dp=${DMAAP_ADP_DISPLAY_NAME}"
diff --git a/test/simulator-group/dmaapadp/svc.yaml b/test/simulator-group/dmaapadp/svc.yaml
new file mode 100644
index 0000000..62a7f7a
--- /dev/null
+++ b/test/simulator-group/dmaapadp/svc.yaml
@@ -0,0 +1,21 @@
+apiVersion: v1
+kind: Service
+metadata:
+ name: $DMAAP_ADP_APP_NAME
+ namespace: $KUBE_NONRTRIC_NAMESPACE
+ labels:
+ run: $DMAAP_ADP_APP_NAME
+ autotest: DMAAPADP
+spec:
+ type: ClusterIP
+ ports:
+ - port: $DMAAP_ADP_EXTERNAL_PORT
+ targetPort: $DMAAP_ADP_INTERNAL_PORT
+ protocol: TCP
+ name: http
+ - port: $DMAAP_ADP_EXTERNAL_SECURE_PORT
+ targetPort: $DMAAP_ADP_INTERNAL_SECURE_PORT
+ protocol: TCP
+ name: https
+ selector:
+ run: $DMAAP_ADP_APP_NAME
\ No newline at end of file