Skip to content
This repository has been archived by the owner on Apr 23, 2021. It is now read-only.

add export-client-test #39

Merged
merged 27 commits into from
Aug 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b7bfb99
init export-client-test
weichou1229 Jun 27, 2018
c42e228
migrate to california 0.6.0
weichou1229 Jul 11, 2018
0190649
add populate.sh
weichou1229 Jul 12, 2018
a65ce09
rename environment file
weichou1229 Jul 12, 2018
fd7fac1
Merge branch 'master' into export-client-test
cloudxxx8 Jul 13, 2018
b911ce9
fix schema validation error
weichou1229 Jul 15, 2018
9cc6f93
init export-client-test
weichou1229 Jun 27, 2018
154facb
migrate to california 0.6.0
weichou1229 Jul 11, 2018
991b374
add populate.sh
weichou1229 Jul 12, 2018
6b804f5
rename environment file
weichou1229 Jul 12, 2018
adc5d73
fix schema validation error
weichou1229 Jul 15, 2018
10674f9
Merge remote-tracking branch 'origin/export-client-test' into export-…
weichou1229 Jul 23, 2018
e854cfe
add exportClientData.json
weichou1229 Jul 23, 2018
be72d6f
change docker image version to 0.5.x
weichou1229 Jul 24, 2018
7214ea1
init export-client-test
weichou1229 Jun 27, 2018
587daa8
migrate to california 0.6.0
weichou1229 Jul 11, 2018
ca3f204
add populate.sh
weichou1229 Jul 12, 2018
7ccae57
rename environment file
weichou1229 Jul 12, 2018
e951587
fix schema validation error
weichou1229 Jul 15, 2018
ae3ef04
init export-client-test
weichou1229 Jun 27, 2018
68dfbae
rename environment file
weichou1229 Jul 12, 2018
7370d8c
add exportClientData.json
weichou1229 Jul 23, 2018
db4590f
Merge remote-tracking branch 'origin/export-client-test' into export-…
weichou1229 Aug 1, 2018
3890662
Merge branch 'master' into export-client-test
weichou1229 Aug 5, 2018
2b80d55
Merge branch 'master' into export-client-test
weichou1229 Aug 13, 2018
4148db1
Merge branch 'master' into export-client-test
cloudxxx8 Aug 20, 2018
981d0b3
Merge branch 'master' into export-client-test
cloudxxx8 Aug 20, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions bin/exportClientTest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

NAMESFILE=$(dirname "$0")/files.sh

COLLECTION_PATH="collections/export-client.postman_collection.json"
ENV_PATH="environment/export-client-docker.postman_environment.json"

if [ -f $NAMESFILE ]; then

. $NAMESFILE

else
echo "Error: Names file does not exist."
exit $?

fi

echo "Info: Initiating Export-Client Test."

echo "[info] ---------- use docker-compose run newman ----------"

docker-compose run --rm postman run ${COLLECTION_PATH} \
--folder="registration" --iteration-data="data/exportClientData.json" --environment=${ENV_PATH} \
--reporters="junit,cli"

docker-compose run --rm postman run ${COLLECTION_PATH} \
--folder="registration_error_4xx" --iteration-data="data/exportClientData.json" --environment=${ENV_PATH} \
--reporters="junit,cli"

docker-compose run --rm postman run ${COLLECTION_PATH} \
--folder="ping" --iteration-data="data/exportClientData.json" --environment=${ENV_PATH} \
--reporters="junit,cli"

echo "Info: Export-Client Test Completed."
1 change: 1 addition & 0 deletions bin/files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ DEVICESERVICECCDATADUMP=/etc/newman/DataDumps/command/deviceServiceDb.json
COMMANDCCDATADUMP=/etc/newman/DataDumps/command/commandDb.json
CORECOMMANDDATAFILE=/etc/newman/data/coreCommandData.json

REGISTERDATADUMP=/etc/newman/DataDumps/exportclient/exportConfigurationDb.json
LOGGINGDATADUMP=/etc/newman/DataDumps/logging/logEntryDb.json

SUPPORTNOTIFICATION_NOTIFICATION_DATADUMP=/etc/newman/DataDumps/supportNotifications/notificationDb.json
Expand Down
27 changes: 27 additions & 0 deletions bin/flushExportClientDataDump.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

NAMESFILE=$(dirname "$0")/files.sh
CONFIGDUMPJS=/etc/newman/javascript/exportclient/exportConfiguration.js



if [ -f $NAMESFILE ]; then

. $NAMESFILE

else
echo "Error: Names file does not exist."
exit $?

fi

DATA_BASE="exportclient"
FLUSH_SCRIPTS=( $CONFIGDUMPJS )

for index in "${!FLUSH_SCRIPTS[@]}"
do
docker-compose exec -T mongo /bin/bash -c "mongo ${DATA_BASE} ${FLUSH_SCRIPTS[index]}"

echo "Info: ${FLUSH_SCRIPTS[index]} data flushed"

done
24 changes: 24 additions & 0 deletions bin/importExportClientDataDump.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

NAMESFILE=$(dirname "$0")/files.sh

if [ -f $NAMESFILE ]; then

. $NAMESFILE

else
echo "Error: Names file does not exist."
exit $?

fi

DATA_BASE="exportclient"
COLLECTIONS=( "exportConfiguration" )
DUMP_FILES=( $REGISTERDATADUMP)

for index in "${!DUMP_FILES[@]}"
do
docker-compose exec -T mongo /bin/bash -c "mongoimport -d ${DATA_BASE} -c ${COLLECTIONS[index]} --file ${DUMP_FILES[index]}"

echo "Info: ${DUMP_FILES[index]} data imported"
done
124 changes: 124 additions & 0 deletions bin/postman-test/DataDumps/exportclient/exportConfigurationDb.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"_id" : ObjectId("5b0eb384fd4ca80001df4fa9"),
"created" : NumberLong(1527690084377),
"modified" : NumberLong(0),
"origin" : NumberLong(1471806386919),
"name" : "TestClient",
"addressable" : {
"created" : NumberLong(0),
"modified" : NumberLong(0),
"origin" : NumberLong(1471806386919),
"name" : "OSIMQTTBroker",
"protocol" : "TCP",
"method" : "",
"address" : "m10.cloudmqtt.com",
"port" : 15421,
"path" : "",
"publisher" : "EdgeXExportPublisher",
"user" : "hukfgtoh",
"password" : "uP6hJLYW6Ji4",
"topic" : "EdgeXDataTopic"
},
"format" : "JSON",
"filter" : {
"deviceIdentifiers" : [
"livingroomthermosat",
"hallwaythermostat"
],
"valueDescriptorIdentifiers" : [
"temperature",
"humidity"
]
},
"encryption" : {
"encryptionAlgorithm" : "AES",
"encryptionKey" : "123",
"initializingVector" : "123"
},
"compression" : "GZIP",
"enable" : true,
"destination" : "REST_ENDPOINT"
}

{
"_id" : ObjectId("5b0eb384fd4ca80001df4fa2"),
"created" : NumberLong(1527690084377),
"modified" : NumberLong(0),
"origin" : NumberLong(1471806386919),
"name" : "TestClient2",
"addressable" : {
"created" : NumberLong(0),
"modified" : NumberLong(0),
"origin" : NumberLong(1471806386919),
"name" : "OSIMQTTBroker",
"protocol" : "TCP",
"method" : "",
"address" : "m10.cloudmqtt.com",
"port" : 15421,
"path" : "",
"publisher" : "EdgeXExportPublisher",
"user" : "hukfgtoh",
"password" : "uP6hJLYW6Ji4",
"topic" : "EdgeXDataTopic"
},
"format" : "JSON",
"filter" : {
"deviceIdentifiers" : [
"livingroomthermosat",
"hallwaythermostat"
],
"valueDescriptorIdentifiers" : [
"temperature",
"humidity"
]
},
"encryption" : {
"encryptionAlgorithm" : "AES",
"encryptionKey" : "123",
"initializingVector" : "123"
},
"compression" : "GZIP",
"enable" : true,
"destination" : "REST_ENDPOINT"
}
{
"_id" : ObjectId("5b0eb384fd4ca80001df4fa3"),
"created" : NumberLong(1527690084377),
"modified" : NumberLong(0),
"origin" : NumberLong(1471806386919),
"name" : "OSIClient3",
"addressable" : {
"created" : NumberLong(0),
"modified" : NumberLong(0),
"origin" : NumberLong(1471806386919),
"name" : "OSIMQTTBroker",
"protocol" : "TCP",
"method" : "",
"address" : "m10.cloudmqtt.com",
"port" : 15421,
"path" : "",
"publisher" : "EdgeXExportPublisher",
"user" : "hukfgtoh",
"password" : "uP6hJLYW6Ji4",
"topic" : "EdgeXDataTopic"
},
"format" : "JSON",
"filter" : {
"deviceIdentifiers" : [
"livingroomthermosat",
"hallwaythermostat"
],
"valueDescriptorIdentifiers" : [
"temperature",
"humidity"
]
},
"encryption" : {
"encryptionAlgorithm" : "AES",
"encryptionKey" : "123",
"initializingVector" : "123"
},
"compression" : "GZIP",
"enable" : true,
"destination" : "REST_ENDPOINT"
}
3 changes: 3 additions & 0 deletions bin/postman-test/DataDumps/exportclient/populate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

mongoimport -d exportclient -c exportConfiguration --file exportConfigurationDb.json
Loading