From b7bfb999ab1c3c125bc5c627e4391af59633f5ae Mon Sep 17 00:00:00 2001 From: Bruce Date: Thu, 28 Jun 2018 00:47:34 +0800 Subject: [PATCH 01/20] init export-client-test Signed-off-by: Bruce --- bin/exportClientTest.sh | 34 + bin/files.sh | 5 +- bin/flushExportClientDataDump.sh | 27 + bin/importExportClientDataDump.sh | 24 + .../exportclient/exportConfigurationDb.json | 124 ++ .../export-client.postman_collection.json | 1561 +++++++++++++++++ .../edgex.postman_environment.json | 54 + .../local_edgex.postman_environment.json | 55 + .../exportclient/exportConfiguration.js | 15 + bin/run.sh | 15 +- deploy-edgeX.sh | 6 +- 11 files changed, 1915 insertions(+), 5 deletions(-) create mode 100755 bin/exportClientTest.sh create mode 100755 bin/flushExportClientDataDump.sh create mode 100755 bin/importExportClientDataDump.sh create mode 100644 bin/postman-test/DataDumps/exportclient/exportConfigurationDb.json create mode 100644 bin/postman-test/collections/export-client.postman_collection.json create mode 100644 bin/postman-test/environment/edgex.postman_environment.json create mode 100644 bin/postman-test/environment/local_edgex.postman_environment.json create mode 100644 bin/postman-test/javascript/exportclient/exportConfiguration.js diff --git a/bin/exportClientTest.sh b/bin/exportClientTest.sh new file mode 100755 index 00000000..c2fc64ee --- /dev/null +++ b/bin/exportClientTest.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +NAMESFILE=$(dirname "$0")/files.sh + +COLLECTION_PATH="collections/export-client.postman_collection.json" +ENV_PATH="environment/edgex.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." diff --git a/bin/files.sh b/bin/files.sh index cee3ce30..12820ad5 100755 --- a/bin/files.sh +++ b/bin/files.sh @@ -45,7 +45,10 @@ DEVICESERVICECCDATADUMP=/etc/newman/DataDumps/command/deviceServiceDb.json COMMANDCCDATADUMP=/etc/newman/DataDumps/command/commandDb.json CORECOMMANDDATAFILE=/etc/newman/data/coreCommandData.json -if [ -f $CONFIGFILE ]; then +REGISTERDATADUMP=/etc/newman/DataDumps/exportclient/exportConfigurationDb.json +LOGGINGDATADUMP=/etc/newman/DataDumps/logging/logEntryDb.json + +if [ -f $CONFIGFILE ]; then source $CONFIGFILE diff --git a/bin/flushExportClientDataDump.sh b/bin/flushExportClientDataDump.sh new file mode 100755 index 00000000..b7209a0a --- /dev/null +++ b/bin/flushExportClientDataDump.sh @@ -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 diff --git a/bin/importExportClientDataDump.sh b/bin/importExportClientDataDump.sh new file mode 100755 index 00000000..0c158706 --- /dev/null +++ b/bin/importExportClientDataDump.sh @@ -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 diff --git a/bin/postman-test/DataDumps/exportclient/exportConfigurationDb.json b/bin/postman-test/DataDumps/exportclient/exportConfigurationDb.json new file mode 100644 index 00000000..b50144b2 --- /dev/null +++ b/bin/postman-test/DataDumps/exportclient/exportConfigurationDb.json @@ -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" +} \ No newline at end of file diff --git a/bin/postman-test/collections/export-client.postman_collection.json b/bin/postman-test/collections/export-client.postman_collection.json new file mode 100644 index 00000000..a3c8ed29 --- /dev/null +++ b/bin/postman-test/collections/export-client.postman_collection.json @@ -0,0 +1,1561 @@ +{ + "info": { + "_postman_id": "94d01352-09d4-46f1-a1a6-00b92a5170af", + "name": "export-client", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "registration", + "description": "", + "item": [ + { + "name": "Create a registration", + "event": [ + { + "listen": "test", + "script": { + "id": "683d513e-a052-4e1f-8530-780c5fd06c05", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration - POST", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + " ", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type is text/plain\", function(){", + " var contentType = postman.getResponseHeader(\"Content-Type\");", + " pm.expect(contentType).to.include(\"text/plain\");", + "});", + "", + "pm.test(\"Response body is correct\", function () {", + " pm.expect(pm.response.text().length === 24 ).to.be.true;", + "});" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"origin\":1471806386919,\n\t\"name\":\"OSIClient\",\n\t\"addressable\":\n\t{\t\n\t\t\"origin\":1471806386919,\n\t\t\"name\":\"OSIMQTTBroker\",\n\t\t\"protocol\":\"TCP\",\n\t\t\"address\":\"m10.cloudmqtt.com\",\n\t\t\"port\":15421,\n\t\t\"publisher\":\"EdgeXExportPublisher\",\n\t\t\"user\":\"hukfgtoh\",\n\t\t\"password\":\"uP6hJLYW6Ji4\",\n\t\t\"topic\":\"EdgeXDataTopic\"\n\t},\n\t\"format\":\"JSON\",\n\t\"filter\":\n\t{\n\t\t\"deviceIdentifiers\":[\"livingroomthermosat\", \"hallwaythermostat\"],\n\t\t\"valueDescriptorIdentifiers\":[\"temperature\", \"humidity\"]\n\t\t\n\t},\n\t\t\"encryption\":\n\t\t{\n\t\t\t\"encryptionAlgorithm\":\"AES\",\n\t\t\t\"encryptionKey\":\"123\",\n\t\t\t\"initializingVector\":\"123\"\n\t\t},\n\t\t\"compression\":\"GZIP\",\n\t\t\"enable\":true, \n\t\t\"destination\": \"REST_ENDPOINT\"\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration" + ] + }, + "description": "Add a new client export registration. Name must be unique across the database. Return ServiceException (HTTP 503) for unknown or unanticipated issues." + }, + "response": [] + }, + { + "name": "Modify a registration", + "event": [ + { + "listen": "test", + "script": { + "id": "b0233f73-59c2-4ea0-82a3-caaf14f99271", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration - PUT", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Response body is correct\", function () {", + " pm.expect(pm.response.text() === 'true' ).to.be.true;", + "});" + ] + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\": false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration" + ] + }, + "description": "Update a client export registration. Name & id are not updated as they are identifiers. Return NotFoundException (HTTP 404) if the existing export registration cannot be found by id or name. Return ServiceException (HTTP 503) for unknown or unanticipated issues." + }, + "response": [] + }, + { + "name": "Query a registration by name", + "event": [ + { + "listen": "test", + "script": { + "id": "023c4d17-a2f1-4c18-b2c6-8121221b0edb", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/name - GET", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "var schema = pm.globals.get(\"schemas\").registration;", + "var jsonData = pm.response.json();", + "", + "var expectRegistration = pm.environment.get(\"getName\");", + " ", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type is application/json\", function(){", + " var contentType = postman.getResponseHeader(\"Content-Type\");", + " pm.expect(contentType).to.include(\"application/json\");", + "});", + "", + "pm.test(\"Is valid response schema\", function () {", + " var result = tv4.validate(jsonData, schema);", + " if(!result){", + " console.log(tv4.error);", + " }", + " pm.expect(result).to.be.true;", + "});", + "", + "pm.test(\"Response body is correct\", function () {", + " pm.expect(jsonData.name===expectRegistration).to.be.true; ", + "});", + "", + "" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "3659413e-88db-4bfd-a658-add93a8a2b27", + "type": "text/javascript", + "exec": [ + "if(!data.loggingLabel){", + " pm.environment.set(\"getName\", \"OSIClient\");", + "}else{", + " pm.environment.set(\"getName\", data.getName);", + "}" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/name/{{getName}}", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "name", + "{{getName}}" + ] + }, + "description": "Fetch a client export registration by unique name. Response will be null if no export registration matches on name. Return ServiceException (HTTP 503) for unknown or unanticipated issues" + }, + "response": [] + }, + { + "name": "Query a registration by ID", + "event": [ + { + "listen": "test", + "script": { + "id": "dd27c513-464f-4576-81a5-d17921984635", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/id - GET", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "var schema = pm.globals.get(\"schemas\").registration;", + "var jsonData = pm.response.json();", + "", + "var expectRegistrationId = pm.environment.get(\"regID\");", + " ", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type is application/json\", function(){", + " var contentType = postman.getResponseHeader(\"Content-Type\");", + " pm.expect(contentType).to.include(\"application/json\");", + "});", + "", + "pm.test(\"Is valid response schema\", function () {", + " var result = tv4.validate(jsonData, schema);", + " if(!result){", + " console.log(tv4.error);", + " }", + " pm.expect(result).to.be.true;", + "});", + "", + "pm.test(\"Response body is correct\", function () {", + " pm.expect(jsonData.id===expectRegistrationId).to.be.true; ", + "});", + "" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "5fa1802a-3f8e-4afb-b8b1-bf8975939563", + "type": "text/javascript", + "exec": [ + "if(!data.loggingLabel){", + " pm.environment.set(\"regID\", \"5b0eb384fd4ca80001df4fa9\");", + "}else{", + " pm.environment.set(\"regID\", data.regID);", + "}" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/{{regID}}", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "{{regID}}" + ] + }, + "description": "Fetch a client export registration by id. Response will be null if no export registration matches on id. Return ServiceException (HTTP 503) for unknown or unanticipated issues." + }, + "response": [] + }, + { + "name": "Query all registration", + "event": [ + { + "listen": "test", + "script": { + "id": "24836363-c978-4fb7-9265-634203f591ab", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration - GET", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + " ", + "var schema = pm.globals.get(\"schemas\").registrationArray;", + "var jsonData = pm.response.json();", + " ", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type is application/json\", function(){", + " var contentType = postman.getResponseHeader(\"Content-Type\");", + " pm.expect(contentType).to.include(\"application/json\");", + "});", + "", + "pm.test(\"Is valid response schema\", function () {", + " var result = tv4.validate(jsonData, schema);", + " if(!result){", + " console.log(tv4.error);", + " }", + " pm.expect(result).to.be.true;", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration" + ] + }, + "description": "Fetch all client export registrations. Return ServiceException (HTTP 503) for unknown or unanticipated issues. No limits are exercised on this query at this time. May need to add this in the future if the number of clients is huge." + }, + "response": [] + }, + { + "name": "Query all supported algorithm property values", + "event": [ + { + "listen": "test", + "script": { + "id": "7d59f43a-dd65-4ecf-9b77-27811f39af8e", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/reference/algorithms - GET", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + " ", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type is application/json\", function(){", + " var contentType = postman.getResponseHeader(\"Content-Type\");", + " pm.expect(contentType).to.include(\"application/json\");", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/reference/algorithms", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "reference", + "algorithms" + ] + }, + "description": "Fetch all supported values for the specified Export Client registration property type. Types are algorithms, compressions, formats, and destinations. Return ServiceException (HTTP 503) for unknown type specifications." + }, + "response": [] + }, + { + "name": "Query all supported compression property values", + "event": [ + { + "listen": "test", + "script": { + "id": "3bd0626a-905e-4583-bc07-c530c43bc121", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/reference/compressions - GET", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type is application/json\", function(){", + " var contentType = postman.getResponseHeader(\"Content-Type\");", + " pm.expect(contentType).to.include(\"application/json\");", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/reference/compressions", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "reference", + "compressions" + ] + }, + "description": "Fetch all supported values for the specified Export Client registration property type. Types are algorithms, compressions, formats, and destinations. Return ServiceException (HTTP 503) for unknown type specifications." + }, + "response": [] + }, + { + "name": "Query all supported format property values", + "event": [ + { + "listen": "test", + "script": { + "id": "ef4b8936-a7ad-43ee-afd3-f14a467e32f3", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/reference/formats - GET", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type is application/json\", function(){", + " var contentType = postman.getResponseHeader(\"Content-Type\");", + " pm.expect(contentType).to.include(\"application/json\");", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/reference/formats", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "reference", + "formats" + ] + }, + "description": "Fetch all supported values for the specified Export Client registration property type. Types are algorithms, compressions, formats, and destinations. Return ServiceException (HTTP 503) for unknown type specifications." + }, + "response": [] + }, + { + "name": "Query all supported destination property values", + "event": [ + { + "listen": "test", + "script": { + "id": "93621cd9-fbca-49f8-980d-ae34d0618df6", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/reference/destinations - GET", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type is application/json\", function(){", + " var contentType = postman.getResponseHeader(\"Content-Type\");", + " pm.expect(contentType).to.include(\"application/json\");", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/reference/destinations", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "reference", + "destinations" + ] + }, + "description": "Fetch all supported values for the specified Export Client registration property type. Types are algorithms, compressions, formats, and destinations. Return ServiceException (HTTP 503) for unknown type specifications." + }, + "response": [] + }, + { + "name": "Delete a registration by ID", + "event": [ + { + "listen": "test", + "script": { + "id": "0066d782-d4cc-4ee9-9154-caf04fda1bce", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/id/id - DELETE", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Response body is correct\", function () {", + " pm.expect(pm.response.text() === 'true' ).to.be.true;", + "});" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "0ff0d2c6-abb7-4cc7-b917-a3b2bc94c514", + "type": "text/javascript", + "exec": [ + "if(!data.loggingLabel){", + " pm.environment.set(\"regDeleteID\", \"5b0eb384fd4ca80001df4fa2\");", + "}else{", + " pm.environment.set(\"regDeleteID\", data.regDeleteID);", + "}" + ] + } + } + ], + "request": { + "method": "DELETE", + "header": [], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/id/{{regDeleteID}}", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "id", + "{{regDeleteID}}" + ] + }, + "description": "Delete a client export registration by database id. Return NotFoundException (HTTP 404) if the existing export registration cannot be found by id. Return ServiceException (HTTP 503) for unknown or unanticipated issues." + }, + "response": [] + }, + { + "name": "Delete a registration by name", + "event": [ + { + "listen": "test", + "script": { + "id": "f9565f19-0801-4e0c-8b47-14241a244031", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/name - DELETE", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Response body is correct\", function () {", + " pm.expect(pm.response.text() === 'true' ).to.be.true;", + "});" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "8cfe0d53-f476-4774-adfb-40c4a193604d", + "type": "text/javascript", + "exec": [ + "if(!data.loggingLabel){", + " pm.environment.set(\"deleteName\", \"OSIClient3\");", + "}else{", + " pm.environment.set(\"deleteName\", data.deleteName);", + "}" + ] + } + } + ], + "request": { + "method": "DELETE", + "header": [], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/name/{{deleteName}}", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "name", + "{{deleteName}}" + ] + }, + "description": "Delete a client export registration by name. Return NotFoundException (HTTP 404) if the existing export registration cannot be found by name. Return ServiceException (HTTP 503) for unknown or unanticipated issues." + }, + "response": [] + } + ] + }, + { + "name": "registration_error_4xx", + "description": "", + "item": [ + { + "name": "Fail to create a registration by empty name", + "event": [ + { + "listen": "test", + "script": { + "id": "e0592ed8-c18d-4338-b076-b241a5d5b343", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration - POST - 400", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"origin\":1471806386919,\n\t\"name\":\"\",\n\t\"addressable\":\n\t{\t\n\t\t\"origin\":1471806386919,\n\t\t\"name\":\"OSIMQTTBroker\",\n\t\t\"protocol\":\"TCP\",\n\t\t\"address\":\"m10.cloudmqtt.com\",\n\t\t\"port\":15421,\n\t\t\"publisher\":\"EdgeXExportPublisher\",\n\t\t\"user\":\"hukfgtoh\",\n\t\t\"password\":\"uP6hJLYW6Ji4\",\n\t\t\"topic\":\"EdgeXDataTopic\"\n\t},\n\t\"format\":\"JSON\",\n\t\"filter\":\n\t{\n\t\t\"deviceIdentifiers\":[\"livingroomthermosat\", \"hallwaythermostat\"],\n\t\t\"valueDescriptorIdentifiers\":[\"temperature\", \"humidity\"]\n\t\t\n\t},\n\t\t\"encryption\":\n\t\t{\n\t\t\t\"encryptionAlgorithm\":\"AES\",\n\t\t\t\"encryptionKey\":\"123\",\n\t\t\t\"initializingVector\":\"123\"\n\t\t},\n\t\t\"compression\":\"GZIP\",\n\t\t\"enable\":true, \n\t\t\"destination\": \"REST_ENDPOINT\"\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration" + ] + }, + "description": "Add a new client export registration. Name must be unique across the database. Return ServiceException (HTTP 503) for unknown or unanticipated issues. This entry does not provide a name, thus returns a 400 error code." + }, + "response": [] + }, + { + "name": "Fail to modify registration by inexistent name field", + "event": [ + { + "listen": "test", + "script": { + "id": "510f7316-2b2b-467a-9c65-283aac327ae8", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration - PUT - 400", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "" + ] + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"names\":\"OSIClient\",\n\t\"enable\": false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration" + ] + }, + "description": "Update a client export registration. Name & id are not updated as they are identifiers. Return NotFoundException (HTTP 404) if the existing export registration cannot be found by id or name. Return ServiceException (HTTP 503) for unknown or unanticipated issues. Passes JSON containing no id or name identifier." + }, + "response": [] + }, + { + "name": "Fail to modify registration by inexistent name", + "event": [ + { + "listen": "test", + "script": { + "id": "1158a8e4-ae1e-4037-9f99-53eb881deacc", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration - PUT - 404", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "" + ] + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClientNotThere\",\n\t\"enable\": false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration" + ] + }, + "description": "Update a client export registration. Name & id are not updated as they are identifiers. Return NotFoundException (HTTP 404) if the existing export registration cannot be found by id or name. Return ServiceException (HTTP 503) for unknown or unanticipated issues. Passes JSON containing an name that does not exsist." + }, + "response": [] + }, + { + "name": "Fail to query registration by inexistent name", + "event": [ + { + "listen": "test", + "script": { + "id": "c509e893-6ab6-4a5e-b4ad-c3997ec5fdc9", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/name - GET - 404", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "b174d310-b3c3-4398-9aee-2f9738ec67c9", + "type": "text/javascript", + "exec": [ + "if(!data.loggingLabel){", + " pm.environment.set(\"nameNotFound\", \"OSIClientNotThere\");", + "}else{", + " pm.environment.set(\"nameNotFound\", data.nameNotFound);", + "}" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/name/{{nameNotFound}}", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "name", + "{{nameNotFound}}" + ] + }, + "description": "Fetch a client export registration by unique name. Response will be null if no export registration matches on name. Return ServiceException (HTTP 503) for unknown or unanticipated issues. Searches for a name that has not registration assocated with it." + }, + "response": [] + }, + { + "name": "Fail to query registration by inexistent ID", + "event": [ + { + "listen": "test", + "script": { + "id": "8014665a-aed1-4e9e-a1b5-f8d0dd16fbd0", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/id - GET - 404", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "7b2c1412-fa90-4e92-bff1-3d1d9f859911", + "type": "text/javascript", + "exec": [ + "if(!data.loggingLabel){", + " pm.environment.set(\"regIDNotFound\", \"thisregisnotthere\");", + "}else{", + " pm.environment.set(\"regIDNotFound\", data.regIDNotFound);", + "}" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/{{regIDNotFound}}", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "{{regIDNotFound}}" + ] + }, + "description": "Fetch a client export registration by id. Response will be null if no export registration matches on id. Return ServiceException (HTTP 503) for unknown or unanticipated issues. We attempt to get a registration via an id that doesn't exsist." + }, + "response": [] + }, + { + "name": "Fail to query property values by invalid property type", + "event": [ + { + "listen": "test", + "script": { + "id": "ca69de04-181d-4c4a-823f-9c0816ee737c", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/reference/algorithms - GET - 400", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/reference/invalid", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "reference", + "invalid" + ] + }, + "description": "Fetch all supported values for the specified Export Client registration property type. Types are algorithms, compressions, formats, and destinations. Return ServiceException (HTTP 503) for unknown type specifications." + }, + "response": [] + }, + { + "name": "Fail to delete registration by inexistent id", + "event": [ + { + "listen": "test", + "script": { + "id": "81430a21-0c98-4980-8364-a3c625312c3d", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/id/id - DELETE - 404", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "33ec4f00-b33f-411a-a87e-588125ebc2f6", + "type": "text/javascript", + "exec": [ + "if(!data.loggingLabel){", + " pm.environment.set(\"nameNotFound\", \"OSIClientNotThere\");", + "}else{", + " pm.environment.set(\"nameNotFound\", data.nameNotFound);", + "}" + ] + } + } + ], + "request": { + "method": "DELETE", + "header": [], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/name/{{nameNotFound}}", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "name", + "{{nameNotFound}}" + ] + }, + "description": "Delete a client export registration by database id. Return NotFoundException (HTTP 404) if the existing export registration cannot be found by id. Return ServiceException (HTTP 503) for unknown or unanticipated issues. Attempts to delete an entry with an id that does not exsist." + }, + "response": [] + }, + { + "name": "Fail to delete registration by inexistent id", + "event": [ + { + "listen": "test", + "script": { + "id": "de83487f-f543-4dc5-9c25-85dda6f8287e", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/id/id - DELETE - 404", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "446af669-41f6-43d6-aa5a-f1acb1d9f0f4", + "type": "text/javascript", + "exec": [ + "if(!data.loggingLabel){", + " pm.environment.set(\"regIDNotFound\", \"thisregisnotthere\");", + "}else{", + " pm.environment.set(\"regIDNotFound\", data.regIDNotFound);", + "}" + ] + } + } + ], + "request": { + "method": "DELETE", + "header": [], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/id/{{regIDNotFound}}", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "id", + "{{regIDNotFound}}" + ] + }, + "description": "Delete a client export registration by database id. Return NotFoundException (HTTP 404) if the existing export registration cannot be found by id. Return ServiceException (HTTP 503) for unknown or unanticipated issues. Attempts to delete an entry with an id that does not exsist." + }, + "response": [] + } + ] + }, + { + "name": "ping", + "description": "", + "item": [ + { + "name": "Test service providing an indication that the service is available.", + "event": [ + { + "listen": "test", + "script": { + "id": "0a31e29a-5204-406c-8eb5-a047d8a641b5", + "type": "text/javascript", + "exec": [ + " /**", + " * Test Case: /ping - GET", + " * Version: Alpha", + " * @Author: Tata Elxsi", + " * ", + " **/", + " ", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Response body is correct\", function () {", + " pm.expect(pm.response.text()).to.include(\"pong\");", + "});" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "{{exportClientUrl}}/api/v1/ping", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "ping" + ] + }, + "description": "Test service providing an indicatioon that the service is avaliable." + }, + "response": [] + } + ] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "id": "18db43d9-8a4e-4a65-a9af-f4c9d6bb9017", + "type": "text/javascript", + "exec": [ + "var schemas = {} ; ", + "", + "schemas.registration = {", + " \"type\":\"object\",", + " \"$schema\":\"http://json-schema.org/draft-03/schema#\",", + " \"description\":\"Defines the registration details on the part of north side export clients\",", + " \"title\":\"ExportRegistration\",", + " \"properties\":{", + " \"id\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"id\"", + " },", + " \"created\":{", + " \"type\":\"integer\",", + " \"required\":false,", + " \"title\":\"created\"", + " },", + " \"modified\":{", + " \"type\":\"integer\",", + " \"required\":false,", + " \"title\":\"modified\"", + " },", + " \"origin\":{", + " \"type\":\"integer\",", + " \"required\":false,", + " \"title\":\"origin\"", + " },", + " \"name\":{", + " \"type\":\"string\",", + " \"required\":true,", + " \"title\":\"name\"", + " },", + " \"addressable\":{", + " \"type\":\"object\",", + " \"properties\":{", + " \"id\":{", + " \"type\":[\"string\",\"null\"],", + " \"required\":false,", + " \"title\":\"id\"", + " },", + " \"created\":{", + " \"type\":\"integer\",", + " \"required\":false,", + " \"title\":\"created\"", + " },", + " \"modified\":{", + " \"type\":\"integer\",", + " \"required\":false,", + " \"title\":\"modified\"", + " },", + " \"origin\":{", + " \"type\":\"integer\",", + " \"required\":false,", + " \"title\":\"origin\"", + " },", + " \"name\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"name\"", + " },", + " \"protocol\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"protocol\"", + " },", + " \"address\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"address\"", + " },", + " \"port\":{", + " \"type\":\"integer\",", + " \"required\":false,", + " \"title\":\"port\"", + " },", + " \"path\":{", + " \"type\":[\"string\",\"null\"],", + " \"required\":false,", + " \"title\":\"path\"", + " },", + " \"publisher\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"publisher\"", + " },", + " \"user\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"user\"", + " },", + " \"password\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"password\"", + " },", + " \"topic\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"topic\"", + " }", + " }", + " },", + " \"format\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"format\"", + " },", + " \"filter\":{", + " \"type\":\"object\",", + " \"properties\":{", + " \"deviceIdentifiers\":{", + " \"type\":\"array\",", + " \"required\":false,", + " \"title\":\"deviceIdentifiers\",", + " \"items\":{", + " \"type\":\"string\",", + " \"title\":\"deviceIdentifiers\"", + " },", + " \"uniqueItems\":false", + " },", + " \"valueDescriptorIdentifiers\":{", + " \"type\":\"array\",", + " \"required\":false,", + " \"title\":\"valueDescriptorIdentifiers\",", + " \"items\":{", + " \"type\":\"string\",", + " \"title\":\"valueDescriptorIdentifiers\"", + " },", + " \"uniqueItems\":false", + " }", + " }", + " },", + " \"encryption\":{", + " \"type\":\"object\",", + " \"properties\":{", + " \"encryptionAlgorithm\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"encryptionAlgorithm\"", + " },", + " \"encryptionKey\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"encryptionKey\"", + " },", + " \"initializingVector\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"initializingVector\"", + " }", + " }", + " },", + " \"compression\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"compression\"", + " },", + " \"enable\":{", + " \"type\":\"boolean\",", + " \"required\":false,", + " \"title\":\"enable\"", + " }", + " }", + " };", + " ", + "schemas.registrationArray = {", + " \"$schema\": \"http://json-schema.org/draft-04/schema#\",", + " \"title\": \"The Array of Registration\",", + " \"type\": \"array\",", + " \"items\": {", + " \"$ref\": \"#/definitions/Registration\"", + " },", + " \"definitions\": {", + " \"Registration\": schemas.registration", + " }", + " };", + " ", + "pm.globals.set(\"schemas\", schemas);" + ] + } + }, + { + "listen": "test", + "script": { + "id": "77761ca0-cb23-4f44-9618-2b3ad616ba16", + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] +} \ No newline at end of file diff --git a/bin/postman-test/environment/edgex.postman_environment.json b/bin/postman-test/environment/edgex.postman_environment.json new file mode 100644 index 00000000..d08afe08 --- /dev/null +++ b/bin/postman-test/environment/edgex.postman_environment.json @@ -0,0 +1,54 @@ +{ + "id": "bbb9c780-0420-4a86-a7f2-cb7ef703c570", + "name": "edgex", + "values": [ + { + "key": "coreDataUrl", + "value": "http://edgex-core-data:48080", + "description": "", + "type": "text", + "enabled": true + }, + { + "key": "metaDataUrl", + "value": "http://edgex-core-metadata:48081", + "description": "", + "type": "text", + "enabled": true + }, + { + "key": "coreCommand", + "value": "http://edgex-core-command:48082", + "description": "", + "type": "text", + "enabled": true + }, + { + "key": "supportNotificationsUrl", + "value": "http://edgex-support-notifications:48060", + "enabled": true, + "type": "text" + }, + { + "key": "supportLoggingUrl", + "value": "edgex-support-logging:48061", + "enabled": true, + "type": "text" + }, + { + "key": "supportRulesengineUrl", + "value": "http://edgex-support-rulesengine:48075", + "enabled": true, + "type": "text" + }, + { + "key": "exportClientUrl", + "value": "http://edgex-export-client:48071", + "enabled": true, + "type": "text" + } + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2018-06-03T05:46:32.108Z", + "_postman_exported_using": "Postman/6.0.10" +} diff --git a/bin/postman-test/environment/local_edgex.postman_environment.json b/bin/postman-test/environment/local_edgex.postman_environment.json new file mode 100644 index 00000000..8103805f --- /dev/null +++ b/bin/postman-test/environment/local_edgex.postman_environment.json @@ -0,0 +1,55 @@ +{ + "id": "49f2f2c1-a38a-4205-bfeb-71838ded61e7", + "name": "local_edgex", + "values": [ + { + "key": "coreDataUrl", + "value": "http://localhost:48080", + "description": "", + "type": "text", + "enabled": true + }, + { + "key": "metaDataUrl", + "value": "http://localhost:48081", + "description": "", + "type": "text", + "enabled": true + }, + { + "key": "coreCommand", + "value": "http://localhost:48082", + "description": "", + "type": "text", + "enabled": true + }, + { + "key": "supportNotificationsUrl", + "value": "http://localhost:48060", + "enabled": true, + "type": "text" + }, + { + "key": "supportLoggingUrl", + "value": "http://localhost:48061", + "enabled": true, + "type": "text" + }, + { + "key": "supportRulesengineUrl", + "value": "http://localhost:48075", + "enabled": true, + "type": "text" + }, + { + "key": "exportClientUrl", + "value": "http://localhost:48071", + "enabled": true, + "type": "text" + } + + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2018-06-03T05:38:58.050Z", + "_postman_exported_using": "Postman/6.0.10" +} diff --git a/bin/postman-test/javascript/exportclient/exportConfiguration.js b/bin/postman-test/javascript/exportclient/exportConfiguration.js new file mode 100644 index 00000000..89db9f5c --- /dev/null +++ b/bin/postman-test/javascript/exportclient/exportConfiguration.js @@ -0,0 +1,15 @@ +var exportConfigurationsToBeRemoved = [ + ObjectId("5b0eb384fd4ca80001df4fa9"), + ObjectId("5b0eb384fd4ca80001df4fa2"), + ObjectId("5b0eb384fd4ca80001df4fa3") +]; + +db.exportConfiguration.remove({ + _id: { + $in: exportConfigurationsToBeRemoved + } +}); + +db.exportConfiguration.remove({ + name: "OSIClient" +}); \ No newline at end of file diff --git a/bin/run.sh b/bin/run.sh index 62f25e55..1ed9cdc4 100755 --- a/bin/run.sh +++ b/bin/run.sh @@ -11,6 +11,7 @@ BASEPATH=$(dirname "$0")/postman-test/scriptLogs COREDATALOGSPATH=$BASEPATH/coreData$TIMESTAMPFORMAT.log METADATALOGSPATH=$BASEPATH/metaData$TIMESTAMPFORMAT.log COMMANDLOGSPATH=$BASEPATH/command$TIMESTAMPFORMAT.log +EXPORTCLIENTLOGSPATH=$BASEPATH/command$TIMESTAMPFORMAT.log EDGEXLOGSPATH=$BASEPATH/edgex$TIMESTAMPFORMAT.log coreDataTest() { @@ -38,11 +39,19 @@ commandTest() { } +exportClientTest() { + $(dirname "$0")/importExportClientDataDump.sh + $(dirname "$0")/exportClientTest.sh + $(dirname "$0")/flushExportClientDataDump.sh + +} + testAll() { coreDataTest metaDataTest commandTest + exportClientTest } #Main Script starts here @@ -68,12 +77,16 @@ case ${option} in echo "Info: Initiating Command Test" commandTest | tee $COMMANDLOGSPATH ;; + -exc) + echo "Info: Initiating ExportClient Test" + exportClientTest | tee $EXPORTCLIENTLOGSPATH + ;; -all) echo "Info: Initiating EdgeX Test" testAll | tee $EDGEXLOGSPATH ;; *) - echo "`basename ${0}`:usage: [-cd Coredata] | [-md Metadata] | [-co Command] | [-all All]" + echo "`basename ${0}`:usage: [-cd Coredata] | [-md Metadata] | [-co Command] | [-exc Export Client] | [-all All]" echo exit 0 ;; diff --git a/deploy-edgeX.sh b/deploy-edgeX.sh index 9f9f97fb..0429efed 100755 --- a/deploy-edgeX.sh +++ b/deploy-edgeX.sh @@ -73,10 +73,10 @@ sleep 5 #while ! $(docker-compose exec -T consul nc -z edgex-support-scheduler 48085);do echo "not already startup… wait for 5 second reconnect." ;sleep 5; done #sleep 5 -#run_service export-client +run_service export-client -#while ! $(docker-compose exec -T consul nc -z edgex-export-client 48071);do echo "not already startup… wait for 5 second reconnect." ;sleep 5; done -#sleep 5 +while ! $(docker-compose exec -T consul nc -z edgex-export-client 48071);do echo "not already startup… wait for 5 second reconnect." ;sleep 5; done +sleep 5 #run_service export-distro From c42e22851779fda02c60a8dd5f89e0f84eb96e04 Mon Sep 17 00:00:00 2001 From: Bruce Date: Thu, 12 Jul 2018 00:12:09 +0800 Subject: [PATCH 02/20] migrate to california 0.6.0 Signed-off-by: Bruce --- bin/arm64_env.sh | 25 ++++++++++++++----------- bin/env.sh | 24 +++++++++++++----------- deploy-edgeX.sh | 7 +++---- docker-compose.yml | 39 +++------------------------------------ 4 files changed, 33 insertions(+), 62 deletions(-) diff --git a/bin/arm64_env.sh b/bin/arm64_env.sh index b91fdbca..6c7ae9bb 100755 --- a/bin/arm64_env.sh +++ b/bin/arm64_env.sh @@ -1,16 +1,19 @@ #!/bin/bash -export volume=edgexfoundry/docker-edgex-volume -export consul=consul:1.1.0 -export coreMetadata=nexus3.edgexfoundry.org:10004/docker-core-metadata-go-arm64 -export coreConfigseed=nexus3.edgexfoundry.org:10004/docker-core-config-seed-go-arm64:master -export mongo=edgexfoundry/docker-edgex-mongo -export supportLogging=nexus3.edgexfoundry.org:10004/docker-support-logging-go-arm64 +export volume=nexus3.edgexfoundry.org:10004/docker-edgex-volume-arm64:master +export consul=nexus3.edgexfoundry.org:10001/arm64v8/consul:1.1.0 +export configSeed=nexus3.edgexfoundry.org:10004/docker-core-config-seed-go-arm64 +export mongo=nexus3.edgexfoundry.org:10004/docker-edgex-mongo-arm64:master + export coreData=nexus3.edgexfoundry.org:10004/docker-core-data-go-arm64 +export coreMetadata=nexus3.edgexfoundry.org:10004/docker-core-metadata-go-arm64 export coreCommand=nexus3.edgexfoundry.org:10004/docker-core-command-go-arm64 -export supportScheduler=edgexfoundry/docker-support-scheduler -export exportClient=edgexfoundry/docker-export-client-go-arm64 -export exportDistro=edgexfoundry/docker-export-distro-go-arm64 -export supportRulesengine=edgexfoundry/docker-support-rulesengine -export deviceVirtual=edgexfoundry/docker-device-virtual +export supportLogging=nexus3.edgexfoundry.org:10004/docker-support-logging-go-arm64 +export supportNotifications=nexus3.edgexfoundry.org:10004/docker-support-notifications-arm64:0.6.0 +export supportScheduler=nexus3.edgexfoundry.org:10004/docker-support-scheduler-arm64:0.6.0 +export supportRulesengine=nexus3.edgexfoundry.org:10004/docker-support-rulesengine-arm64:0.6.0 + +export exportClient=nexus3.edgexfoundry.org:10004/docker-export-client-go-arm64 +export exportDistro=nexus3.edgexfoundry.org:10004/docker-export-distro-go-arm64 +export deviceVirtual=nexus3.edgexfoundry.org:10004/docker-device-virtual-arm64 \ No newline at end of file diff --git a/bin/env.sh b/bin/env.sh index 0ff2f1b2..1bfa0f37 100755 --- a/bin/env.sh +++ b/bin/env.sh @@ -1,17 +1,19 @@ #!/bin/bash -export volume=edgexfoundry/docker-edgex-volume +export volume=nexus3.edgexfoundry.org:10004/docker-edgex-volume:master export consul=consul:1.1.0 -export coreMetadata=nexus3.edgexfoundry.org:10004/docker-core-metadata-go -export coreConfigseed=nexus3.edgexfoundry.org:10004/docker-core-config-seed-go:master -export mongo=edgexfoundry/docker-edgex-mongo -export mongoSeed=edgexfoundry/docker-edgex-mongo-seed -export supportLogging=nexus3.edgexfoundry.org:10004/docker-support-logging +export configSeed=nexus3.edgexfoundry.org:10004/docker-core-config-seed-go +export mongo=nexus3.edgexfoundry.org:10004/docker-edgex-mongo:master + export coreData=nexus3.edgexfoundry.org:10004/docker-core-data-go +export coreMetadata=nexus3.edgexfoundry.org:10004/docker-core-metadata-go export coreCommand=nexus3.edgexfoundry.org:10004/docker-core-command-go -export supportScheduler=edgexfoundry/docker-support-scheduler -export exportClient=edgexfoundry/docker-export-client -export exportDistro=edgexfoundry/docker-export-distro -export supportRulesengine=edgexfoundry/docker-support-rulesengine -export deviceVirtual=edgexfoundry/docker-device-virtual +export supportLogging=nexus3.edgexfoundry.org:10004/docker-support-logging-go +export supportNotifications=nexus3.edgexfoundry.org:10004/docker-support-notifications +export supportScheduler=nexus3.edgexfoundry.org:10004/docker-support-scheduler +export supportRulesengine=nexus3.edgexfoundry.org:10004/docker-support-rulesengine + +export exportClient=nexus3.edgexfoundry.org:10004/docker-export-client-go +export exportDistro=nexus3.edgexfoundry.org:10004/docker-export-distro-go +export deviceVirtual=nexus3.edgexfoundry.org:10004/docker-device-virtual \ No newline at end of file diff --git a/deploy-edgeX.sh b/deploy-edgeX.sh index 0429efed..48a1e1b3 100755 --- a/deploy-edgeX.sh +++ b/deploy-edgeX.sh @@ -42,7 +42,6 @@ run_service mongo sleep 10 -run_service mongo-seed run_service logging while ! $(docker-compose exec -T consul nc -z edgex-support-logging 48061);do echo "not already startup… wait for 5 second reconnect." ;sleep 5; done @@ -78,10 +77,10 @@ run_service export-client while ! $(docker-compose exec -T consul nc -z edgex-export-client 48071);do echo "not already startup… wait for 5 second reconnect." ;sleep 5; done sleep 5 -#run_service export-distro +run_service export-distro -#while ! $(docker-compose exec -T consul nc -z edgex-export-distro 48070);do echo "not already startup… wait for 5 second reconnect." ;sleep 5; done -#sleep 5 +while ! $(docker-compose exec -T consul nc -z edgex-export-distro 48070);do echo "not already startup… wait for 5 second reconnect." ;sleep 5; done +sleep 5 #run_service rulesengine diff --git a/docker-compose.yml b/docker-compose.yml index 73e23247..2866f9c9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,7 +29,7 @@ services: - volume config-seed: - image: ${coreConfigseed} + image: ${configSeed} networks: edgex-network: aliases: @@ -52,19 +52,6 @@ services: - volume depends_on: - volume - command: --smallfiles - - mongo-seed: - image: ${mongoSeed} - networks: - edgex-network: - aliases: - - edgex-mongo-seed - volumes_from: - - volume - depends_on: - - volume - - mongo logging: image: ${supportLogging} @@ -79,12 +66,10 @@ services: depends_on: - volume - consul - - config-seed - mongo - - mongo-seed notifications: - image: edgexfoundry/docker-support-notifications + image: ${supportNotifications} ports: - "48060:48060" networks: @@ -96,9 +81,7 @@ services: depends_on: - volume - consul - - config-seed - mongo - - mongo-seed - logging metadata: @@ -115,9 +98,7 @@ services: depends_on: - volume - consul - - config-seed - mongo - - mongo-seed - logging data: @@ -134,9 +115,7 @@ services: depends_on: - volume - consul - - config-seed - mongo - - mongo-seed - logging - notifications @@ -153,9 +132,7 @@ services: depends_on: - volume - consul - - config-seed - mongo - - mongo-seed - logging - metadata @@ -172,9 +149,7 @@ services: depends_on: - volume - consul - - config-seed - mongo - - mongo-seed - logging - metadata - command @@ -192,9 +167,7 @@ services: depends_on: - volume - consul - - config-seed - mongo - - mongo-seed - logging - notifications - metadata @@ -214,9 +187,7 @@ services: depends_on: - volume - consul - - config-seed - mongo - - mongo-seed - logging - notifications - metadata @@ -236,9 +207,7 @@ services: depends_on: - volume - consul - - config-seed - mongo - - mongo-seed - logging - metadata - command @@ -261,9 +230,7 @@ services: depends_on: - volume - consul - - config-seed - mongo - - mongo-seed - logging - metadata - data @@ -407,4 +374,4 @@ services: networks: edgex-network: - driver: "bridge" + driver: "bridge" \ No newline at end of file From 0190649fa45ce8ce720c63346b0c3033114c9b83 Mon Sep 17 00:00:00 2001 From: Bruce Date: Thu, 12 Jul 2018 10:55:12 +0800 Subject: [PATCH 03/20] add populate.sh Signed-off-by: Bruce --- bin/postman-test/DataDumps/exportclient/populate.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 bin/postman-test/DataDumps/exportclient/populate.sh diff --git a/bin/postman-test/DataDumps/exportclient/populate.sh b/bin/postman-test/DataDumps/exportclient/populate.sh new file mode 100755 index 00000000..cbd327b1 --- /dev/null +++ b/bin/postman-test/DataDumps/exportclient/populate.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +mongoimport -d exportclient -c exportConfiguration --file exportConfigurationDb.json \ No newline at end of file From a65ce099d616a51636d4c42f09fd2bb8f8fb9eed Mon Sep 17 00:00:00 2001 From: Bruce Date: Thu, 12 Jul 2018 11:21:00 +0800 Subject: [PATCH 04/20] rename environment file Signed-off-by: Bruce --- bin/exportClientTest.sh | 2 +- .../edgex.postman_environment.json | 54 ------------------ ...ort-client-docker.postman_environment.json | 16 ++++++ .../export-client.postman_environment.json | 16 ++++++ .../local_edgex.postman_environment.json | 55 ------------------- 5 files changed, 33 insertions(+), 110 deletions(-) delete mode 100644 bin/postman-test/environment/edgex.postman_environment.json create mode 100644 bin/postman-test/environment/export-client-docker.postman_environment.json create mode 100644 bin/postman-test/environment/export-client.postman_environment.json delete mode 100644 bin/postman-test/environment/local_edgex.postman_environment.json diff --git a/bin/exportClientTest.sh b/bin/exportClientTest.sh index c2fc64ee..0ab7d3fc 100755 --- a/bin/exportClientTest.sh +++ b/bin/exportClientTest.sh @@ -3,7 +3,7 @@ NAMESFILE=$(dirname "$0")/files.sh COLLECTION_PATH="collections/export-client.postman_collection.json" -ENV_PATH="environment/edgex.postman_environment.json" +ENV_PATH="environment/export-client-docker.postman_environment.json" if [ -f $NAMESFILE ]; then diff --git a/bin/postman-test/environment/edgex.postman_environment.json b/bin/postman-test/environment/edgex.postman_environment.json deleted file mode 100644 index d08afe08..00000000 --- a/bin/postman-test/environment/edgex.postman_environment.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "id": "bbb9c780-0420-4a86-a7f2-cb7ef703c570", - "name": "edgex", - "values": [ - { - "key": "coreDataUrl", - "value": "http://edgex-core-data:48080", - "description": "", - "type": "text", - "enabled": true - }, - { - "key": "metaDataUrl", - "value": "http://edgex-core-metadata:48081", - "description": "", - "type": "text", - "enabled": true - }, - { - "key": "coreCommand", - "value": "http://edgex-core-command:48082", - "description": "", - "type": "text", - "enabled": true - }, - { - "key": "supportNotificationsUrl", - "value": "http://edgex-support-notifications:48060", - "enabled": true, - "type": "text" - }, - { - "key": "supportLoggingUrl", - "value": "edgex-support-logging:48061", - "enabled": true, - "type": "text" - }, - { - "key": "supportRulesengineUrl", - "value": "http://edgex-support-rulesengine:48075", - "enabled": true, - "type": "text" - }, - { - "key": "exportClientUrl", - "value": "http://edgex-export-client:48071", - "enabled": true, - "type": "text" - } - ], - "_postman_variable_scope": "environment", - "_postman_exported_at": "2018-06-03T05:46:32.108Z", - "_postman_exported_using": "Postman/6.0.10" -} diff --git a/bin/postman-test/environment/export-client-docker.postman_environment.json b/bin/postman-test/environment/export-client-docker.postman_environment.json new file mode 100644 index 00000000..e753a6d9 --- /dev/null +++ b/bin/postman-test/environment/export-client-docker.postman_environment.json @@ -0,0 +1,16 @@ +{ + "id": "19fd4ccb-8915-4621-97c7-647834bcef87", + "name": "export-client-docker", + "values": [ + { + "key": "exportClientUrl", + "value": "http://edgex-export-client:48071", + "description": "", + "type": "text", + "enabled": true + } + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2018-07-12T03:19:08.016Z", + "_postman_exported_using": "Postman/6.1.3" +} \ No newline at end of file diff --git a/bin/postman-test/environment/export-client.postman_environment.json b/bin/postman-test/environment/export-client.postman_environment.json new file mode 100644 index 00000000..c0bcb392 --- /dev/null +++ b/bin/postman-test/environment/export-client.postman_environment.json @@ -0,0 +1,16 @@ +{ + "id": "6c04ba1c-8955-4d69-ba14-02c84cbad321", + "name": "export-client", + "values": [ + { + "key": "exportClientUrl", + "value": "http://localhost:48071", + "description": "", + "type": "text", + "enabled": true + } + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2018-07-12T03:19:04.779Z", + "_postman_exported_using": "Postman/6.1.3" +} \ No newline at end of file diff --git a/bin/postman-test/environment/local_edgex.postman_environment.json b/bin/postman-test/environment/local_edgex.postman_environment.json deleted file mode 100644 index 8103805f..00000000 --- a/bin/postman-test/environment/local_edgex.postman_environment.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "id": "49f2f2c1-a38a-4205-bfeb-71838ded61e7", - "name": "local_edgex", - "values": [ - { - "key": "coreDataUrl", - "value": "http://localhost:48080", - "description": "", - "type": "text", - "enabled": true - }, - { - "key": "metaDataUrl", - "value": "http://localhost:48081", - "description": "", - "type": "text", - "enabled": true - }, - { - "key": "coreCommand", - "value": "http://localhost:48082", - "description": "", - "type": "text", - "enabled": true - }, - { - "key": "supportNotificationsUrl", - "value": "http://localhost:48060", - "enabled": true, - "type": "text" - }, - { - "key": "supportLoggingUrl", - "value": "http://localhost:48061", - "enabled": true, - "type": "text" - }, - { - "key": "supportRulesengineUrl", - "value": "http://localhost:48075", - "enabled": true, - "type": "text" - }, - { - "key": "exportClientUrl", - "value": "http://localhost:48071", - "enabled": true, - "type": "text" - } - - ], - "_postman_variable_scope": "environment", - "_postman_exported_at": "2018-06-03T05:38:58.050Z", - "_postman_exported_using": "Postman/6.0.10" -} From b911ce96ee27e48f5ef7034071f451b7932900eb Mon Sep 17 00:00:00 2001 From: Bruce Date: Sun, 15 Jul 2018 18:29:32 +0800 Subject: [PATCH 05/20] fix schema validation error Signed-off-by: Bruce --- .../export-client.postman_collection.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/postman-test/collections/export-client.postman_collection.json b/bin/postman-test/collections/export-client.postman_collection.json index a3c8ed29..7daf8118 100644 --- a/bin/postman-test/collections/export-client.postman_collection.json +++ b/bin/postman-test/collections/export-client.postman_collection.json @@ -287,10 +287,10 @@ { "listen": "prerequest", "script": { - "id": "5fa1802a-3f8e-4afb-b8b1-bf8975939563", + "id": "67686c79-2d26-463c-a38e-dc42fd876bc4", "type": "text/javascript", "exec": [ - "if(!data.loggingLabel){", + "if(!data.regID){", " pm.environment.set(\"regID\", \"5b0eb384fd4ca80001df4fa9\");", "}else{", " pm.environment.set(\"regID\", data.regID);", @@ -304,7 +304,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + "raw": "{\n \"name\":\"OSIClient\",\n \"enable\":false\n}" }, "url": { "raw": "{{exportClientUrl}}/api/v1/registration/{{regID}}", @@ -1015,7 +1015,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + "raw": "{\n \"name\":\"OSIClient\",\n \"enable\":false\n}" }, "url": { "raw": "{{exportClientUrl}}/api/v1/registration/name/{{nameNotFound}}", @@ -1432,7 +1432,7 @@ " \"title\":\"protocol\"", " },", " \"address\":{", - " \"type\":\"string\",", + " \"type\":[\"string\",\"null\"],", " \"required\":false,", " \"title\":\"address\"", " },", @@ -1447,22 +1447,22 @@ " \"title\":\"path\"", " },", " \"publisher\":{", - " \"type\":\"string\",", + " \"type\":[\"string\",\"null\"],", " \"required\":false,", " \"title\":\"publisher\"", " },", " \"user\":{", - " \"type\":\"string\",", + " \"type\":[\"string\",\"null\"],", " \"required\":false,", " \"title\":\"user\"", " },", " \"password\":{", - " \"type\":\"string\",", + " \"type\":[\"string\",\"null\"],", " \"required\":false,", " \"title\":\"password\"", " },", " \"topic\":{", - " \"type\":\"string\",", + " \"type\":[\"string\",\"null\"],", " \"required\":false,", " \"title\":\"topic\"", " }", From 9cc6f93a2db1408e9c59482a3ec2ca248bff4e91 Mon Sep 17 00:00:00 2001 From: Bruce Date: Thu, 28 Jun 2018 00:47:34 +0800 Subject: [PATCH 06/20] init export-client-test Signed-off-by: Bruce --- bin/exportClientTest.sh | 34 + bin/files.sh | 3 +- bin/flushExportClientDataDump.sh | 27 + bin/importExportClientDataDump.sh | 24 + .../exportclient/exportConfigurationDb.json | 124 ++ .../export-client.postman_collection.json | 1561 +++++++++++++++++ .../edgex.postman_environment.json | 54 + .../local_edgex.postman_environment.json | 55 + .../exportclient/exportConfiguration.js | 15 + bin/run.sh | 55 +- deploy-edgeX.sh | 6 +- 11 files changed, 1933 insertions(+), 25 deletions(-) create mode 100755 bin/exportClientTest.sh create mode 100755 bin/flushExportClientDataDump.sh create mode 100755 bin/importExportClientDataDump.sh create mode 100644 bin/postman-test/DataDumps/exportclient/exportConfigurationDb.json create mode 100644 bin/postman-test/collections/export-client.postman_collection.json create mode 100644 bin/postman-test/environment/edgex.postman_environment.json create mode 100644 bin/postman-test/environment/local_edgex.postman_environment.json create mode 100644 bin/postman-test/javascript/exportclient/exportConfiguration.js diff --git a/bin/exportClientTest.sh b/bin/exportClientTest.sh new file mode 100755 index 00000000..c2fc64ee --- /dev/null +++ b/bin/exportClientTest.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +NAMESFILE=$(dirname "$0")/files.sh + +COLLECTION_PATH="collections/export-client.postman_collection.json" +ENV_PATH="environment/edgex.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." diff --git a/bin/files.sh b/bin/files.sh index 57ce0c22..22723076 100755 --- a/bin/files.sh +++ b/bin/files.sh @@ -45,9 +45,10 @@ 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 -if [ -f $CONFIGFILE ]; then +if [ -f $CONFIGFILE ]; then source $CONFIGFILE diff --git a/bin/flushExportClientDataDump.sh b/bin/flushExportClientDataDump.sh new file mode 100755 index 00000000..b7209a0a --- /dev/null +++ b/bin/flushExportClientDataDump.sh @@ -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 diff --git a/bin/importExportClientDataDump.sh b/bin/importExportClientDataDump.sh new file mode 100755 index 00000000..0c158706 --- /dev/null +++ b/bin/importExportClientDataDump.sh @@ -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 diff --git a/bin/postman-test/DataDumps/exportclient/exportConfigurationDb.json b/bin/postman-test/DataDumps/exportclient/exportConfigurationDb.json new file mode 100644 index 00000000..b50144b2 --- /dev/null +++ b/bin/postman-test/DataDumps/exportclient/exportConfigurationDb.json @@ -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" +} \ No newline at end of file diff --git a/bin/postman-test/collections/export-client.postman_collection.json b/bin/postman-test/collections/export-client.postman_collection.json new file mode 100644 index 00000000..a3c8ed29 --- /dev/null +++ b/bin/postman-test/collections/export-client.postman_collection.json @@ -0,0 +1,1561 @@ +{ + "info": { + "_postman_id": "94d01352-09d4-46f1-a1a6-00b92a5170af", + "name": "export-client", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "registration", + "description": "", + "item": [ + { + "name": "Create a registration", + "event": [ + { + "listen": "test", + "script": { + "id": "683d513e-a052-4e1f-8530-780c5fd06c05", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration - POST", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + " ", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type is text/plain\", function(){", + " var contentType = postman.getResponseHeader(\"Content-Type\");", + " pm.expect(contentType).to.include(\"text/plain\");", + "});", + "", + "pm.test(\"Response body is correct\", function () {", + " pm.expect(pm.response.text().length === 24 ).to.be.true;", + "});" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"origin\":1471806386919,\n\t\"name\":\"OSIClient\",\n\t\"addressable\":\n\t{\t\n\t\t\"origin\":1471806386919,\n\t\t\"name\":\"OSIMQTTBroker\",\n\t\t\"protocol\":\"TCP\",\n\t\t\"address\":\"m10.cloudmqtt.com\",\n\t\t\"port\":15421,\n\t\t\"publisher\":\"EdgeXExportPublisher\",\n\t\t\"user\":\"hukfgtoh\",\n\t\t\"password\":\"uP6hJLYW6Ji4\",\n\t\t\"topic\":\"EdgeXDataTopic\"\n\t},\n\t\"format\":\"JSON\",\n\t\"filter\":\n\t{\n\t\t\"deviceIdentifiers\":[\"livingroomthermosat\", \"hallwaythermostat\"],\n\t\t\"valueDescriptorIdentifiers\":[\"temperature\", \"humidity\"]\n\t\t\n\t},\n\t\t\"encryption\":\n\t\t{\n\t\t\t\"encryptionAlgorithm\":\"AES\",\n\t\t\t\"encryptionKey\":\"123\",\n\t\t\t\"initializingVector\":\"123\"\n\t\t},\n\t\t\"compression\":\"GZIP\",\n\t\t\"enable\":true, \n\t\t\"destination\": \"REST_ENDPOINT\"\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration" + ] + }, + "description": "Add a new client export registration. Name must be unique across the database. Return ServiceException (HTTP 503) for unknown or unanticipated issues." + }, + "response": [] + }, + { + "name": "Modify a registration", + "event": [ + { + "listen": "test", + "script": { + "id": "b0233f73-59c2-4ea0-82a3-caaf14f99271", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration - PUT", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Response body is correct\", function () {", + " pm.expect(pm.response.text() === 'true' ).to.be.true;", + "});" + ] + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\": false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration" + ] + }, + "description": "Update a client export registration. Name & id are not updated as they are identifiers. Return NotFoundException (HTTP 404) if the existing export registration cannot be found by id or name. Return ServiceException (HTTP 503) for unknown or unanticipated issues." + }, + "response": [] + }, + { + "name": "Query a registration by name", + "event": [ + { + "listen": "test", + "script": { + "id": "023c4d17-a2f1-4c18-b2c6-8121221b0edb", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/name - GET", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "var schema = pm.globals.get(\"schemas\").registration;", + "var jsonData = pm.response.json();", + "", + "var expectRegistration = pm.environment.get(\"getName\");", + " ", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type is application/json\", function(){", + " var contentType = postman.getResponseHeader(\"Content-Type\");", + " pm.expect(contentType).to.include(\"application/json\");", + "});", + "", + "pm.test(\"Is valid response schema\", function () {", + " var result = tv4.validate(jsonData, schema);", + " if(!result){", + " console.log(tv4.error);", + " }", + " pm.expect(result).to.be.true;", + "});", + "", + "pm.test(\"Response body is correct\", function () {", + " pm.expect(jsonData.name===expectRegistration).to.be.true; ", + "});", + "", + "" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "3659413e-88db-4bfd-a658-add93a8a2b27", + "type": "text/javascript", + "exec": [ + "if(!data.loggingLabel){", + " pm.environment.set(\"getName\", \"OSIClient\");", + "}else{", + " pm.environment.set(\"getName\", data.getName);", + "}" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/name/{{getName}}", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "name", + "{{getName}}" + ] + }, + "description": "Fetch a client export registration by unique name. Response will be null if no export registration matches on name. Return ServiceException (HTTP 503) for unknown or unanticipated issues" + }, + "response": [] + }, + { + "name": "Query a registration by ID", + "event": [ + { + "listen": "test", + "script": { + "id": "dd27c513-464f-4576-81a5-d17921984635", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/id - GET", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "var schema = pm.globals.get(\"schemas\").registration;", + "var jsonData = pm.response.json();", + "", + "var expectRegistrationId = pm.environment.get(\"regID\");", + " ", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type is application/json\", function(){", + " var contentType = postman.getResponseHeader(\"Content-Type\");", + " pm.expect(contentType).to.include(\"application/json\");", + "});", + "", + "pm.test(\"Is valid response schema\", function () {", + " var result = tv4.validate(jsonData, schema);", + " if(!result){", + " console.log(tv4.error);", + " }", + " pm.expect(result).to.be.true;", + "});", + "", + "pm.test(\"Response body is correct\", function () {", + " pm.expect(jsonData.id===expectRegistrationId).to.be.true; ", + "});", + "" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "5fa1802a-3f8e-4afb-b8b1-bf8975939563", + "type": "text/javascript", + "exec": [ + "if(!data.loggingLabel){", + " pm.environment.set(\"regID\", \"5b0eb384fd4ca80001df4fa9\");", + "}else{", + " pm.environment.set(\"regID\", data.regID);", + "}" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/{{regID}}", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "{{regID}}" + ] + }, + "description": "Fetch a client export registration by id. Response will be null if no export registration matches on id. Return ServiceException (HTTP 503) for unknown or unanticipated issues." + }, + "response": [] + }, + { + "name": "Query all registration", + "event": [ + { + "listen": "test", + "script": { + "id": "24836363-c978-4fb7-9265-634203f591ab", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration - GET", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + " ", + "var schema = pm.globals.get(\"schemas\").registrationArray;", + "var jsonData = pm.response.json();", + " ", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type is application/json\", function(){", + " var contentType = postman.getResponseHeader(\"Content-Type\");", + " pm.expect(contentType).to.include(\"application/json\");", + "});", + "", + "pm.test(\"Is valid response schema\", function () {", + " var result = tv4.validate(jsonData, schema);", + " if(!result){", + " console.log(tv4.error);", + " }", + " pm.expect(result).to.be.true;", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration" + ] + }, + "description": "Fetch all client export registrations. Return ServiceException (HTTP 503) for unknown or unanticipated issues. No limits are exercised on this query at this time. May need to add this in the future if the number of clients is huge." + }, + "response": [] + }, + { + "name": "Query all supported algorithm property values", + "event": [ + { + "listen": "test", + "script": { + "id": "7d59f43a-dd65-4ecf-9b77-27811f39af8e", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/reference/algorithms - GET", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + " ", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type is application/json\", function(){", + " var contentType = postman.getResponseHeader(\"Content-Type\");", + " pm.expect(contentType).to.include(\"application/json\");", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/reference/algorithms", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "reference", + "algorithms" + ] + }, + "description": "Fetch all supported values for the specified Export Client registration property type. Types are algorithms, compressions, formats, and destinations. Return ServiceException (HTTP 503) for unknown type specifications." + }, + "response": [] + }, + { + "name": "Query all supported compression property values", + "event": [ + { + "listen": "test", + "script": { + "id": "3bd0626a-905e-4583-bc07-c530c43bc121", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/reference/compressions - GET", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type is application/json\", function(){", + " var contentType = postman.getResponseHeader(\"Content-Type\");", + " pm.expect(contentType).to.include(\"application/json\");", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/reference/compressions", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "reference", + "compressions" + ] + }, + "description": "Fetch all supported values for the specified Export Client registration property type. Types are algorithms, compressions, formats, and destinations. Return ServiceException (HTTP 503) for unknown type specifications." + }, + "response": [] + }, + { + "name": "Query all supported format property values", + "event": [ + { + "listen": "test", + "script": { + "id": "ef4b8936-a7ad-43ee-afd3-f14a467e32f3", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/reference/formats - GET", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type is application/json\", function(){", + " var contentType = postman.getResponseHeader(\"Content-Type\");", + " pm.expect(contentType).to.include(\"application/json\");", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/reference/formats", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "reference", + "formats" + ] + }, + "description": "Fetch all supported values for the specified Export Client registration property type. Types are algorithms, compressions, formats, and destinations. Return ServiceException (HTTP 503) for unknown type specifications." + }, + "response": [] + }, + { + "name": "Query all supported destination property values", + "event": [ + { + "listen": "test", + "script": { + "id": "93621cd9-fbca-49f8-980d-ae34d0618df6", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/reference/destinations - GET", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type is application/json\", function(){", + " var contentType = postman.getResponseHeader(\"Content-Type\");", + " pm.expect(contentType).to.include(\"application/json\");", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/reference/destinations", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "reference", + "destinations" + ] + }, + "description": "Fetch all supported values for the specified Export Client registration property type. Types are algorithms, compressions, formats, and destinations. Return ServiceException (HTTP 503) for unknown type specifications." + }, + "response": [] + }, + { + "name": "Delete a registration by ID", + "event": [ + { + "listen": "test", + "script": { + "id": "0066d782-d4cc-4ee9-9154-caf04fda1bce", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/id/id - DELETE", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Response body is correct\", function () {", + " pm.expect(pm.response.text() === 'true' ).to.be.true;", + "});" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "0ff0d2c6-abb7-4cc7-b917-a3b2bc94c514", + "type": "text/javascript", + "exec": [ + "if(!data.loggingLabel){", + " pm.environment.set(\"regDeleteID\", \"5b0eb384fd4ca80001df4fa2\");", + "}else{", + " pm.environment.set(\"regDeleteID\", data.regDeleteID);", + "}" + ] + } + } + ], + "request": { + "method": "DELETE", + "header": [], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/id/{{regDeleteID}}", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "id", + "{{regDeleteID}}" + ] + }, + "description": "Delete a client export registration by database id. Return NotFoundException (HTTP 404) if the existing export registration cannot be found by id. Return ServiceException (HTTP 503) for unknown or unanticipated issues." + }, + "response": [] + }, + { + "name": "Delete a registration by name", + "event": [ + { + "listen": "test", + "script": { + "id": "f9565f19-0801-4e0c-8b47-14241a244031", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/name - DELETE", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Response body is correct\", function () {", + " pm.expect(pm.response.text() === 'true' ).to.be.true;", + "});" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "8cfe0d53-f476-4774-adfb-40c4a193604d", + "type": "text/javascript", + "exec": [ + "if(!data.loggingLabel){", + " pm.environment.set(\"deleteName\", \"OSIClient3\");", + "}else{", + " pm.environment.set(\"deleteName\", data.deleteName);", + "}" + ] + } + } + ], + "request": { + "method": "DELETE", + "header": [], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/name/{{deleteName}}", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "name", + "{{deleteName}}" + ] + }, + "description": "Delete a client export registration by name. Return NotFoundException (HTTP 404) if the existing export registration cannot be found by name. Return ServiceException (HTTP 503) for unknown or unanticipated issues." + }, + "response": [] + } + ] + }, + { + "name": "registration_error_4xx", + "description": "", + "item": [ + { + "name": "Fail to create a registration by empty name", + "event": [ + { + "listen": "test", + "script": { + "id": "e0592ed8-c18d-4338-b076-b241a5d5b343", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration - POST - 400", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"origin\":1471806386919,\n\t\"name\":\"\",\n\t\"addressable\":\n\t{\t\n\t\t\"origin\":1471806386919,\n\t\t\"name\":\"OSIMQTTBroker\",\n\t\t\"protocol\":\"TCP\",\n\t\t\"address\":\"m10.cloudmqtt.com\",\n\t\t\"port\":15421,\n\t\t\"publisher\":\"EdgeXExportPublisher\",\n\t\t\"user\":\"hukfgtoh\",\n\t\t\"password\":\"uP6hJLYW6Ji4\",\n\t\t\"topic\":\"EdgeXDataTopic\"\n\t},\n\t\"format\":\"JSON\",\n\t\"filter\":\n\t{\n\t\t\"deviceIdentifiers\":[\"livingroomthermosat\", \"hallwaythermostat\"],\n\t\t\"valueDescriptorIdentifiers\":[\"temperature\", \"humidity\"]\n\t\t\n\t},\n\t\t\"encryption\":\n\t\t{\n\t\t\t\"encryptionAlgorithm\":\"AES\",\n\t\t\t\"encryptionKey\":\"123\",\n\t\t\t\"initializingVector\":\"123\"\n\t\t},\n\t\t\"compression\":\"GZIP\",\n\t\t\"enable\":true, \n\t\t\"destination\": \"REST_ENDPOINT\"\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration" + ] + }, + "description": "Add a new client export registration. Name must be unique across the database. Return ServiceException (HTTP 503) for unknown or unanticipated issues. This entry does not provide a name, thus returns a 400 error code." + }, + "response": [] + }, + { + "name": "Fail to modify registration by inexistent name field", + "event": [ + { + "listen": "test", + "script": { + "id": "510f7316-2b2b-467a-9c65-283aac327ae8", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration - PUT - 400", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "" + ] + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"names\":\"OSIClient\",\n\t\"enable\": false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration" + ] + }, + "description": "Update a client export registration. Name & id are not updated as they are identifiers. Return NotFoundException (HTTP 404) if the existing export registration cannot be found by id or name. Return ServiceException (HTTP 503) for unknown or unanticipated issues. Passes JSON containing no id or name identifier." + }, + "response": [] + }, + { + "name": "Fail to modify registration by inexistent name", + "event": [ + { + "listen": "test", + "script": { + "id": "1158a8e4-ae1e-4037-9f99-53eb881deacc", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration - PUT - 404", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "" + ] + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClientNotThere\",\n\t\"enable\": false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration" + ] + }, + "description": "Update a client export registration. Name & id are not updated as they are identifiers. Return NotFoundException (HTTP 404) if the existing export registration cannot be found by id or name. Return ServiceException (HTTP 503) for unknown or unanticipated issues. Passes JSON containing an name that does not exsist." + }, + "response": [] + }, + { + "name": "Fail to query registration by inexistent name", + "event": [ + { + "listen": "test", + "script": { + "id": "c509e893-6ab6-4a5e-b4ad-c3997ec5fdc9", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/name - GET - 404", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "b174d310-b3c3-4398-9aee-2f9738ec67c9", + "type": "text/javascript", + "exec": [ + "if(!data.loggingLabel){", + " pm.environment.set(\"nameNotFound\", \"OSIClientNotThere\");", + "}else{", + " pm.environment.set(\"nameNotFound\", data.nameNotFound);", + "}" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/name/{{nameNotFound}}", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "name", + "{{nameNotFound}}" + ] + }, + "description": "Fetch a client export registration by unique name. Response will be null if no export registration matches on name. Return ServiceException (HTTP 503) for unknown or unanticipated issues. Searches for a name that has not registration assocated with it." + }, + "response": [] + }, + { + "name": "Fail to query registration by inexistent ID", + "event": [ + { + "listen": "test", + "script": { + "id": "8014665a-aed1-4e9e-a1b5-f8d0dd16fbd0", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/id - GET - 404", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "7b2c1412-fa90-4e92-bff1-3d1d9f859911", + "type": "text/javascript", + "exec": [ + "if(!data.loggingLabel){", + " pm.environment.set(\"regIDNotFound\", \"thisregisnotthere\");", + "}else{", + " pm.environment.set(\"regIDNotFound\", data.regIDNotFound);", + "}" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/{{regIDNotFound}}", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "{{regIDNotFound}}" + ] + }, + "description": "Fetch a client export registration by id. Response will be null if no export registration matches on id. Return ServiceException (HTTP 503) for unknown or unanticipated issues. We attempt to get a registration via an id that doesn't exsist." + }, + "response": [] + }, + { + "name": "Fail to query property values by invalid property type", + "event": [ + { + "listen": "test", + "script": { + "id": "ca69de04-181d-4c4a-823f-9c0816ee737c", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/reference/algorithms - GET - 400", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/reference/invalid", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "reference", + "invalid" + ] + }, + "description": "Fetch all supported values for the specified Export Client registration property type. Types are algorithms, compressions, formats, and destinations. Return ServiceException (HTTP 503) for unknown type specifications." + }, + "response": [] + }, + { + "name": "Fail to delete registration by inexistent id", + "event": [ + { + "listen": "test", + "script": { + "id": "81430a21-0c98-4980-8364-a3c625312c3d", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/id/id - DELETE - 404", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "33ec4f00-b33f-411a-a87e-588125ebc2f6", + "type": "text/javascript", + "exec": [ + "if(!data.loggingLabel){", + " pm.environment.set(\"nameNotFound\", \"OSIClientNotThere\");", + "}else{", + " pm.environment.set(\"nameNotFound\", data.nameNotFound);", + "}" + ] + } + } + ], + "request": { + "method": "DELETE", + "header": [], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/name/{{nameNotFound}}", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "name", + "{{nameNotFound}}" + ] + }, + "description": "Delete a client export registration by database id. Return NotFoundException (HTTP 404) if the existing export registration cannot be found by id. Return ServiceException (HTTP 503) for unknown or unanticipated issues. Attempts to delete an entry with an id that does not exsist." + }, + "response": [] + }, + { + "name": "Fail to delete registration by inexistent id", + "event": [ + { + "listen": "test", + "script": { + "id": "de83487f-f543-4dc5-9c25-85dda6f8287e", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/id/id - DELETE - 404", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "446af669-41f6-43d6-aa5a-f1acb1d9f0f4", + "type": "text/javascript", + "exec": [ + "if(!data.loggingLabel){", + " pm.environment.set(\"regIDNotFound\", \"thisregisnotthere\");", + "}else{", + " pm.environment.set(\"regIDNotFound\", data.regIDNotFound);", + "}" + ] + } + } + ], + "request": { + "method": "DELETE", + "header": [], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/id/{{regIDNotFound}}", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "id", + "{{regIDNotFound}}" + ] + }, + "description": "Delete a client export registration by database id. Return NotFoundException (HTTP 404) if the existing export registration cannot be found by id. Return ServiceException (HTTP 503) for unknown or unanticipated issues. Attempts to delete an entry with an id that does not exsist." + }, + "response": [] + } + ] + }, + { + "name": "ping", + "description": "", + "item": [ + { + "name": "Test service providing an indication that the service is available.", + "event": [ + { + "listen": "test", + "script": { + "id": "0a31e29a-5204-406c-8eb5-a047d8a641b5", + "type": "text/javascript", + "exec": [ + " /**", + " * Test Case: /ping - GET", + " * Version: Alpha", + " * @Author: Tata Elxsi", + " * ", + " **/", + " ", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Response body is correct\", function () {", + " pm.expect(pm.response.text()).to.include(\"pong\");", + "});" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "{{exportClientUrl}}/api/v1/ping", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "ping" + ] + }, + "description": "Test service providing an indicatioon that the service is avaliable." + }, + "response": [] + } + ] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "id": "18db43d9-8a4e-4a65-a9af-f4c9d6bb9017", + "type": "text/javascript", + "exec": [ + "var schemas = {} ; ", + "", + "schemas.registration = {", + " \"type\":\"object\",", + " \"$schema\":\"http://json-schema.org/draft-03/schema#\",", + " \"description\":\"Defines the registration details on the part of north side export clients\",", + " \"title\":\"ExportRegistration\",", + " \"properties\":{", + " \"id\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"id\"", + " },", + " \"created\":{", + " \"type\":\"integer\",", + " \"required\":false,", + " \"title\":\"created\"", + " },", + " \"modified\":{", + " \"type\":\"integer\",", + " \"required\":false,", + " \"title\":\"modified\"", + " },", + " \"origin\":{", + " \"type\":\"integer\",", + " \"required\":false,", + " \"title\":\"origin\"", + " },", + " \"name\":{", + " \"type\":\"string\",", + " \"required\":true,", + " \"title\":\"name\"", + " },", + " \"addressable\":{", + " \"type\":\"object\",", + " \"properties\":{", + " \"id\":{", + " \"type\":[\"string\",\"null\"],", + " \"required\":false,", + " \"title\":\"id\"", + " },", + " \"created\":{", + " \"type\":\"integer\",", + " \"required\":false,", + " \"title\":\"created\"", + " },", + " \"modified\":{", + " \"type\":\"integer\",", + " \"required\":false,", + " \"title\":\"modified\"", + " },", + " \"origin\":{", + " \"type\":\"integer\",", + " \"required\":false,", + " \"title\":\"origin\"", + " },", + " \"name\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"name\"", + " },", + " \"protocol\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"protocol\"", + " },", + " \"address\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"address\"", + " },", + " \"port\":{", + " \"type\":\"integer\",", + " \"required\":false,", + " \"title\":\"port\"", + " },", + " \"path\":{", + " \"type\":[\"string\",\"null\"],", + " \"required\":false,", + " \"title\":\"path\"", + " },", + " \"publisher\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"publisher\"", + " },", + " \"user\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"user\"", + " },", + " \"password\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"password\"", + " },", + " \"topic\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"topic\"", + " }", + " }", + " },", + " \"format\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"format\"", + " },", + " \"filter\":{", + " \"type\":\"object\",", + " \"properties\":{", + " \"deviceIdentifiers\":{", + " \"type\":\"array\",", + " \"required\":false,", + " \"title\":\"deviceIdentifiers\",", + " \"items\":{", + " \"type\":\"string\",", + " \"title\":\"deviceIdentifiers\"", + " },", + " \"uniqueItems\":false", + " },", + " \"valueDescriptorIdentifiers\":{", + " \"type\":\"array\",", + " \"required\":false,", + " \"title\":\"valueDescriptorIdentifiers\",", + " \"items\":{", + " \"type\":\"string\",", + " \"title\":\"valueDescriptorIdentifiers\"", + " },", + " \"uniqueItems\":false", + " }", + " }", + " },", + " \"encryption\":{", + " \"type\":\"object\",", + " \"properties\":{", + " \"encryptionAlgorithm\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"encryptionAlgorithm\"", + " },", + " \"encryptionKey\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"encryptionKey\"", + " },", + " \"initializingVector\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"initializingVector\"", + " }", + " }", + " },", + " \"compression\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"compression\"", + " },", + " \"enable\":{", + " \"type\":\"boolean\",", + " \"required\":false,", + " \"title\":\"enable\"", + " }", + " }", + " };", + " ", + "schemas.registrationArray = {", + " \"$schema\": \"http://json-schema.org/draft-04/schema#\",", + " \"title\": \"The Array of Registration\",", + " \"type\": \"array\",", + " \"items\": {", + " \"$ref\": \"#/definitions/Registration\"", + " },", + " \"definitions\": {", + " \"Registration\": schemas.registration", + " }", + " };", + " ", + "pm.globals.set(\"schemas\", schemas);" + ] + } + }, + { + "listen": "test", + "script": { + "id": "77761ca0-cb23-4f44-9618-2b3ad616ba16", + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] +} \ No newline at end of file diff --git a/bin/postman-test/environment/edgex.postman_environment.json b/bin/postman-test/environment/edgex.postman_environment.json new file mode 100644 index 00000000..d08afe08 --- /dev/null +++ b/bin/postman-test/environment/edgex.postman_environment.json @@ -0,0 +1,54 @@ +{ + "id": "bbb9c780-0420-4a86-a7f2-cb7ef703c570", + "name": "edgex", + "values": [ + { + "key": "coreDataUrl", + "value": "http://edgex-core-data:48080", + "description": "", + "type": "text", + "enabled": true + }, + { + "key": "metaDataUrl", + "value": "http://edgex-core-metadata:48081", + "description": "", + "type": "text", + "enabled": true + }, + { + "key": "coreCommand", + "value": "http://edgex-core-command:48082", + "description": "", + "type": "text", + "enabled": true + }, + { + "key": "supportNotificationsUrl", + "value": "http://edgex-support-notifications:48060", + "enabled": true, + "type": "text" + }, + { + "key": "supportLoggingUrl", + "value": "edgex-support-logging:48061", + "enabled": true, + "type": "text" + }, + { + "key": "supportRulesengineUrl", + "value": "http://edgex-support-rulesengine:48075", + "enabled": true, + "type": "text" + }, + { + "key": "exportClientUrl", + "value": "http://edgex-export-client:48071", + "enabled": true, + "type": "text" + } + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2018-06-03T05:46:32.108Z", + "_postman_exported_using": "Postman/6.0.10" +} diff --git a/bin/postman-test/environment/local_edgex.postman_environment.json b/bin/postman-test/environment/local_edgex.postman_environment.json new file mode 100644 index 00000000..8103805f --- /dev/null +++ b/bin/postman-test/environment/local_edgex.postman_environment.json @@ -0,0 +1,55 @@ +{ + "id": "49f2f2c1-a38a-4205-bfeb-71838ded61e7", + "name": "local_edgex", + "values": [ + { + "key": "coreDataUrl", + "value": "http://localhost:48080", + "description": "", + "type": "text", + "enabled": true + }, + { + "key": "metaDataUrl", + "value": "http://localhost:48081", + "description": "", + "type": "text", + "enabled": true + }, + { + "key": "coreCommand", + "value": "http://localhost:48082", + "description": "", + "type": "text", + "enabled": true + }, + { + "key": "supportNotificationsUrl", + "value": "http://localhost:48060", + "enabled": true, + "type": "text" + }, + { + "key": "supportLoggingUrl", + "value": "http://localhost:48061", + "enabled": true, + "type": "text" + }, + { + "key": "supportRulesengineUrl", + "value": "http://localhost:48075", + "enabled": true, + "type": "text" + }, + { + "key": "exportClientUrl", + "value": "http://localhost:48071", + "enabled": true, + "type": "text" + } + + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2018-06-03T05:38:58.050Z", + "_postman_exported_using": "Postman/6.0.10" +} diff --git a/bin/postman-test/javascript/exportclient/exportConfiguration.js b/bin/postman-test/javascript/exportclient/exportConfiguration.js new file mode 100644 index 00000000..89db9f5c --- /dev/null +++ b/bin/postman-test/javascript/exportclient/exportConfiguration.js @@ -0,0 +1,15 @@ +var exportConfigurationsToBeRemoved = [ + ObjectId("5b0eb384fd4ca80001df4fa9"), + ObjectId("5b0eb384fd4ca80001df4fa2"), + ObjectId("5b0eb384fd4ca80001df4fa3") +]; + +db.exportConfiguration.remove({ + _id: { + $in: exportConfigurationsToBeRemoved + } +}); + +db.exportConfiguration.remove({ + name: "OSIClient" +}); \ No newline at end of file diff --git a/bin/run.sh b/bin/run.sh index 5b8b10be..aea4d020 100755 --- a/bin/run.sh +++ b/bin/run.sh @@ -16,6 +16,7 @@ COMMANDLOGSPATH=$BASEPATH/command$TIMESTAMPFORMAT.log LOGGINGLOGSPATH=$BASEPATH/logging$TIMESTAMPFORMAT.log SUPPORT_NOTIFICATION_LOG_PATH=$BASEPATH/supportNotification$TIMESTAMPFORMAT.log EDGEXLOGSPATH=$BASEPATH/edgex$TIMESTAMPFORMAT.log +EXPORTCLIENTLOGSPATH=$BASEPATH/command$TIMESTAMPFORMAT.log coreDataTest() { @@ -26,7 +27,7 @@ coreDataTest() { } -metaDataTest() { +metaDataTest() { $(dirname "$0")/importMetaDataDumps.sh $(dirname "$0")/metadataTest.sh @@ -44,7 +45,7 @@ commandTest() { loggingTest() { - + $(dirname "$0")/importLoggingDataDump.sh $(dirname "$0")/loggingTest.sh $(dirname "$0")/flushLoggingDataDump.sh @@ -54,7 +55,14 @@ supportNotificationTest(){ $(dirname "$0")/importSupportNotificationDump.sh $(dirname "$0")/supportNotificationsTest.sh $(dirname "$0")/flushSupportNotificationDump.sh - + +} + +exportClientTest() { + $(dirname "$0")/importExportClientDataDump.sh + $(dirname "$0")/exportClientTest.sh + $(dirname "$0")/flushExportClientDataDump.sh + } testAll() { @@ -64,7 +72,8 @@ testAll() { commandTest loggingTest supportNotificationTest - + exportClientTest + } #Main Script starts here @@ -77,36 +86,40 @@ VOLUME_CONTAINER=`echo ${VOLUME_CONTAINER} | cut -b 1-12` docker cp $(dirname "$0")/postman-test/. "${VOLUME_CONTAINER}":/etc/newman -case ${option} in - -cd) +case ${option} in + -cd) echo "Info: Initiating Coredata Test" coreDataTest | tee $COREDATALOGSPATH - ;; - -md) + ;; + -md) echo "Info: Initiating Metadata Test" metaDataTest | tee $METADATALOGSPATH ;; - -co) + -co) echo "Info: Initiating Command Test" commandTest | tee $COMMANDLOGSPATH ;; - -log) + -log) echo "Info: Initiating Logging Test" loggingTest | tee $LOGGINGLOGSPATH ;; -sn) - echo "Info: Initiating SupportNotifications Test" - supportNotificationTest | tee $SUPPORT_NOTIFICATION_LOG_PATH - ;; - -all) - echo "Info: Initiating EdgeX Test" + echo "Info: Initiating SupportNotifications Test" + supportNotificationTest | tee $SUPPORT_NOTIFICATION_LOG_PATH + ;; + -exc) + echo "Info: Initiating ExportClient Test" + exportClientTest | tee $EXPORTCLIENTLOGSPATH + ;; + -all) + echo "Info: Initiating EdgeX Test" testAll | tee $EDGEXLOGSPATH - ;; - *) - echo "`basename ${0}`:usage: [-cd Coredata] | [-md Metadata] | [-co Command] | [-sn SupportNotification] [-lo Logging] | [-all All]" - echo - exit 0 - ;; + ;; + *) + echo "`basename ${0}`:usage: [-cd Coredata] | [-md Metadata] | [-co Command] | [-sn SupportNotification] | [-lo Logging] | [-exc Export Client] | [-all All]" + echo + exit 0 + ;; esac diff --git a/deploy-edgeX.sh b/deploy-edgeX.sh index 13f01785..898ab78d 100755 --- a/deploy-edgeX.sh +++ b/deploy-edgeX.sh @@ -72,10 +72,10 @@ sleep 5 #while ! $(docker-compose exec -T consul nc -z edgex-support-scheduler 48085);do echo "not already startup… wait for 5 second reconnect." ;sleep 5; done #sleep 5 -#run_service export-client +run_service export-client -#while ! $(docker-compose exec -T consul nc -z edgex-export-client 48071);do echo "not already startup… wait for 5 second reconnect." ;sleep 5; done -#sleep 5 +while ! $(docker-compose exec -T consul nc -z edgex-export-client 48071);do echo "not already startup… wait for 5 second reconnect." ;sleep 5; done +sleep 5 #run_service export-distro From 154facb676433355dec90b70b3b4b0932b23aac9 Mon Sep 17 00:00:00 2001 From: Bruce Date: Thu, 12 Jul 2018 00:12:09 +0800 Subject: [PATCH 07/20] migrate to california 0.6.0 Signed-off-by: Bruce --- deploy-edgeX.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy-edgeX.sh b/deploy-edgeX.sh index 898ab78d..51a61dab 100755 --- a/deploy-edgeX.sh +++ b/deploy-edgeX.sh @@ -77,10 +77,10 @@ run_service export-client while ! $(docker-compose exec -T consul nc -z edgex-export-client 48071);do echo "not already startup… wait for 5 second reconnect." ;sleep 5; done sleep 5 -#run_service export-distro +run_service export-distro -#while ! $(docker-compose exec -T consul nc -z edgex-export-distro 48070);do echo "not already startup… wait for 5 second reconnect." ;sleep 5; done -#sleep 5 +while ! $(docker-compose exec -T consul nc -z edgex-export-distro 48070);do echo "not already startup… wait for 5 second reconnect." ;sleep 5; done +sleep 5 #run_service rulesengine From 991b3744b978775895b036fdf7f031217c70f7da Mon Sep 17 00:00:00 2001 From: Bruce Date: Thu, 12 Jul 2018 10:55:12 +0800 Subject: [PATCH 08/20] add populate.sh Signed-off-by: Bruce --- bin/postman-test/DataDumps/exportclient/populate.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 bin/postman-test/DataDumps/exportclient/populate.sh diff --git a/bin/postman-test/DataDumps/exportclient/populate.sh b/bin/postman-test/DataDumps/exportclient/populate.sh new file mode 100755 index 00000000..cbd327b1 --- /dev/null +++ b/bin/postman-test/DataDumps/exportclient/populate.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +mongoimport -d exportclient -c exportConfiguration --file exportConfigurationDb.json \ No newline at end of file From 6b804f581775225caef8368a9c74022dcb34355d Mon Sep 17 00:00:00 2001 From: Bruce Date: Thu, 12 Jul 2018 11:21:00 +0800 Subject: [PATCH 09/20] rename environment file Signed-off-by: Bruce --- bin/exportClientTest.sh | 2 +- .../edgex.postman_environment.json | 54 ------------------ ...ort-client-docker.postman_environment.json | 16 ++++++ .../export-client.postman_environment.json | 16 ++++++ .../local_edgex.postman_environment.json | 55 ------------------- 5 files changed, 33 insertions(+), 110 deletions(-) delete mode 100644 bin/postman-test/environment/edgex.postman_environment.json create mode 100644 bin/postman-test/environment/export-client-docker.postman_environment.json create mode 100644 bin/postman-test/environment/export-client.postman_environment.json delete mode 100644 bin/postman-test/environment/local_edgex.postman_environment.json diff --git a/bin/exportClientTest.sh b/bin/exportClientTest.sh index c2fc64ee..0ab7d3fc 100755 --- a/bin/exportClientTest.sh +++ b/bin/exportClientTest.sh @@ -3,7 +3,7 @@ NAMESFILE=$(dirname "$0")/files.sh COLLECTION_PATH="collections/export-client.postman_collection.json" -ENV_PATH="environment/edgex.postman_environment.json" +ENV_PATH="environment/export-client-docker.postman_environment.json" if [ -f $NAMESFILE ]; then diff --git a/bin/postman-test/environment/edgex.postman_environment.json b/bin/postman-test/environment/edgex.postman_environment.json deleted file mode 100644 index d08afe08..00000000 --- a/bin/postman-test/environment/edgex.postman_environment.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "id": "bbb9c780-0420-4a86-a7f2-cb7ef703c570", - "name": "edgex", - "values": [ - { - "key": "coreDataUrl", - "value": "http://edgex-core-data:48080", - "description": "", - "type": "text", - "enabled": true - }, - { - "key": "metaDataUrl", - "value": "http://edgex-core-metadata:48081", - "description": "", - "type": "text", - "enabled": true - }, - { - "key": "coreCommand", - "value": "http://edgex-core-command:48082", - "description": "", - "type": "text", - "enabled": true - }, - { - "key": "supportNotificationsUrl", - "value": "http://edgex-support-notifications:48060", - "enabled": true, - "type": "text" - }, - { - "key": "supportLoggingUrl", - "value": "edgex-support-logging:48061", - "enabled": true, - "type": "text" - }, - { - "key": "supportRulesengineUrl", - "value": "http://edgex-support-rulesengine:48075", - "enabled": true, - "type": "text" - }, - { - "key": "exportClientUrl", - "value": "http://edgex-export-client:48071", - "enabled": true, - "type": "text" - } - ], - "_postman_variable_scope": "environment", - "_postman_exported_at": "2018-06-03T05:46:32.108Z", - "_postman_exported_using": "Postman/6.0.10" -} diff --git a/bin/postman-test/environment/export-client-docker.postman_environment.json b/bin/postman-test/environment/export-client-docker.postman_environment.json new file mode 100644 index 00000000..e753a6d9 --- /dev/null +++ b/bin/postman-test/environment/export-client-docker.postman_environment.json @@ -0,0 +1,16 @@ +{ + "id": "19fd4ccb-8915-4621-97c7-647834bcef87", + "name": "export-client-docker", + "values": [ + { + "key": "exportClientUrl", + "value": "http://edgex-export-client:48071", + "description": "", + "type": "text", + "enabled": true + } + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2018-07-12T03:19:08.016Z", + "_postman_exported_using": "Postman/6.1.3" +} \ No newline at end of file diff --git a/bin/postman-test/environment/export-client.postman_environment.json b/bin/postman-test/environment/export-client.postman_environment.json new file mode 100644 index 00000000..c0bcb392 --- /dev/null +++ b/bin/postman-test/environment/export-client.postman_environment.json @@ -0,0 +1,16 @@ +{ + "id": "6c04ba1c-8955-4d69-ba14-02c84cbad321", + "name": "export-client", + "values": [ + { + "key": "exportClientUrl", + "value": "http://localhost:48071", + "description": "", + "type": "text", + "enabled": true + } + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2018-07-12T03:19:04.779Z", + "_postman_exported_using": "Postman/6.1.3" +} \ No newline at end of file diff --git a/bin/postman-test/environment/local_edgex.postman_environment.json b/bin/postman-test/environment/local_edgex.postman_environment.json deleted file mode 100644 index 8103805f..00000000 --- a/bin/postman-test/environment/local_edgex.postman_environment.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "id": "49f2f2c1-a38a-4205-bfeb-71838ded61e7", - "name": "local_edgex", - "values": [ - { - "key": "coreDataUrl", - "value": "http://localhost:48080", - "description": "", - "type": "text", - "enabled": true - }, - { - "key": "metaDataUrl", - "value": "http://localhost:48081", - "description": "", - "type": "text", - "enabled": true - }, - { - "key": "coreCommand", - "value": "http://localhost:48082", - "description": "", - "type": "text", - "enabled": true - }, - { - "key": "supportNotificationsUrl", - "value": "http://localhost:48060", - "enabled": true, - "type": "text" - }, - { - "key": "supportLoggingUrl", - "value": "http://localhost:48061", - "enabled": true, - "type": "text" - }, - { - "key": "supportRulesengineUrl", - "value": "http://localhost:48075", - "enabled": true, - "type": "text" - }, - { - "key": "exportClientUrl", - "value": "http://localhost:48071", - "enabled": true, - "type": "text" - } - - ], - "_postman_variable_scope": "environment", - "_postman_exported_at": "2018-06-03T05:38:58.050Z", - "_postman_exported_using": "Postman/6.0.10" -} From adc5d73773b643f43e7d7052cfa0ada6e0a58cef Mon Sep 17 00:00:00 2001 From: Bruce Date: Sun, 15 Jul 2018 18:29:32 +0800 Subject: [PATCH 10/20] fix schema validation error Signed-off-by: Bruce --- .../export-client.postman_collection.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/postman-test/collections/export-client.postman_collection.json b/bin/postman-test/collections/export-client.postman_collection.json index a3c8ed29..7daf8118 100644 --- a/bin/postman-test/collections/export-client.postman_collection.json +++ b/bin/postman-test/collections/export-client.postman_collection.json @@ -287,10 +287,10 @@ { "listen": "prerequest", "script": { - "id": "5fa1802a-3f8e-4afb-b8b1-bf8975939563", + "id": "67686c79-2d26-463c-a38e-dc42fd876bc4", "type": "text/javascript", "exec": [ - "if(!data.loggingLabel){", + "if(!data.regID){", " pm.environment.set(\"regID\", \"5b0eb384fd4ca80001df4fa9\");", "}else{", " pm.environment.set(\"regID\", data.regID);", @@ -304,7 +304,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + "raw": "{\n \"name\":\"OSIClient\",\n \"enable\":false\n}" }, "url": { "raw": "{{exportClientUrl}}/api/v1/registration/{{regID}}", @@ -1015,7 +1015,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + "raw": "{\n \"name\":\"OSIClient\",\n \"enable\":false\n}" }, "url": { "raw": "{{exportClientUrl}}/api/v1/registration/name/{{nameNotFound}}", @@ -1432,7 +1432,7 @@ " \"title\":\"protocol\"", " },", " \"address\":{", - " \"type\":\"string\",", + " \"type\":[\"string\",\"null\"],", " \"required\":false,", " \"title\":\"address\"", " },", @@ -1447,22 +1447,22 @@ " \"title\":\"path\"", " },", " \"publisher\":{", - " \"type\":\"string\",", + " \"type\":[\"string\",\"null\"],", " \"required\":false,", " \"title\":\"publisher\"", " },", " \"user\":{", - " \"type\":\"string\",", + " \"type\":[\"string\",\"null\"],", " \"required\":false,", " \"title\":\"user\"", " },", " \"password\":{", - " \"type\":\"string\",", + " \"type\":[\"string\",\"null\"],", " \"required\":false,", " \"title\":\"password\"", " },", " \"topic\":{", - " \"type\":\"string\",", + " \"type\":[\"string\",\"null\"],", " \"required\":false,", " \"title\":\"topic\"", " }", From e854cfed89b94d15180affea6e07681f452e6218 Mon Sep 17 00:00:00 2001 From: Bruce Date: Mon, 23 Jul 2018 23:26:42 +0800 Subject: [PATCH 11/20] add exportClientData.json Signed-off-by: Bruce --- bin/postman-test/data/exportClientData.json | 178 ++++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 bin/postman-test/data/exportClientData.json diff --git a/bin/postman-test/data/exportClientData.json b/bin/postman-test/data/exportClientData.json new file mode 100644 index 00000000..9945f549 --- /dev/null +++ b/bin/postman-test/data/exportClientData.json @@ -0,0 +1,178 @@ +[ + { + "getName": "OSIClient", + "deleteName": "OSIClient3", + "regID": "5b0eb384fd4ca80001df4fa9", + "regDeleteID": "5b0eb384fd4ca80001df4fa2", + "regIDNotFound": "thisregisnotthere", + "nameNotFound": "OSIClientNotThere", + "schema": + { + "type":"object", + "$schema":"http://json-schema.org/draft-03/schema#", + "description":"Defines the registration details on the part of north side export clients", + "title":"ExportRegistration", + "properties":{ + "id":{ + "type":"string", + "required":false, + "title":"id" + }, + "created":{ + "type":"integer", + "required":false, + "title":"created" + }, + "modified":{ + "type":"integer", + "required":false, + "title":"modified" + }, + "origin":{ + "type":"integer", + "required":false, + "title":"origin" + }, + "name":{ + "type":"string", + "required":true, + "title":"name" + }, + "addressable":{ + "type":"object", + "properties":{ + "id":{ + "type":"string", + "required":false, + "title":"id" + }, + "created":{ + "type":"integer", + "required":false, + "title":"created" + }, + "modified":{ + "type":"integer", + "required":false, + "title":"modified" + }, + "origin":{ + "type":"integer", + "required":false, + "title":"origin" + }, + "name":{ + "type":"string", + "required":false, + "title":"name" + }, + "protocol":{ + "type":"string", + "required":false, + "title":"protocol" + }, + "address":{ + "type":"string", + "required":false, + "title":"address" + }, + "port":{ + "type":"integer", + "required":false, + "title":"port" + }, + "path":{ + "type":"string", + "required":false, + "title":"path" + }, + "publisher":{ + "type":"string", + "required":false, + "title":"publisher" + }, + "user":{ + "type":"string", + "required":false, + "title":"user" + }, + "password":{ + "type":"string", + "required":false, + "title":"password" + }, + "topic":{ + "type":"string", + "required":false, + "title":"topic" + } + } + }, + "format":{ + "type":"string", + "required":false, + "title":"format" + }, + "filter":{ + "type":"object", + "properties":{ + "deviceIdentifiers":{ + "type":"array", + "required":false, + "title":"deviceIdentifiers", + "items":{ + "type":"string", + "title":"deviceIdentifiers" + }, + "uniqueItems":false + }, + "valueDescriptorIdentifiers":{ + "type":"array", + "required":false, + "title":"valueDescriptorIdentifiers", + "items":{ + "type":"string", + "title":"valueDescriptorIdentifiers" + }, + "uniqueItems":false + } + } + }, + "encryption":{ + "type":"object", + "properties":{ + "encryptionAlgorithm":{ + "type":"string", + "required":false, + "title":"encryptionAlgorithm" + }, + "encryptionKey":{ + "type":"string", + "required":false, + "title":"encryptionKey" + }, + "initializingVector":{ + "type":"string", + "required":false, + "title":"initializingVector" + } + } + }, + "compression":{ + "type":"string", + "required":false, + "title":"compression" + }, + "enable":{ + "type":"boolean", + "required":false, + "title":"enable" + } + } + } + + } +] + + + From be72d6fc79ba9491d63ab955045dd29449474874 Mon Sep 17 00:00:00 2001 From: Bruce Date: Tue, 24 Jul 2018 22:06:25 +0800 Subject: [PATCH 12/20] change docker image version to 0.5.x Signed-off-by: Bruce --- bin/arm64_env.sh | 22 +++++++++++----------- bin/env.sh | 22 +++++++++++----------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/bin/arm64_env.sh b/bin/arm64_env.sh index 6c7ae9bb..3827ae50 100755 --- a/bin/arm64_env.sh +++ b/bin/arm64_env.sh @@ -2,18 +2,18 @@ export volume=nexus3.edgexfoundry.org:10004/docker-edgex-volume-arm64:master export consul=nexus3.edgexfoundry.org:10001/arm64v8/consul:1.1.0 -export configSeed=nexus3.edgexfoundry.org:10004/docker-core-config-seed-go-arm64 +export configSeed=nexus3.edgexfoundry.org:10004/docker-core-config-seed-go-arm64:master export mongo=nexus3.edgexfoundry.org:10004/docker-edgex-mongo-arm64:master -export coreData=nexus3.edgexfoundry.org:10004/docker-core-data-go-arm64 -export coreMetadata=nexus3.edgexfoundry.org:10004/docker-core-metadata-go-arm64 -export coreCommand=nexus3.edgexfoundry.org:10004/docker-core-command-go-arm64 +export coreData=nexus3.edgexfoundry.org:10004/docker-core-data-go-arm64:0.5.2 +export coreMetadata=nexus3.edgexfoundry.org:10004/docker-core-metadata-go-arm64:0.5.2 +export coreCommand=nexus3.edgexfoundry.org:10004/docker-core-command-go-arm64:0.5.2 -export supportLogging=nexus3.edgexfoundry.org:10004/docker-support-logging-go-arm64 -export supportNotifications=nexus3.edgexfoundry.org:10004/docker-support-notifications-arm64:0.6.0 -export supportScheduler=nexus3.edgexfoundry.org:10004/docker-support-scheduler-arm64:0.6.0 -export supportRulesengine=nexus3.edgexfoundry.org:10004/docker-support-rulesengine-arm64:0.6.0 +export supportLogging=nexus3.edgexfoundry.org:10004/docker-support-logging-go-arm64:0.5.2 +export supportNotifications=nexus3.edgexfoundry.org:10004/docker-support-notifications-arm64:0.5.0 +export supportScheduler=nexus3.edgexfoundry.org:10004/docker-support-scheduler-arm64:0.5.0 +export supportRulesengine=nexus3.edgexfoundry.org:10004/docker-support-rulesengine-arm64:0.5.0 -export exportClient=nexus3.edgexfoundry.org:10004/docker-export-client-go-arm64 -export exportDistro=nexus3.edgexfoundry.org:10004/docker-export-distro-go-arm64 -export deviceVirtual=nexus3.edgexfoundry.org:10004/docker-device-virtual-arm64 \ No newline at end of file +export exportClient=nexus3.edgexfoundry.org:10004/docker-export-client-go-arm64:0.5.2 +export exportDistro=nexus3.edgexfoundry.org:10004/docker-export-distro-go-arm64:0.5.2 +export deviceVirtual=nexus3.edgexfoundry.org:10004/docker-device-virtual-arm64:0.5.0 \ No newline at end of file diff --git a/bin/env.sh b/bin/env.sh index 1bfa0f37..518a133a 100755 --- a/bin/env.sh +++ b/bin/env.sh @@ -2,18 +2,18 @@ export volume=nexus3.edgexfoundry.org:10004/docker-edgex-volume:master export consul=consul:1.1.0 -export configSeed=nexus3.edgexfoundry.org:10004/docker-core-config-seed-go +export configSeed=nexus3.edgexfoundry.org:10004/docker-core-config-seed-go:master export mongo=nexus3.edgexfoundry.org:10004/docker-edgex-mongo:master -export coreData=nexus3.edgexfoundry.org:10004/docker-core-data-go -export coreMetadata=nexus3.edgexfoundry.org:10004/docker-core-metadata-go -export coreCommand=nexus3.edgexfoundry.org:10004/docker-core-command-go +export coreData=nexus3.edgexfoundry.org:10004/docker-core-data-go:0.5.2 +export coreMetadata=nexus3.edgexfoundry.org:10004/docker-core-metadata-go:0.5.2 +export coreCommand=nexus3.edgexfoundry.org:10004/docker-core-command-go:0.5.2 -export supportLogging=nexus3.edgexfoundry.org:10004/docker-support-logging-go -export supportNotifications=nexus3.edgexfoundry.org:10004/docker-support-notifications -export supportScheduler=nexus3.edgexfoundry.org:10004/docker-support-scheduler -export supportRulesengine=nexus3.edgexfoundry.org:10004/docker-support-rulesengine +export supportLogging=nexus3.edgexfoundry.org:10004/docker-support-logging-go:0.5.2 +export supportNotifications=nexus3.edgexfoundry.org:10004/docker-support-notifications:0.5.0 +export supportScheduler=nexus3.edgexfoundry.org:10004/docker-support-scheduler:0.5.0 +export supportRulesengine=nexus3.edgexfoundry.org:10004/docker-support-rulesengine:0.5.0 -export exportClient=nexus3.edgexfoundry.org:10004/docker-export-client-go -export exportDistro=nexus3.edgexfoundry.org:10004/docker-export-distro-go -export deviceVirtual=nexus3.edgexfoundry.org:10004/docker-device-virtual \ No newline at end of file +export exportClient=nexus3.edgexfoundry.org:10004/docker-export-client-go:0.5.2 +export exportDistro=nexus3.edgexfoundry.org:10004/docker-export-distro-go:0.5.2 +export deviceVirtual=nexus3.edgexfoundry.org:10004/docker-device-virtual:0.5.0 \ No newline at end of file From 7214ea15c35ad2d3891b065efe140b7ce55aba25 Mon Sep 17 00:00:00 2001 From: Bruce Date: Thu, 28 Jun 2018 00:47:34 +0800 Subject: [PATCH 13/20] init export-client-test Signed-off-by: Bruce --- bin/exportClientTest.sh | 34 + bin/files.sh | 1 + bin/flushExportClientDataDump.sh | 27 + bin/importExportClientDataDump.sh | 24 + .../exportclient/exportConfigurationDb.json | 124 ++ .../export-client.postman_collection.json | 1561 +++++++++++++++++ .../edgex.postman_environment.json | 54 + .../local_edgex.postman_environment.json | 55 + .../exportclient/exportConfiguration.js | 15 + bin/run.sh | 15 +- deploy-edgeX.sh | 6 +- 11 files changed, 1912 insertions(+), 4 deletions(-) create mode 100755 bin/exportClientTest.sh create mode 100755 bin/flushExportClientDataDump.sh create mode 100755 bin/importExportClientDataDump.sh create mode 100644 bin/postman-test/DataDumps/exportclient/exportConfigurationDb.json create mode 100644 bin/postman-test/collections/export-client.postman_collection.json create mode 100644 bin/postman-test/environment/edgex.postman_environment.json create mode 100644 bin/postman-test/environment/local_edgex.postman_environment.json create mode 100644 bin/postman-test/javascript/exportclient/exportConfiguration.js diff --git a/bin/exportClientTest.sh b/bin/exportClientTest.sh new file mode 100755 index 00000000..c2fc64ee --- /dev/null +++ b/bin/exportClientTest.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +NAMESFILE=$(dirname "$0")/files.sh + +COLLECTION_PATH="collections/export-client.postman_collection.json" +ENV_PATH="environment/edgex.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." diff --git a/bin/files.sh b/bin/files.sh index f6819cb7..3a5c019a 100755 --- a/bin/files.sh +++ b/bin/files.sh @@ -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 diff --git a/bin/flushExportClientDataDump.sh b/bin/flushExportClientDataDump.sh new file mode 100755 index 00000000..b7209a0a --- /dev/null +++ b/bin/flushExportClientDataDump.sh @@ -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 diff --git a/bin/importExportClientDataDump.sh b/bin/importExportClientDataDump.sh new file mode 100755 index 00000000..0c158706 --- /dev/null +++ b/bin/importExportClientDataDump.sh @@ -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 diff --git a/bin/postman-test/DataDumps/exportclient/exportConfigurationDb.json b/bin/postman-test/DataDumps/exportclient/exportConfigurationDb.json new file mode 100644 index 00000000..b50144b2 --- /dev/null +++ b/bin/postman-test/DataDumps/exportclient/exportConfigurationDb.json @@ -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" +} \ No newline at end of file diff --git a/bin/postman-test/collections/export-client.postman_collection.json b/bin/postman-test/collections/export-client.postman_collection.json new file mode 100644 index 00000000..a3c8ed29 --- /dev/null +++ b/bin/postman-test/collections/export-client.postman_collection.json @@ -0,0 +1,1561 @@ +{ + "info": { + "_postman_id": "94d01352-09d4-46f1-a1a6-00b92a5170af", + "name": "export-client", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "registration", + "description": "", + "item": [ + { + "name": "Create a registration", + "event": [ + { + "listen": "test", + "script": { + "id": "683d513e-a052-4e1f-8530-780c5fd06c05", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration - POST", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + " ", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type is text/plain\", function(){", + " var contentType = postman.getResponseHeader(\"Content-Type\");", + " pm.expect(contentType).to.include(\"text/plain\");", + "});", + "", + "pm.test(\"Response body is correct\", function () {", + " pm.expect(pm.response.text().length === 24 ).to.be.true;", + "});" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"origin\":1471806386919,\n\t\"name\":\"OSIClient\",\n\t\"addressable\":\n\t{\t\n\t\t\"origin\":1471806386919,\n\t\t\"name\":\"OSIMQTTBroker\",\n\t\t\"protocol\":\"TCP\",\n\t\t\"address\":\"m10.cloudmqtt.com\",\n\t\t\"port\":15421,\n\t\t\"publisher\":\"EdgeXExportPublisher\",\n\t\t\"user\":\"hukfgtoh\",\n\t\t\"password\":\"uP6hJLYW6Ji4\",\n\t\t\"topic\":\"EdgeXDataTopic\"\n\t},\n\t\"format\":\"JSON\",\n\t\"filter\":\n\t{\n\t\t\"deviceIdentifiers\":[\"livingroomthermosat\", \"hallwaythermostat\"],\n\t\t\"valueDescriptorIdentifiers\":[\"temperature\", \"humidity\"]\n\t\t\n\t},\n\t\t\"encryption\":\n\t\t{\n\t\t\t\"encryptionAlgorithm\":\"AES\",\n\t\t\t\"encryptionKey\":\"123\",\n\t\t\t\"initializingVector\":\"123\"\n\t\t},\n\t\t\"compression\":\"GZIP\",\n\t\t\"enable\":true, \n\t\t\"destination\": \"REST_ENDPOINT\"\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration" + ] + }, + "description": "Add a new client export registration. Name must be unique across the database. Return ServiceException (HTTP 503) for unknown or unanticipated issues." + }, + "response": [] + }, + { + "name": "Modify a registration", + "event": [ + { + "listen": "test", + "script": { + "id": "b0233f73-59c2-4ea0-82a3-caaf14f99271", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration - PUT", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Response body is correct\", function () {", + " pm.expect(pm.response.text() === 'true' ).to.be.true;", + "});" + ] + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\": false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration" + ] + }, + "description": "Update a client export registration. Name & id are not updated as they are identifiers. Return NotFoundException (HTTP 404) if the existing export registration cannot be found by id or name. Return ServiceException (HTTP 503) for unknown or unanticipated issues." + }, + "response": [] + }, + { + "name": "Query a registration by name", + "event": [ + { + "listen": "test", + "script": { + "id": "023c4d17-a2f1-4c18-b2c6-8121221b0edb", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/name - GET", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "var schema = pm.globals.get(\"schemas\").registration;", + "var jsonData = pm.response.json();", + "", + "var expectRegistration = pm.environment.get(\"getName\");", + " ", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type is application/json\", function(){", + " var contentType = postman.getResponseHeader(\"Content-Type\");", + " pm.expect(contentType).to.include(\"application/json\");", + "});", + "", + "pm.test(\"Is valid response schema\", function () {", + " var result = tv4.validate(jsonData, schema);", + " if(!result){", + " console.log(tv4.error);", + " }", + " pm.expect(result).to.be.true;", + "});", + "", + "pm.test(\"Response body is correct\", function () {", + " pm.expect(jsonData.name===expectRegistration).to.be.true; ", + "});", + "", + "" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "3659413e-88db-4bfd-a658-add93a8a2b27", + "type": "text/javascript", + "exec": [ + "if(!data.loggingLabel){", + " pm.environment.set(\"getName\", \"OSIClient\");", + "}else{", + " pm.environment.set(\"getName\", data.getName);", + "}" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/name/{{getName}}", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "name", + "{{getName}}" + ] + }, + "description": "Fetch a client export registration by unique name. Response will be null if no export registration matches on name. Return ServiceException (HTTP 503) for unknown or unanticipated issues" + }, + "response": [] + }, + { + "name": "Query a registration by ID", + "event": [ + { + "listen": "test", + "script": { + "id": "dd27c513-464f-4576-81a5-d17921984635", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/id - GET", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "var schema = pm.globals.get(\"schemas\").registration;", + "var jsonData = pm.response.json();", + "", + "var expectRegistrationId = pm.environment.get(\"regID\");", + " ", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type is application/json\", function(){", + " var contentType = postman.getResponseHeader(\"Content-Type\");", + " pm.expect(contentType).to.include(\"application/json\");", + "});", + "", + "pm.test(\"Is valid response schema\", function () {", + " var result = tv4.validate(jsonData, schema);", + " if(!result){", + " console.log(tv4.error);", + " }", + " pm.expect(result).to.be.true;", + "});", + "", + "pm.test(\"Response body is correct\", function () {", + " pm.expect(jsonData.id===expectRegistrationId).to.be.true; ", + "});", + "" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "5fa1802a-3f8e-4afb-b8b1-bf8975939563", + "type": "text/javascript", + "exec": [ + "if(!data.loggingLabel){", + " pm.environment.set(\"regID\", \"5b0eb384fd4ca80001df4fa9\");", + "}else{", + " pm.environment.set(\"regID\", data.regID);", + "}" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/{{regID}}", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "{{regID}}" + ] + }, + "description": "Fetch a client export registration by id. Response will be null if no export registration matches on id. Return ServiceException (HTTP 503) for unknown or unanticipated issues." + }, + "response": [] + }, + { + "name": "Query all registration", + "event": [ + { + "listen": "test", + "script": { + "id": "24836363-c978-4fb7-9265-634203f591ab", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration - GET", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + " ", + "var schema = pm.globals.get(\"schemas\").registrationArray;", + "var jsonData = pm.response.json();", + " ", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type is application/json\", function(){", + " var contentType = postman.getResponseHeader(\"Content-Type\");", + " pm.expect(contentType).to.include(\"application/json\");", + "});", + "", + "pm.test(\"Is valid response schema\", function () {", + " var result = tv4.validate(jsonData, schema);", + " if(!result){", + " console.log(tv4.error);", + " }", + " pm.expect(result).to.be.true;", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration" + ] + }, + "description": "Fetch all client export registrations. Return ServiceException (HTTP 503) for unknown or unanticipated issues. No limits are exercised on this query at this time. May need to add this in the future if the number of clients is huge." + }, + "response": [] + }, + { + "name": "Query all supported algorithm property values", + "event": [ + { + "listen": "test", + "script": { + "id": "7d59f43a-dd65-4ecf-9b77-27811f39af8e", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/reference/algorithms - GET", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + " ", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type is application/json\", function(){", + " var contentType = postman.getResponseHeader(\"Content-Type\");", + " pm.expect(contentType).to.include(\"application/json\");", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/reference/algorithms", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "reference", + "algorithms" + ] + }, + "description": "Fetch all supported values for the specified Export Client registration property type. Types are algorithms, compressions, formats, and destinations. Return ServiceException (HTTP 503) for unknown type specifications." + }, + "response": [] + }, + { + "name": "Query all supported compression property values", + "event": [ + { + "listen": "test", + "script": { + "id": "3bd0626a-905e-4583-bc07-c530c43bc121", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/reference/compressions - GET", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type is application/json\", function(){", + " var contentType = postman.getResponseHeader(\"Content-Type\");", + " pm.expect(contentType).to.include(\"application/json\");", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/reference/compressions", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "reference", + "compressions" + ] + }, + "description": "Fetch all supported values for the specified Export Client registration property type. Types are algorithms, compressions, formats, and destinations. Return ServiceException (HTTP 503) for unknown type specifications." + }, + "response": [] + }, + { + "name": "Query all supported format property values", + "event": [ + { + "listen": "test", + "script": { + "id": "ef4b8936-a7ad-43ee-afd3-f14a467e32f3", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/reference/formats - GET", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type is application/json\", function(){", + " var contentType = postman.getResponseHeader(\"Content-Type\");", + " pm.expect(contentType).to.include(\"application/json\");", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/reference/formats", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "reference", + "formats" + ] + }, + "description": "Fetch all supported values for the specified Export Client registration property type. Types are algorithms, compressions, formats, and destinations. Return ServiceException (HTTP 503) for unknown type specifications." + }, + "response": [] + }, + { + "name": "Query all supported destination property values", + "event": [ + { + "listen": "test", + "script": { + "id": "93621cd9-fbca-49f8-980d-ae34d0618df6", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/reference/destinations - GET", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type is application/json\", function(){", + " var contentType = postman.getResponseHeader(\"Content-Type\");", + " pm.expect(contentType).to.include(\"application/json\");", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/reference/destinations", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "reference", + "destinations" + ] + }, + "description": "Fetch all supported values for the specified Export Client registration property type. Types are algorithms, compressions, formats, and destinations. Return ServiceException (HTTP 503) for unknown type specifications." + }, + "response": [] + }, + { + "name": "Delete a registration by ID", + "event": [ + { + "listen": "test", + "script": { + "id": "0066d782-d4cc-4ee9-9154-caf04fda1bce", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/id/id - DELETE", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Response body is correct\", function () {", + " pm.expect(pm.response.text() === 'true' ).to.be.true;", + "});" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "0ff0d2c6-abb7-4cc7-b917-a3b2bc94c514", + "type": "text/javascript", + "exec": [ + "if(!data.loggingLabel){", + " pm.environment.set(\"regDeleteID\", \"5b0eb384fd4ca80001df4fa2\");", + "}else{", + " pm.environment.set(\"regDeleteID\", data.regDeleteID);", + "}" + ] + } + } + ], + "request": { + "method": "DELETE", + "header": [], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/id/{{regDeleteID}}", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "id", + "{{regDeleteID}}" + ] + }, + "description": "Delete a client export registration by database id. Return NotFoundException (HTTP 404) if the existing export registration cannot be found by id. Return ServiceException (HTTP 503) for unknown or unanticipated issues." + }, + "response": [] + }, + { + "name": "Delete a registration by name", + "event": [ + { + "listen": "test", + "script": { + "id": "f9565f19-0801-4e0c-8b47-14241a244031", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/name - DELETE", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Response body is correct\", function () {", + " pm.expect(pm.response.text() === 'true' ).to.be.true;", + "});" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "8cfe0d53-f476-4774-adfb-40c4a193604d", + "type": "text/javascript", + "exec": [ + "if(!data.loggingLabel){", + " pm.environment.set(\"deleteName\", \"OSIClient3\");", + "}else{", + " pm.environment.set(\"deleteName\", data.deleteName);", + "}" + ] + } + } + ], + "request": { + "method": "DELETE", + "header": [], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/name/{{deleteName}}", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "name", + "{{deleteName}}" + ] + }, + "description": "Delete a client export registration by name. Return NotFoundException (HTTP 404) if the existing export registration cannot be found by name. Return ServiceException (HTTP 503) for unknown or unanticipated issues." + }, + "response": [] + } + ] + }, + { + "name": "registration_error_4xx", + "description": "", + "item": [ + { + "name": "Fail to create a registration by empty name", + "event": [ + { + "listen": "test", + "script": { + "id": "e0592ed8-c18d-4338-b076-b241a5d5b343", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration - POST - 400", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"origin\":1471806386919,\n\t\"name\":\"\",\n\t\"addressable\":\n\t{\t\n\t\t\"origin\":1471806386919,\n\t\t\"name\":\"OSIMQTTBroker\",\n\t\t\"protocol\":\"TCP\",\n\t\t\"address\":\"m10.cloudmqtt.com\",\n\t\t\"port\":15421,\n\t\t\"publisher\":\"EdgeXExportPublisher\",\n\t\t\"user\":\"hukfgtoh\",\n\t\t\"password\":\"uP6hJLYW6Ji4\",\n\t\t\"topic\":\"EdgeXDataTopic\"\n\t},\n\t\"format\":\"JSON\",\n\t\"filter\":\n\t{\n\t\t\"deviceIdentifiers\":[\"livingroomthermosat\", \"hallwaythermostat\"],\n\t\t\"valueDescriptorIdentifiers\":[\"temperature\", \"humidity\"]\n\t\t\n\t},\n\t\t\"encryption\":\n\t\t{\n\t\t\t\"encryptionAlgorithm\":\"AES\",\n\t\t\t\"encryptionKey\":\"123\",\n\t\t\t\"initializingVector\":\"123\"\n\t\t},\n\t\t\"compression\":\"GZIP\",\n\t\t\"enable\":true, \n\t\t\"destination\": \"REST_ENDPOINT\"\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration" + ] + }, + "description": "Add a new client export registration. Name must be unique across the database. Return ServiceException (HTTP 503) for unknown or unanticipated issues. This entry does not provide a name, thus returns a 400 error code." + }, + "response": [] + }, + { + "name": "Fail to modify registration by inexistent name field", + "event": [ + { + "listen": "test", + "script": { + "id": "510f7316-2b2b-467a-9c65-283aac327ae8", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration - PUT - 400", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "" + ] + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"names\":\"OSIClient\",\n\t\"enable\": false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration" + ] + }, + "description": "Update a client export registration. Name & id are not updated as they are identifiers. Return NotFoundException (HTTP 404) if the existing export registration cannot be found by id or name. Return ServiceException (HTTP 503) for unknown or unanticipated issues. Passes JSON containing no id or name identifier." + }, + "response": [] + }, + { + "name": "Fail to modify registration by inexistent name", + "event": [ + { + "listen": "test", + "script": { + "id": "1158a8e4-ae1e-4037-9f99-53eb881deacc", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration - PUT - 404", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "" + ] + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClientNotThere\",\n\t\"enable\": false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration" + ] + }, + "description": "Update a client export registration. Name & id are not updated as they are identifiers. Return NotFoundException (HTTP 404) if the existing export registration cannot be found by id or name. Return ServiceException (HTTP 503) for unknown or unanticipated issues. Passes JSON containing an name that does not exsist." + }, + "response": [] + }, + { + "name": "Fail to query registration by inexistent name", + "event": [ + { + "listen": "test", + "script": { + "id": "c509e893-6ab6-4a5e-b4ad-c3997ec5fdc9", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/name - GET - 404", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "b174d310-b3c3-4398-9aee-2f9738ec67c9", + "type": "text/javascript", + "exec": [ + "if(!data.loggingLabel){", + " pm.environment.set(\"nameNotFound\", \"OSIClientNotThere\");", + "}else{", + " pm.environment.set(\"nameNotFound\", data.nameNotFound);", + "}" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/name/{{nameNotFound}}", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "name", + "{{nameNotFound}}" + ] + }, + "description": "Fetch a client export registration by unique name. Response will be null if no export registration matches on name. Return ServiceException (HTTP 503) for unknown or unanticipated issues. Searches for a name that has not registration assocated with it." + }, + "response": [] + }, + { + "name": "Fail to query registration by inexistent ID", + "event": [ + { + "listen": "test", + "script": { + "id": "8014665a-aed1-4e9e-a1b5-f8d0dd16fbd0", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/id - GET - 404", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "7b2c1412-fa90-4e92-bff1-3d1d9f859911", + "type": "text/javascript", + "exec": [ + "if(!data.loggingLabel){", + " pm.environment.set(\"regIDNotFound\", \"thisregisnotthere\");", + "}else{", + " pm.environment.set(\"regIDNotFound\", data.regIDNotFound);", + "}" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/{{regIDNotFound}}", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "{{regIDNotFound}}" + ] + }, + "description": "Fetch a client export registration by id. Response will be null if no export registration matches on id. Return ServiceException (HTTP 503) for unknown or unanticipated issues. We attempt to get a registration via an id that doesn't exsist." + }, + "response": [] + }, + { + "name": "Fail to query property values by invalid property type", + "event": [ + { + "listen": "test", + "script": { + "id": "ca69de04-181d-4c4a-823f-9c0816ee737c", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/reference/algorithms - GET - 400", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/reference/invalid", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "reference", + "invalid" + ] + }, + "description": "Fetch all supported values for the specified Export Client registration property type. Types are algorithms, compressions, formats, and destinations. Return ServiceException (HTTP 503) for unknown type specifications." + }, + "response": [] + }, + { + "name": "Fail to delete registration by inexistent id", + "event": [ + { + "listen": "test", + "script": { + "id": "81430a21-0c98-4980-8364-a3c625312c3d", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/id/id - DELETE - 404", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "33ec4f00-b33f-411a-a87e-588125ebc2f6", + "type": "text/javascript", + "exec": [ + "if(!data.loggingLabel){", + " pm.environment.set(\"nameNotFound\", \"OSIClientNotThere\");", + "}else{", + " pm.environment.set(\"nameNotFound\", data.nameNotFound);", + "}" + ] + } + } + ], + "request": { + "method": "DELETE", + "header": [], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/name/{{nameNotFound}}", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "name", + "{{nameNotFound}}" + ] + }, + "description": "Delete a client export registration by database id. Return NotFoundException (HTTP 404) if the existing export registration cannot be found by id. Return ServiceException (HTTP 503) for unknown or unanticipated issues. Attempts to delete an entry with an id that does not exsist." + }, + "response": [] + }, + { + "name": "Fail to delete registration by inexistent id", + "event": [ + { + "listen": "test", + "script": { + "id": "de83487f-f543-4dc5-9c25-85dda6f8287e", + "type": "text/javascript", + "exec": [ + "/**", + " * Test Case: api/v1/registration/id/id - DELETE - 404", + " * Version: Alpha", + " * @Author: Tom Fleming", + " *", + " **/", + "", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});" + ] + } + }, + { + "listen": "prerequest", + "script": { + "id": "446af669-41f6-43d6-aa5a-f1acb1d9f0f4", + "type": "text/javascript", + "exec": [ + "if(!data.loggingLabel){", + " pm.environment.set(\"regIDNotFound\", \"thisregisnotthere\");", + "}else{", + " pm.environment.set(\"regIDNotFound\", data.regIDNotFound);", + "}" + ] + } + } + ], + "request": { + "method": "DELETE", + "header": [], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "{{exportClientUrl}}/api/v1/registration/id/{{regIDNotFound}}", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "registration", + "id", + "{{regIDNotFound}}" + ] + }, + "description": "Delete a client export registration by database id. Return NotFoundException (HTTP 404) if the existing export registration cannot be found by id. Return ServiceException (HTTP 503) for unknown or unanticipated issues. Attempts to delete an entry with an id that does not exsist." + }, + "response": [] + } + ] + }, + { + "name": "ping", + "description": "", + "item": [ + { + "name": "Test service providing an indication that the service is available.", + "event": [ + { + "listen": "test", + "script": { + "id": "0a31e29a-5204-406c-8eb5-a047d8a641b5", + "type": "text/javascript", + "exec": [ + " /**", + " * Test Case: /ping - GET", + " * Version: Alpha", + " * @Author: Tata Elxsi", + " * ", + " **/", + " ", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});", + "", + "pm.test(\"Content-Type is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Response body is correct\", function () {", + " pm.expect(pm.response.text()).to.include(\"pong\");", + "});" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "{{exportClientUrl}}/api/v1/ping", + "host": [ + "{{exportClientUrl}}" + ], + "path": [ + "api", + "v1", + "ping" + ] + }, + "description": "Test service providing an indicatioon that the service is avaliable." + }, + "response": [] + } + ] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "id": "18db43d9-8a4e-4a65-a9af-f4c9d6bb9017", + "type": "text/javascript", + "exec": [ + "var schemas = {} ; ", + "", + "schemas.registration = {", + " \"type\":\"object\",", + " \"$schema\":\"http://json-schema.org/draft-03/schema#\",", + " \"description\":\"Defines the registration details on the part of north side export clients\",", + " \"title\":\"ExportRegistration\",", + " \"properties\":{", + " \"id\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"id\"", + " },", + " \"created\":{", + " \"type\":\"integer\",", + " \"required\":false,", + " \"title\":\"created\"", + " },", + " \"modified\":{", + " \"type\":\"integer\",", + " \"required\":false,", + " \"title\":\"modified\"", + " },", + " \"origin\":{", + " \"type\":\"integer\",", + " \"required\":false,", + " \"title\":\"origin\"", + " },", + " \"name\":{", + " \"type\":\"string\",", + " \"required\":true,", + " \"title\":\"name\"", + " },", + " \"addressable\":{", + " \"type\":\"object\",", + " \"properties\":{", + " \"id\":{", + " \"type\":[\"string\",\"null\"],", + " \"required\":false,", + " \"title\":\"id\"", + " },", + " \"created\":{", + " \"type\":\"integer\",", + " \"required\":false,", + " \"title\":\"created\"", + " },", + " \"modified\":{", + " \"type\":\"integer\",", + " \"required\":false,", + " \"title\":\"modified\"", + " },", + " \"origin\":{", + " \"type\":\"integer\",", + " \"required\":false,", + " \"title\":\"origin\"", + " },", + " \"name\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"name\"", + " },", + " \"protocol\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"protocol\"", + " },", + " \"address\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"address\"", + " },", + " \"port\":{", + " \"type\":\"integer\",", + " \"required\":false,", + " \"title\":\"port\"", + " },", + " \"path\":{", + " \"type\":[\"string\",\"null\"],", + " \"required\":false,", + " \"title\":\"path\"", + " },", + " \"publisher\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"publisher\"", + " },", + " \"user\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"user\"", + " },", + " \"password\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"password\"", + " },", + " \"topic\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"topic\"", + " }", + " }", + " },", + " \"format\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"format\"", + " },", + " \"filter\":{", + " \"type\":\"object\",", + " \"properties\":{", + " \"deviceIdentifiers\":{", + " \"type\":\"array\",", + " \"required\":false,", + " \"title\":\"deviceIdentifiers\",", + " \"items\":{", + " \"type\":\"string\",", + " \"title\":\"deviceIdentifiers\"", + " },", + " \"uniqueItems\":false", + " },", + " \"valueDescriptorIdentifiers\":{", + " \"type\":\"array\",", + " \"required\":false,", + " \"title\":\"valueDescriptorIdentifiers\",", + " \"items\":{", + " \"type\":\"string\",", + " \"title\":\"valueDescriptorIdentifiers\"", + " },", + " \"uniqueItems\":false", + " }", + " }", + " },", + " \"encryption\":{", + " \"type\":\"object\",", + " \"properties\":{", + " \"encryptionAlgorithm\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"encryptionAlgorithm\"", + " },", + " \"encryptionKey\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"encryptionKey\"", + " },", + " \"initializingVector\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"initializingVector\"", + " }", + " }", + " },", + " \"compression\":{", + " \"type\":\"string\",", + " \"required\":false,", + " \"title\":\"compression\"", + " },", + " \"enable\":{", + " \"type\":\"boolean\",", + " \"required\":false,", + " \"title\":\"enable\"", + " }", + " }", + " };", + " ", + "schemas.registrationArray = {", + " \"$schema\": \"http://json-schema.org/draft-04/schema#\",", + " \"title\": \"The Array of Registration\",", + " \"type\": \"array\",", + " \"items\": {", + " \"$ref\": \"#/definitions/Registration\"", + " },", + " \"definitions\": {", + " \"Registration\": schemas.registration", + " }", + " };", + " ", + "pm.globals.set(\"schemas\", schemas);" + ] + } + }, + { + "listen": "test", + "script": { + "id": "77761ca0-cb23-4f44-9618-2b3ad616ba16", + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] +} \ No newline at end of file diff --git a/bin/postman-test/environment/edgex.postman_environment.json b/bin/postman-test/environment/edgex.postman_environment.json new file mode 100644 index 00000000..d08afe08 --- /dev/null +++ b/bin/postman-test/environment/edgex.postman_environment.json @@ -0,0 +1,54 @@ +{ + "id": "bbb9c780-0420-4a86-a7f2-cb7ef703c570", + "name": "edgex", + "values": [ + { + "key": "coreDataUrl", + "value": "http://edgex-core-data:48080", + "description": "", + "type": "text", + "enabled": true + }, + { + "key": "metaDataUrl", + "value": "http://edgex-core-metadata:48081", + "description": "", + "type": "text", + "enabled": true + }, + { + "key": "coreCommand", + "value": "http://edgex-core-command:48082", + "description": "", + "type": "text", + "enabled": true + }, + { + "key": "supportNotificationsUrl", + "value": "http://edgex-support-notifications:48060", + "enabled": true, + "type": "text" + }, + { + "key": "supportLoggingUrl", + "value": "edgex-support-logging:48061", + "enabled": true, + "type": "text" + }, + { + "key": "supportRulesengineUrl", + "value": "http://edgex-support-rulesengine:48075", + "enabled": true, + "type": "text" + }, + { + "key": "exportClientUrl", + "value": "http://edgex-export-client:48071", + "enabled": true, + "type": "text" + } + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2018-06-03T05:46:32.108Z", + "_postman_exported_using": "Postman/6.0.10" +} diff --git a/bin/postman-test/environment/local_edgex.postman_environment.json b/bin/postman-test/environment/local_edgex.postman_environment.json new file mode 100644 index 00000000..8103805f --- /dev/null +++ b/bin/postman-test/environment/local_edgex.postman_environment.json @@ -0,0 +1,55 @@ +{ + "id": "49f2f2c1-a38a-4205-bfeb-71838ded61e7", + "name": "local_edgex", + "values": [ + { + "key": "coreDataUrl", + "value": "http://localhost:48080", + "description": "", + "type": "text", + "enabled": true + }, + { + "key": "metaDataUrl", + "value": "http://localhost:48081", + "description": "", + "type": "text", + "enabled": true + }, + { + "key": "coreCommand", + "value": "http://localhost:48082", + "description": "", + "type": "text", + "enabled": true + }, + { + "key": "supportNotificationsUrl", + "value": "http://localhost:48060", + "enabled": true, + "type": "text" + }, + { + "key": "supportLoggingUrl", + "value": "http://localhost:48061", + "enabled": true, + "type": "text" + }, + { + "key": "supportRulesengineUrl", + "value": "http://localhost:48075", + "enabled": true, + "type": "text" + }, + { + "key": "exportClientUrl", + "value": "http://localhost:48071", + "enabled": true, + "type": "text" + } + + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2018-06-03T05:38:58.050Z", + "_postman_exported_using": "Postman/6.0.10" +} diff --git a/bin/postman-test/javascript/exportclient/exportConfiguration.js b/bin/postman-test/javascript/exportclient/exportConfiguration.js new file mode 100644 index 00000000..89db9f5c --- /dev/null +++ b/bin/postman-test/javascript/exportclient/exportConfiguration.js @@ -0,0 +1,15 @@ +var exportConfigurationsToBeRemoved = [ + ObjectId("5b0eb384fd4ca80001df4fa9"), + ObjectId("5b0eb384fd4ca80001df4fa2"), + ObjectId("5b0eb384fd4ca80001df4fa3") +]; + +db.exportConfiguration.remove({ + _id: { + $in: exportConfigurationsToBeRemoved + } +}); + +db.exportConfiguration.remove({ + name: "OSIClient" +}); \ No newline at end of file diff --git a/bin/run.sh b/bin/run.sh index b47e055a..59da4cf8 100755 --- a/bin/run.sh +++ b/bin/run.sh @@ -15,6 +15,7 @@ METADATALOGSPATH=$BASEPATH/metaData$TIMESTAMPFORMAT.log COMMANDLOGSPATH=$BASEPATH/command$TIMESTAMPFORMAT.log LOGGINGLOGSPATH=$BASEPATH/logging$TIMESTAMPFORMAT.log SUPPORT_NOTIFICATION_LOG_PATH=$BASEPATH/supportNotification$TIMESTAMPFORMAT.log +EXPORTCLIENTLOGSPATH=$BASEPATH/command$TIMESTAMPFORMAT.log EDGEXLOGSPATH=$BASEPATH/edgex$TIMESTAMPFORMAT.log coreDataTest() { @@ -58,6 +59,13 @@ supportNotificationTest(){ } +exportClientTest() { + $(dirname "$0")/importExportClientDataDump.sh + $(dirname "$0")/exportClientTest.sh + $(dirname "$0")/flushExportClientDataDump.sh + +} + testAll() { coreDataTest @@ -65,6 +73,7 @@ testAll() { commandTest loggingTest supportNotificationTest + exportClientTest } @@ -98,13 +107,17 @@ case ${option} in -sn) echo "Info: Initiating SupportNotifications Test" supportNotificationTest | tee $SUPPORT_NOTIFICATION_LOG_PATH + ;; + -exc) + echo "Info: Initiating ExportClient Test" + exportClientTest | tee $EXPORTCLIENTLOGSPATH ;; -all) echo "Info: Initiating EdgeX Test" testAll | tee $EDGEXLOGSPATH ;; *) - echo "`basename ${0}`:usage: [-cd Coredata] | [-md Metadata] | [-co Command] | [-sn SupportNotification] | [-lo Logging] | [-all All]" + echo "`basename ${0}`:usage: [-cd Coredata] | [-md Metadata] | [-co Command] | [-sn SupportNotification] | [-lo Logging] | [-exc Export Client] | [-all All]" echo exit 0 ;; diff --git a/deploy-edgeX.sh b/deploy-edgeX.sh index 13f01785..898ab78d 100755 --- a/deploy-edgeX.sh +++ b/deploy-edgeX.sh @@ -72,10 +72,10 @@ sleep 5 #while ! $(docker-compose exec -T consul nc -z edgex-support-scheduler 48085);do echo "not already startup… wait for 5 second reconnect." ;sleep 5; done #sleep 5 -#run_service export-client +run_service export-client -#while ! $(docker-compose exec -T consul nc -z edgex-export-client 48071);do echo "not already startup… wait for 5 second reconnect." ;sleep 5; done -#sleep 5 +while ! $(docker-compose exec -T consul nc -z edgex-export-client 48071);do echo "not already startup… wait for 5 second reconnect." ;sleep 5; done +sleep 5 #run_service export-distro From 587daa8f8b0b9451f85c7c08d534661847a8dd05 Mon Sep 17 00:00:00 2001 From: Bruce Date: Thu, 12 Jul 2018 00:12:09 +0800 Subject: [PATCH 14/20] migrate to california 0.6.0 Signed-off-by: Bruce --- deploy-edgeX.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy-edgeX.sh b/deploy-edgeX.sh index 898ab78d..51a61dab 100755 --- a/deploy-edgeX.sh +++ b/deploy-edgeX.sh @@ -77,10 +77,10 @@ run_service export-client while ! $(docker-compose exec -T consul nc -z edgex-export-client 48071);do echo "not already startup… wait for 5 second reconnect." ;sleep 5; done sleep 5 -#run_service export-distro +run_service export-distro -#while ! $(docker-compose exec -T consul nc -z edgex-export-distro 48070);do echo "not already startup… wait for 5 second reconnect." ;sleep 5; done -#sleep 5 +while ! $(docker-compose exec -T consul nc -z edgex-export-distro 48070);do echo "not already startup… wait for 5 second reconnect." ;sleep 5; done +sleep 5 #run_service rulesengine From ca3f2041106f0f775dc26527afbfea7f03d05bfc Mon Sep 17 00:00:00 2001 From: Bruce Date: Thu, 12 Jul 2018 10:55:12 +0800 Subject: [PATCH 15/20] add populate.sh Signed-off-by: Bruce --- bin/postman-test/DataDumps/exportclient/populate.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 bin/postman-test/DataDumps/exportclient/populate.sh diff --git a/bin/postman-test/DataDumps/exportclient/populate.sh b/bin/postman-test/DataDumps/exportclient/populate.sh new file mode 100755 index 00000000..cbd327b1 --- /dev/null +++ b/bin/postman-test/DataDumps/exportclient/populate.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +mongoimport -d exportclient -c exportConfiguration --file exportConfigurationDb.json \ No newline at end of file From 7ccae57674766ad3ced37fd1690462df483fcef4 Mon Sep 17 00:00:00 2001 From: Bruce Date: Thu, 12 Jul 2018 11:21:00 +0800 Subject: [PATCH 16/20] rename environment file Signed-off-by: Bruce --- bin/exportClientTest.sh | 2 +- .../edgex.postman_environment.json | 54 ------------------ ...ort-client-docker.postman_environment.json | 16 ++++++ .../export-client.postman_environment.json | 16 ++++++ .../local_edgex.postman_environment.json | 55 ------------------- 5 files changed, 33 insertions(+), 110 deletions(-) delete mode 100644 bin/postman-test/environment/edgex.postman_environment.json create mode 100644 bin/postman-test/environment/export-client-docker.postman_environment.json create mode 100644 bin/postman-test/environment/export-client.postman_environment.json delete mode 100644 bin/postman-test/environment/local_edgex.postman_environment.json diff --git a/bin/exportClientTest.sh b/bin/exportClientTest.sh index c2fc64ee..0ab7d3fc 100755 --- a/bin/exportClientTest.sh +++ b/bin/exportClientTest.sh @@ -3,7 +3,7 @@ NAMESFILE=$(dirname "$0")/files.sh COLLECTION_PATH="collections/export-client.postman_collection.json" -ENV_PATH="environment/edgex.postman_environment.json" +ENV_PATH="environment/export-client-docker.postman_environment.json" if [ -f $NAMESFILE ]; then diff --git a/bin/postman-test/environment/edgex.postman_environment.json b/bin/postman-test/environment/edgex.postman_environment.json deleted file mode 100644 index d08afe08..00000000 --- a/bin/postman-test/environment/edgex.postman_environment.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "id": "bbb9c780-0420-4a86-a7f2-cb7ef703c570", - "name": "edgex", - "values": [ - { - "key": "coreDataUrl", - "value": "http://edgex-core-data:48080", - "description": "", - "type": "text", - "enabled": true - }, - { - "key": "metaDataUrl", - "value": "http://edgex-core-metadata:48081", - "description": "", - "type": "text", - "enabled": true - }, - { - "key": "coreCommand", - "value": "http://edgex-core-command:48082", - "description": "", - "type": "text", - "enabled": true - }, - { - "key": "supportNotificationsUrl", - "value": "http://edgex-support-notifications:48060", - "enabled": true, - "type": "text" - }, - { - "key": "supportLoggingUrl", - "value": "edgex-support-logging:48061", - "enabled": true, - "type": "text" - }, - { - "key": "supportRulesengineUrl", - "value": "http://edgex-support-rulesengine:48075", - "enabled": true, - "type": "text" - }, - { - "key": "exportClientUrl", - "value": "http://edgex-export-client:48071", - "enabled": true, - "type": "text" - } - ], - "_postman_variable_scope": "environment", - "_postman_exported_at": "2018-06-03T05:46:32.108Z", - "_postman_exported_using": "Postman/6.0.10" -} diff --git a/bin/postman-test/environment/export-client-docker.postman_environment.json b/bin/postman-test/environment/export-client-docker.postman_environment.json new file mode 100644 index 00000000..e753a6d9 --- /dev/null +++ b/bin/postman-test/environment/export-client-docker.postman_environment.json @@ -0,0 +1,16 @@ +{ + "id": "19fd4ccb-8915-4621-97c7-647834bcef87", + "name": "export-client-docker", + "values": [ + { + "key": "exportClientUrl", + "value": "http://edgex-export-client:48071", + "description": "", + "type": "text", + "enabled": true + } + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2018-07-12T03:19:08.016Z", + "_postman_exported_using": "Postman/6.1.3" +} \ No newline at end of file diff --git a/bin/postman-test/environment/export-client.postman_environment.json b/bin/postman-test/environment/export-client.postman_environment.json new file mode 100644 index 00000000..c0bcb392 --- /dev/null +++ b/bin/postman-test/environment/export-client.postman_environment.json @@ -0,0 +1,16 @@ +{ + "id": "6c04ba1c-8955-4d69-ba14-02c84cbad321", + "name": "export-client", + "values": [ + { + "key": "exportClientUrl", + "value": "http://localhost:48071", + "description": "", + "type": "text", + "enabled": true + } + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2018-07-12T03:19:04.779Z", + "_postman_exported_using": "Postman/6.1.3" +} \ No newline at end of file diff --git a/bin/postman-test/environment/local_edgex.postman_environment.json b/bin/postman-test/environment/local_edgex.postman_environment.json deleted file mode 100644 index 8103805f..00000000 --- a/bin/postman-test/environment/local_edgex.postman_environment.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "id": "49f2f2c1-a38a-4205-bfeb-71838ded61e7", - "name": "local_edgex", - "values": [ - { - "key": "coreDataUrl", - "value": "http://localhost:48080", - "description": "", - "type": "text", - "enabled": true - }, - { - "key": "metaDataUrl", - "value": "http://localhost:48081", - "description": "", - "type": "text", - "enabled": true - }, - { - "key": "coreCommand", - "value": "http://localhost:48082", - "description": "", - "type": "text", - "enabled": true - }, - { - "key": "supportNotificationsUrl", - "value": "http://localhost:48060", - "enabled": true, - "type": "text" - }, - { - "key": "supportLoggingUrl", - "value": "http://localhost:48061", - "enabled": true, - "type": "text" - }, - { - "key": "supportRulesengineUrl", - "value": "http://localhost:48075", - "enabled": true, - "type": "text" - }, - { - "key": "exportClientUrl", - "value": "http://localhost:48071", - "enabled": true, - "type": "text" - } - - ], - "_postman_variable_scope": "environment", - "_postman_exported_at": "2018-06-03T05:38:58.050Z", - "_postman_exported_using": "Postman/6.0.10" -} From e95158703ff114fded11705a916e49b3c8fc90b2 Mon Sep 17 00:00:00 2001 From: Bruce Date: Sun, 15 Jul 2018 18:29:32 +0800 Subject: [PATCH 17/20] fix schema validation error Signed-off-by: Bruce --- .../export-client.postman_collection.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/postman-test/collections/export-client.postman_collection.json b/bin/postman-test/collections/export-client.postman_collection.json index a3c8ed29..7daf8118 100644 --- a/bin/postman-test/collections/export-client.postman_collection.json +++ b/bin/postman-test/collections/export-client.postman_collection.json @@ -287,10 +287,10 @@ { "listen": "prerequest", "script": { - "id": "5fa1802a-3f8e-4afb-b8b1-bf8975939563", + "id": "67686c79-2d26-463c-a38e-dc42fd876bc4", "type": "text/javascript", "exec": [ - "if(!data.loggingLabel){", + "if(!data.regID){", " pm.environment.set(\"regID\", \"5b0eb384fd4ca80001df4fa9\");", "}else{", " pm.environment.set(\"regID\", data.regID);", @@ -304,7 +304,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + "raw": "{\n \"name\":\"OSIClient\",\n \"enable\":false\n}" }, "url": { "raw": "{{exportClientUrl}}/api/v1/registration/{{regID}}", @@ -1015,7 +1015,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n\t\"name\":\"OSIClient\",\n\t\"enable\":false\n}" + "raw": "{\n \"name\":\"OSIClient\",\n \"enable\":false\n}" }, "url": { "raw": "{{exportClientUrl}}/api/v1/registration/name/{{nameNotFound}}", @@ -1432,7 +1432,7 @@ " \"title\":\"protocol\"", " },", " \"address\":{", - " \"type\":\"string\",", + " \"type\":[\"string\",\"null\"],", " \"required\":false,", " \"title\":\"address\"", " },", @@ -1447,22 +1447,22 @@ " \"title\":\"path\"", " },", " \"publisher\":{", - " \"type\":\"string\",", + " \"type\":[\"string\",\"null\"],", " \"required\":false,", " \"title\":\"publisher\"", " },", " \"user\":{", - " \"type\":\"string\",", + " \"type\":[\"string\",\"null\"],", " \"required\":false,", " \"title\":\"user\"", " },", " \"password\":{", - " \"type\":\"string\",", + " \"type\":[\"string\",\"null\"],", " \"required\":false,", " \"title\":\"password\"", " },", " \"topic\":{", - " \"type\":\"string\",", + " \"type\":[\"string\",\"null\"],", " \"required\":false,", " \"title\":\"topic\"", " }", From ae3ef04ab974088e3f5e98a698c4fbbb4a874165 Mon Sep 17 00:00:00 2001 From: Bruce Date: Thu, 28 Jun 2018 00:47:34 +0800 Subject: [PATCH 18/20] init export-client-test Signed-off-by: Bruce --- .../edgex.postman_environment.json | 54 ++++++++++++++++++ .../local_edgex.postman_environment.json | 55 +++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 bin/postman-test/environment/edgex.postman_environment.json create mode 100644 bin/postman-test/environment/local_edgex.postman_environment.json diff --git a/bin/postman-test/environment/edgex.postman_environment.json b/bin/postman-test/environment/edgex.postman_environment.json new file mode 100644 index 00000000..d08afe08 --- /dev/null +++ b/bin/postman-test/environment/edgex.postman_environment.json @@ -0,0 +1,54 @@ +{ + "id": "bbb9c780-0420-4a86-a7f2-cb7ef703c570", + "name": "edgex", + "values": [ + { + "key": "coreDataUrl", + "value": "http://edgex-core-data:48080", + "description": "", + "type": "text", + "enabled": true + }, + { + "key": "metaDataUrl", + "value": "http://edgex-core-metadata:48081", + "description": "", + "type": "text", + "enabled": true + }, + { + "key": "coreCommand", + "value": "http://edgex-core-command:48082", + "description": "", + "type": "text", + "enabled": true + }, + { + "key": "supportNotificationsUrl", + "value": "http://edgex-support-notifications:48060", + "enabled": true, + "type": "text" + }, + { + "key": "supportLoggingUrl", + "value": "edgex-support-logging:48061", + "enabled": true, + "type": "text" + }, + { + "key": "supportRulesengineUrl", + "value": "http://edgex-support-rulesengine:48075", + "enabled": true, + "type": "text" + }, + { + "key": "exportClientUrl", + "value": "http://edgex-export-client:48071", + "enabled": true, + "type": "text" + } + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2018-06-03T05:46:32.108Z", + "_postman_exported_using": "Postman/6.0.10" +} diff --git a/bin/postman-test/environment/local_edgex.postman_environment.json b/bin/postman-test/environment/local_edgex.postman_environment.json new file mode 100644 index 00000000..8103805f --- /dev/null +++ b/bin/postman-test/environment/local_edgex.postman_environment.json @@ -0,0 +1,55 @@ +{ + "id": "49f2f2c1-a38a-4205-bfeb-71838ded61e7", + "name": "local_edgex", + "values": [ + { + "key": "coreDataUrl", + "value": "http://localhost:48080", + "description": "", + "type": "text", + "enabled": true + }, + { + "key": "metaDataUrl", + "value": "http://localhost:48081", + "description": "", + "type": "text", + "enabled": true + }, + { + "key": "coreCommand", + "value": "http://localhost:48082", + "description": "", + "type": "text", + "enabled": true + }, + { + "key": "supportNotificationsUrl", + "value": "http://localhost:48060", + "enabled": true, + "type": "text" + }, + { + "key": "supportLoggingUrl", + "value": "http://localhost:48061", + "enabled": true, + "type": "text" + }, + { + "key": "supportRulesengineUrl", + "value": "http://localhost:48075", + "enabled": true, + "type": "text" + }, + { + "key": "exportClientUrl", + "value": "http://localhost:48071", + "enabled": true, + "type": "text" + } + + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2018-06-03T05:38:58.050Z", + "_postman_exported_using": "Postman/6.0.10" +} From 68dfbaec7b4074588295a8320acd719bd9bc5d84 Mon Sep 17 00:00:00 2001 From: Bruce Date: Thu, 12 Jul 2018 11:21:00 +0800 Subject: [PATCH 19/20] rename environment file Signed-off-by: Bruce --- .../edgex.postman_environment.json | 54 ------------------ .../local_edgex.postman_environment.json | 55 ------------------- 2 files changed, 109 deletions(-) delete mode 100644 bin/postman-test/environment/edgex.postman_environment.json delete mode 100644 bin/postman-test/environment/local_edgex.postman_environment.json diff --git a/bin/postman-test/environment/edgex.postman_environment.json b/bin/postman-test/environment/edgex.postman_environment.json deleted file mode 100644 index d08afe08..00000000 --- a/bin/postman-test/environment/edgex.postman_environment.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "id": "bbb9c780-0420-4a86-a7f2-cb7ef703c570", - "name": "edgex", - "values": [ - { - "key": "coreDataUrl", - "value": "http://edgex-core-data:48080", - "description": "", - "type": "text", - "enabled": true - }, - { - "key": "metaDataUrl", - "value": "http://edgex-core-metadata:48081", - "description": "", - "type": "text", - "enabled": true - }, - { - "key": "coreCommand", - "value": "http://edgex-core-command:48082", - "description": "", - "type": "text", - "enabled": true - }, - { - "key": "supportNotificationsUrl", - "value": "http://edgex-support-notifications:48060", - "enabled": true, - "type": "text" - }, - { - "key": "supportLoggingUrl", - "value": "edgex-support-logging:48061", - "enabled": true, - "type": "text" - }, - { - "key": "supportRulesengineUrl", - "value": "http://edgex-support-rulesengine:48075", - "enabled": true, - "type": "text" - }, - { - "key": "exportClientUrl", - "value": "http://edgex-export-client:48071", - "enabled": true, - "type": "text" - } - ], - "_postman_variable_scope": "environment", - "_postman_exported_at": "2018-06-03T05:46:32.108Z", - "_postman_exported_using": "Postman/6.0.10" -} diff --git a/bin/postman-test/environment/local_edgex.postman_environment.json b/bin/postman-test/environment/local_edgex.postman_environment.json deleted file mode 100644 index 8103805f..00000000 --- a/bin/postman-test/environment/local_edgex.postman_environment.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "id": "49f2f2c1-a38a-4205-bfeb-71838ded61e7", - "name": "local_edgex", - "values": [ - { - "key": "coreDataUrl", - "value": "http://localhost:48080", - "description": "", - "type": "text", - "enabled": true - }, - { - "key": "metaDataUrl", - "value": "http://localhost:48081", - "description": "", - "type": "text", - "enabled": true - }, - { - "key": "coreCommand", - "value": "http://localhost:48082", - "description": "", - "type": "text", - "enabled": true - }, - { - "key": "supportNotificationsUrl", - "value": "http://localhost:48060", - "enabled": true, - "type": "text" - }, - { - "key": "supportLoggingUrl", - "value": "http://localhost:48061", - "enabled": true, - "type": "text" - }, - { - "key": "supportRulesengineUrl", - "value": "http://localhost:48075", - "enabled": true, - "type": "text" - }, - { - "key": "exportClientUrl", - "value": "http://localhost:48071", - "enabled": true, - "type": "text" - } - - ], - "_postman_variable_scope": "environment", - "_postman_exported_at": "2018-06-03T05:38:58.050Z", - "_postman_exported_using": "Postman/6.0.10" -} From 7370d8c1125ee8643661963aad7086c74561e155 Mon Sep 17 00:00:00 2001 From: Bruce Date: Mon, 23 Jul 2018 23:26:42 +0800 Subject: [PATCH 20/20] add exportClientData.json Signed-off-by: Bruce --- bin/postman-test/data/exportClientData.json | 178 ++++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 bin/postman-test/data/exportClientData.json diff --git a/bin/postman-test/data/exportClientData.json b/bin/postman-test/data/exportClientData.json new file mode 100644 index 00000000..9945f549 --- /dev/null +++ b/bin/postman-test/data/exportClientData.json @@ -0,0 +1,178 @@ +[ + { + "getName": "OSIClient", + "deleteName": "OSIClient3", + "regID": "5b0eb384fd4ca80001df4fa9", + "regDeleteID": "5b0eb384fd4ca80001df4fa2", + "regIDNotFound": "thisregisnotthere", + "nameNotFound": "OSIClientNotThere", + "schema": + { + "type":"object", + "$schema":"http://json-schema.org/draft-03/schema#", + "description":"Defines the registration details on the part of north side export clients", + "title":"ExportRegistration", + "properties":{ + "id":{ + "type":"string", + "required":false, + "title":"id" + }, + "created":{ + "type":"integer", + "required":false, + "title":"created" + }, + "modified":{ + "type":"integer", + "required":false, + "title":"modified" + }, + "origin":{ + "type":"integer", + "required":false, + "title":"origin" + }, + "name":{ + "type":"string", + "required":true, + "title":"name" + }, + "addressable":{ + "type":"object", + "properties":{ + "id":{ + "type":"string", + "required":false, + "title":"id" + }, + "created":{ + "type":"integer", + "required":false, + "title":"created" + }, + "modified":{ + "type":"integer", + "required":false, + "title":"modified" + }, + "origin":{ + "type":"integer", + "required":false, + "title":"origin" + }, + "name":{ + "type":"string", + "required":false, + "title":"name" + }, + "protocol":{ + "type":"string", + "required":false, + "title":"protocol" + }, + "address":{ + "type":"string", + "required":false, + "title":"address" + }, + "port":{ + "type":"integer", + "required":false, + "title":"port" + }, + "path":{ + "type":"string", + "required":false, + "title":"path" + }, + "publisher":{ + "type":"string", + "required":false, + "title":"publisher" + }, + "user":{ + "type":"string", + "required":false, + "title":"user" + }, + "password":{ + "type":"string", + "required":false, + "title":"password" + }, + "topic":{ + "type":"string", + "required":false, + "title":"topic" + } + } + }, + "format":{ + "type":"string", + "required":false, + "title":"format" + }, + "filter":{ + "type":"object", + "properties":{ + "deviceIdentifiers":{ + "type":"array", + "required":false, + "title":"deviceIdentifiers", + "items":{ + "type":"string", + "title":"deviceIdentifiers" + }, + "uniqueItems":false + }, + "valueDescriptorIdentifiers":{ + "type":"array", + "required":false, + "title":"valueDescriptorIdentifiers", + "items":{ + "type":"string", + "title":"valueDescriptorIdentifiers" + }, + "uniqueItems":false + } + } + }, + "encryption":{ + "type":"object", + "properties":{ + "encryptionAlgorithm":{ + "type":"string", + "required":false, + "title":"encryptionAlgorithm" + }, + "encryptionKey":{ + "type":"string", + "required":false, + "title":"encryptionKey" + }, + "initializingVector":{ + "type":"string", + "required":false, + "title":"initializingVector" + } + } + }, + "compression":{ + "type":"string", + "required":false, + "title":"compression" + }, + "enable":{ + "type":"boolean", + "required":false, + "title":"enable" + } + } + } + + } +] + + +