aboutsummaryrefslogtreecommitdiffstats
path: root/test/mocks
diff options
context:
space:
mode:
authorRehanRaza <muhammad.rehan.raza@est.tech>2019-04-04 12:42:15 +0000
committerRehanRaza <muhammad.rehan.raza@est.tech>2019-04-04 12:42:15 +0000
commitc5121c5bc5c544eb7be9432913f9099574270cbe (patch)
tree964022db49256cb5b2c7b6987e9ff9b55cd3aebc /test/mocks
parentb688e6267a5f3557af5ed366d4eee83ab884a854 (diff)
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 <muhammad.rehan.raza@est.tech>
Diffstat (limited to 'test/mocks')
-rw-r--r--test/mocks/mass-pnf-sim/pnf-sim-lightweight/config/netconf.env1
-rw-r--r--test/mocks/mass-pnf-sim/pnf-sim-lightweight/docker-compose-template.yml2
-rwxr-xr-xtest/mocks/mass-pnf-sim/pnf-sim-lightweight/simulator.sh2
-rw-r--r--test/mocks/mass-pnf-sim/pnf-sim-lightweight/src/main/java/org/onap/pnfsimulator/message/JSONObjectFactory.java2
4 files changed, 5 insertions, 2 deletions
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);