From c5121c5bc5c544eb7be9432913f9099574270cbe Mon Sep 17 00:00:00 2001 From: RehanRaza Date: Thu, 4 Apr 2019 12:42:15 +0000 Subject: Fix VES event fields * timeZoneOffset uses default system timezone * sourceName and reportingEntityName use the nodename of pnf-sim instance Change-Id: Idf7f0b8d4a02cb533e81bdf69d5034cd842c3fb8 Issue-ID: DCAEGEN2-1225 Signed-off-by: RehanRaza --- test/mocks/mass-pnf-sim/pnf-sim-lightweight/config/netconf.env | 1 - test/mocks/mass-pnf-sim/pnf-sim-lightweight/docker-compose-template.yml | 2 ++ test/mocks/mass-pnf-sim/pnf-sim-lightweight/simulator.sh | 2 ++ .../src/main/java/org/onap/pnfsimulator/message/JSONObjectFactory.java | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/mocks/mass-pnf-sim/pnf-sim-lightweight/config/netconf.env b/test/mocks/mass-pnf-sim/pnf-sim-lightweight/config/netconf.env index c4f7b4a80..ef79365ec 100644 --- a/test/mocks/mass-pnf-sim/pnf-sim-lightweight/config/netconf.env +++ b/test/mocks/mass-pnf-sim/pnf-sim-lightweight/config/netconf.env @@ -8,4 +8,3 @@ NETCONF_ADDRESS=localhost NETCONF_PORT=830 NETCONF_MODEL=pnf-simulator NETCONF_MAIN_CONTAINER=config -TZ=Europe/Warsaw diff --git a/test/mocks/mass-pnf-sim/pnf-sim-lightweight/docker-compose-template.yml b/test/mocks/mass-pnf-sim/pnf-sim-lightweight/docker-compose-template.yml index aa0261c0a..2c9226a87 100644 --- a/test/mocks/mass-pnf-sim/pnf-sim-lightweight/docker-compose-template.yml +++ b/test/mocks/mass-pnf-sim/pnf-sim-lightweight/docker-compose-template.yml @@ -19,6 +19,8 @@ services: - ./json_schema:/json_schema - ./config/config.yml:/config/config.yml:rw - ./files/:/files/:rw + environment: + TZ: "${TIMEZONE}" env_file: - ./config/netconf.env restart: on-failure diff --git a/test/mocks/mass-pnf-sim/pnf-sim-lightweight/simulator.sh b/test/mocks/mass-pnf-sim/pnf-sim-lightweight/simulator.sh index 4c5d9f062..6ba707973 100755 --- a/test/mocks/mass-pnf-sim/pnf-sim-lightweight/simulator.sh +++ b/test/mocks/mass-pnf-sim/pnf-sim-lightweight/simulator.sh @@ -74,6 +74,8 @@ function compose(){ export PORTFTPS=$8 export IPFTPS=$9 export IPSFTP=${10} + LOCALTIME=$(ls -l /etc/localtime) + export TIMEZONE=${LOCALTIME//*zoneinfo\/} #will insert $I to distinguish containers, networks properly #docker compose cannot substitute these, as they are keys, not values. diff --git a/test/mocks/mass-pnf-sim/pnf-sim-lightweight/src/main/java/org/onap/pnfsimulator/message/JSONObjectFactory.java b/test/mocks/mass-pnf-sim/pnf-sim-lightweight/src/main/java/org/onap/pnfsimulator/message/JSONObjectFactory.java index 545a56882..ded991044 100644 --- a/test/mocks/mass-pnf-sim/pnf-sim-lightweight/src/main/java/org/onap/pnfsimulator/message/JSONObjectFactory.java +++ b/test/mocks/mass-pnf-sim/pnf-sim-lightweight/src/main/java/org/onap/pnfsimulator/message/JSONObjectFactory.java @@ -70,7 +70,7 @@ final class JSONObjectFactory { commonEventHeader.put(INTERNAL_HEADER_FIELDS, new JSONObject()); commonEventHeader.put(VERSION, VERSION_NUMBER); commonEventHeader.put(VES_EVENT_LISTENER_VERSION, VES_EVENT_LISTENER_VERSION_NUMBER); - String absPath = System.getProperty("user.dir"); + String absPath = new File("").getAbsolutePath(); String nodeName = absPath.substring(absPath.lastIndexOf(File.separator)+1); commonEventHeader.put(SOURCE_NAME, nodeName); commonEventHeader.put(REPORTING_ENTITY_NAME, nodeName); -- cgit 1.2.3-korg