Update HV-VES testsuites 86/82786/3
authorFilip Krzywka <filip.krzywka@nokia.com>
Wed, 20 Mar 2019 09:42:19 +0000 (10:42 +0100)
committerFilip Krzywka <filip.krzywka@nokia.com>
Thu, 21 Mar 2019 13:07:49 +0000 (14:07 +0100)
This commit follows related changes made in DCAEGEN2-1340 and overall
DCAEGEN2-1151 story.

- use configuration files instead of command line parameters
- organize collector volumes for ease of use
- move environment variables to .env file for reuse
- removed redundant aliases in ves-hv-network

Change-Id: I782db9d0996308810834c322906ab861be183193
Issue-ID: DCAEGEN2-1340
Signed-off-by: Filip Krzywka <filip.krzywka@nokia.com>
plans/dcaegen2-collectors-hv-ves/testsuites/.env
plans/dcaegen2-collectors-hv-ves/testsuites/collector/configuration/insecure.json [new file with mode: 0644]
plans/dcaegen2-collectors-hv-ves/testsuites/collector/configuration/secure.json [new file with mode: 0644]
plans/dcaegen2-collectors-hv-ves/testsuites/collector/ssl/.gitignore [moved from plans/dcaegen2-collectors-hv-ves/testsuites/ssl/.gitignore with 100% similarity]
plans/dcaegen2-collectors-hv-ves/testsuites/collector/ssl/Makefile-openssl [moved from plans/dcaegen2-collectors-hv-ves/testsuites/ssl/Makefile-openssl with 100% similarity]
plans/dcaegen2-collectors-hv-ves/testsuites/collector/ssl/README.md [moved from plans/dcaegen2-collectors-hv-ves/testsuites/ssl/README.md with 100% similarity]
plans/dcaegen2-collectors-hv-ves/testsuites/collector/ssl/gen-certs.sh [moved from plans/dcaegen2-collectors-hv-ves/testsuites/ssl/gen-certs.sh with 100% similarity]
plans/dcaegen2-collectors-hv-ves/testsuites/docker-compose.yml
plans/dcaegen2-collectors-hv-ves/testsuites/setup.sh
plans/dcaegen2-collectors-hv-ves/testsuites/teardown.sh
tests/dcaegen2-collectors-hv-ves/testcases/libraries/XnfSimulatorLibrary.py

index 7e2fffc..1558083 100644 (file)
@@ -9,4 +9,8 @@ DCAE_APP_SIMULATOR_IMAGE=hv-collector-dcae-app-simulator
 HV_VES_VERSION=1.1-SNAPSHOT
 
 HV_VES_HEALTHCHECK_CMD=curl --request GET --fail --silent --show-error localhost:6060/health/ready && nc -vz localhost 6061
-HV_VES_MAIN_CLASS=org.onap.dcae.collectors.veshv.main.MainKt
+
+JAVA_OPTS=-Dio.netty.leakDetection.level=paranoid
+CONSUL_HOST=consul-server
+CONFIG_BINDING_SERVICE=cbs
+HV_VES_HOSTNAME=dcae-hv-ves-collector
\ No newline at end of file
diff --git a/plans/dcaegen2-collectors-hv-ves/testsuites/collector/configuration/insecure.json b/plans/dcaegen2-collectors-hv-ves/testsuites/collector/configuration/insecure.json
new file mode 100644 (file)
index 0000000..9af02ff
--- /dev/null
@@ -0,0 +1,28 @@
+{
+  "server": {
+    "listenPort": 6061,
+    "idleTimeoutSec": 60,
+    "maxPayloadSizeBytes": 1048576
+  },
+  "cbs": {
+    "firstRequestDelaySec": 5,
+    "requestIntervalSec": 10
+  },
+  "security": {
+    "sslDisable": true
+  },
+  "collector": {
+    "maxRequestSizeBytes": 1048576,
+    "kafkaServers": [
+      "kafka:9092"
+    ],
+    "routing": [
+      {
+        "fromDomain": "perf3gpp",
+        "toTopic": "TEST_HV_VES_PERF3GPP"
+      }
+    ],
+    "dummyMode": false
+  },
+  "logLevel": "DEBUG"
+}
\ No newline at end of file
diff --git a/plans/dcaegen2-collectors-hv-ves/testsuites/collector/configuration/secure.json b/plans/dcaegen2-collectors-hv-ves/testsuites/collector/configuration/secure.json
new file mode 100644 (file)
index 0000000..5aa2b0a
--- /dev/null
@@ -0,0 +1,34 @@
+{
+  "server": {
+    "listenPort": 6061,
+    "idleTimeoutSec": 60,
+    "maxPayloadSizeBytes": 1048576
+  },
+  "cbs": {
+    "firstRequestDelaySec": 5,
+    "requestIntervalSec": 10
+  },
+  "security": {
+    "sslDisable": false,
+    "keys": {
+      "keyStoreFile": "/etc/hv-ves/ssl/server.p12",
+      "keyStorePassword": "onaponap",
+      "trustStoreFile": "/etc/hv-ves/ssl/trust.p12",
+      "trustStorePassword": "onaponap"
+    }
+  },
+  "collector": {
+    "maxRequestSizeBytes": 1048576,
+    "kafkaServers": [
+      "kafka:9092"
+    ],
+    "routing": [
+      {
+        "fromDomain": "perf3gpp",
+        "toTopic": "TEST_HV_VES_PERF3GPP"
+      }
+    ],
+    "dummyMode": false
+  },
+  "logLevel": "DEBUG"
+}
\ No newline at end of file
index ac07eb7..32b3943 100644 (file)
@@ -56,13 +56,14 @@ services:
     ports:
       - "10000:10000"
     environment:
-      CONSUL_HOST: "consul-server"
+      - CONSUL_HOST
     depends_on:
       - consul-server
     networks:
       ves-hv-default:
         aliases:
           - cbs
+
   #
   # DCAE HV VES Collector
   #
@@ -72,22 +73,19 @@ services:
     ports:
       - "6060:6060"
       - "6061:6061/tcp"
-    command: ["--listen-port", "6061",
-              "--kafka-bootstrap-servers", "kafka:9092",
-              "--key-store-password", "onaponap",
-              "--trust-store-password", "onaponap"]
+    command: ["--configuration-file", "/etc/hv-ves/configuration/secure.json"]
     environment:
-      JAVA_OPTS: "-Dio.netty.leakDetection.level=paranoid"
-      CONSUL_HOST: "consul-server"
-      CONFIG_BINDING_SERVICE: "cbs"
-      HOSTNAME: "dcae-hv-ves-collector"
+      - JAVA_OPTS
+      - HOSTNAME=${HV_VES_HOSTNAME}
+      - CONSUL_HOST
+      - CONFIG_BINDING_SERVICE
     healthcheck:
       interval: 10s
       timeout: 5s
       retries: 2
       test: ${HV_VES_HEALTHCHECK_CMD}
     volumes:
-      - ./ssl/:/etc/ves-hv/
+      - ./collector/:/etc/hv-ves/
     depends_on:
       - config-binding-service
       - kafka
@@ -99,21 +97,19 @@ services:
     ports:
       - "7060:6060"
       - "7061:6061/tcp"
-    command: ["--listen-port", "6061",
-              "--kafka-bootstrap-servers", "kafka:9092",
-              "--ssl-disable"]
+    command: ["--configuration-file", "/etc/hv-ves/configuration/insecure.json"]
     environment:
-      JAVA_OPTS: "-Dio.netty.leakDetection.level=paranoid"
-      CONSUL_HOST: "consul-server"
-      CONFIG_BINDING_SERVICE: "cbs"
-      HOSTNAME: "dcae-hv-ves-collector"
+      - JAVA_OPTS
+      - HOSTNAME=${HV_VES_HOSTNAME}
+      - CONSUL_HOST
+      - CONFIG_BINDING_SERVICE
     healthcheck:
       interval: 10s
       timeout: 5s
       retries: 2
       test: ${HV_VES_HEALTHCHECK_CMD}
     volumes:
-      - ./ssl/:/etc/ves-hv/
+      - ./collector/:/etc/hv-ves/
     depends_on:
       - config-binding-service
       - kafka
@@ -133,7 +129,5 @@ services:
     depends_on:
       - kafka
     networks:
-      ves-hv-default:
-        aliases:
-          - dcae-app-simulator
+      - ves-hv-default
 
index 587b268..0925e3b 100755 (executable)
@@ -29,9 +29,9 @@ export CONTAINERS_NETWORK=ves-hv-default
 echo "Creating network for containers: ${CONTAINERS_NETWORK}"
 docker network create ${CONTAINERS_NETWORK}
 
-cd ssl
+cd collector/ssl
 ./gen-certs.sh
-cd ..
+cd ../..
 
 docker-compose up -d
 
index fe922ed..28f1033 100755 (executable)
@@ -1,8 +1,8 @@
 #!/usr/bin/env bash
 
-cd ssl
+cd collector/ssl
 ./gen-certs.sh clean
-cd ..
+cd ../..
 
 COMPOSE_LOGS_FILE=${WORKSPACE}/archives/containers_logs/docker-compose.log
 docker-compose logs > ${COMPOSE_LOGS_FILE}
index 06bd42e..6c95743 100644 (file)
@@ -11,7 +11,7 @@ SIMULATOR_IMAGE_NAME = HV_VES_COLLECTOR_NAMESPACE + "/" + HV_VES_GROUP_ID + ".hv
 HV_VES_VERSION="1.1-SNAPSHOT"
 SIMULATOR_IMAGE_FULL_NAME = os.getenv("DOCKER_REGISTRY_PREFIX") + SIMULATOR_IMAGE_NAME + ":" + HV_VES_VERSION
 WORKSPACE_ENV = os.getenv("WORKSPACE")
-certificates_dir_path = WORKSPACE_ENV + "/plans/dcaegen2-collectors-hv-ves/testsuites/ssl/"
+certificates_dir_path = WORKSPACE_ENV + "/plans/dcaegen2-collectors-hv-ves/testsuites/collector/ssl/"
 collector_certs_lookup_dir = "/etc/ves-hv/"
 ONE_SECOND_IN_NANOS = 10 ** 9