From 202035beaaab9f94573c1474d36d7f6f85dd07fc Mon Sep 17 00:00:00 2001 From: nipunbrahmbhatt_crest Date: Sat, 26 Sep 2020 14:17:39 +0530 Subject: [PATCH] Updated the code with 0.3 release code. --- .../data/custom_copy/custom_copy_input.json | 24 +++ .../plugin_server/data/update_creds.json | 138 ++++++++++++++++++ .../tests/plugin_server/data/write_creds.json | 26 ++++ 3 files changed, 188 insertions(+) create mode 100644 ConsulExtension/Service/tests/merge/data/custom_copy/custom_copy_input.json create mode 100644 ConsulExtension/Service/tests/plugin_server/data/update_creds.json create mode 100644 ConsulExtension/Service/tests/plugin_server/data/write_creds.json diff --git a/ConsulExtension/Service/tests/merge/data/custom_copy/custom_copy_input.json b/ConsulExtension/Service/tests/merge/data/custom_copy/custom_copy_input.json new file mode 100644 index 0000000..6f58ff0 --- /dev/null +++ b/ConsulExtension/Service/tests/merge/data/custom_copy/custom_copy_input.json @@ -0,0 +1,24 @@ +[ + 1, + 2.2, + "str", + [1, 2, 3], + [1, "str", 3.3], + { + "test": "value", + "test2": "value2" + }, + [ + { + "test": "value", + "test2": "value2" + }, + 1, + [ + {}, + { + "key1": [1, 2, ["in"]] + } + ] + ] +] \ No newline at end of file diff --git a/ConsulExtension/Service/tests/plugin_server/data/update_creds.json b/ConsulExtension/Service/tests/plugin_server/data/update_creds.json new file mode 100644 index 0000000..6175a45 --- /dev/null +++ b/ConsulExtension/Service/tests/plugin_server/data/update_creds.json @@ -0,0 +1,138 @@ +[ + [ + "agent list empty", + [ + "tn0", + { + "oldData" : { + "protocol":"http", + "port":"1234", + "ip": "0.0.0.0", + "token":null + }, + "newData" : { + "protocol":"http", + "port":"1235", + "ip": "0.0.0.0", + "token":null + } + }, + [ + "0.0.0.0", + "1234", + "http", + "", + "True", + "-", + "tn0" + ] + ] + ], + [ + "agent already exists", + [ "tn0", + { + "oldData" : { + "protocol":"http", + "port":1233, + "ip": "0.0.0.1", + "token":"" + }, + "newData" : { + "protocol":"http", + "port":1234, + "ip": "0.0.0.0", + "token":"" + } + }, + [ + "0.0.0.0", + "1234", + "http", + "", + "True", + "-", + "tn0" + ] + ] + ], + [ + "connected", + [ "tn0", + { + "oldData" : { + "protocol":"http", + "port":1234, + "ip": "0.0.0.0", + "token":"" + }, + "newData" : { + "protocol":"http", + "port":1235, + "ip": "0.0.0.0", + "token":"" + } + }, + [ + "0.0.0.0", + "1234", + "http", + "", + "True", + "-", + "tn0" + ] + ] + ], + [ + "disconnected", + [ "tn0", + { + "oldData" : { + "protocol":"http", + "port":1234, + "ip": "0.0.0.0", + "token":"" + }, + "newData" : { + "protocol":"http", + "port":1235, + "ip": "0.0.0.0", + "token":"" + } + }, + [ + "0.0.0.0", + "1234", + "http", + "", + "True", + "-", + "tn0" + ] + ] + ], + [ + "exception", + [ + "tn0", + { + "newData" : { + "protocol":"http", + "port":1235, + "ip": "0.0.0.0", + "token":"" + } + }, + [ + "0.0.0.0", + "1234", + "http", + "", + "True", + "-", + "tn0" + ] + ] + ] +] \ No newline at end of file diff --git a/ConsulExtension/Service/tests/plugin_server/data/write_creds.json b/ConsulExtension/Service/tests/plugin_server/data/write_creds.json new file mode 100644 index 0000000..9933605 --- /dev/null +++ b/ConsulExtension/Service/tests/plugin_server/data/write_creds.json @@ -0,0 +1,26 @@ +[ + [ + false, + [{ + "protocol":"http", + "port":"1234", + "ip": "0.0.0.0", + "token":null + }] + ], + [ + true, + [{ + "protocol":"http", + "port":"1234", + "ip": "0.0.0.0", + "token":null + }] + ], + [ + false, + { + + } + ] +] \ No newline at end of file