From 7c73251c602bc0fbc619fe72aee82f85e847caf8 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sun, 2 Apr 2017 13:03:49 +0200 Subject: [PATCH] =?UTF-8?q?add=20integration=20test=20for=20api=20command?= =?UTF-8?q?=20=E2=80=9Anodes=E2=80=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/integration/api-nodes.sh | 42 ++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 tests/integration/api-nodes.sh diff --git a/tests/integration/api-nodes.sh b/tests/integration/api-nodes.sh new file mode 100755 index 000000000..5cc36931f --- /dev/null +++ b/tests/integration/api-nodes.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +set -e + +CONFIG_FILE=$(mktemp) +FETCHED_NODES=$(mktemp) + +cat > ${CONFIG_FILE} < ${FETCHED_NODES} + +# Shutdown VILLASnode +kill $! + +# Compare local config with the fetched one +jq -e '.response[0].name == "testnode1" and .response[0].type == "websocket" and .response[0].id == 0 and (.response | length == 2)' ${FETCHED_NODES} > /dev/null +RC=$? + +rm -f ${CONFIG_FILE} ${FETCHED_NODES} + +exit $RC \ No newline at end of file