From 8a5aba08f46ac2488be4c3a2fa65e2e75a108709 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sun, 2 Dec 2018 03:06:19 +0100 Subject: [PATCH] tests: use ports > 1024 in order to run without superuser privs --- etc/loopback.json | 3 +++ tests/integration/api-nodes.sh | 5 ++++- tests/integration/api-restart.sh | 5 ++++- tests/integration/api-shutdown.sh | 11 ++++++++--- tests/integration/api-stress.sh | 2 +- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/etc/loopback.json b/etc/loopback.json index 4730adf03..2fb152a2f 100644 --- a/etc/loopback.json +++ b/etc/loopback.json @@ -1,4 +1,7 @@ { + "http" : { + "port" : 8080 + }, "nodes" : { "node1" : { "type" : "loopback" diff --git a/tests/integration/api-nodes.sh b/tests/integration/api-nodes.sh index 746bdf350..fb17a0bc7 100755 --- a/tests/integration/api-nodes.sh +++ b/tests/integration/api-nodes.sh @@ -29,6 +29,9 @@ FETCHED_NODES=$(mktemp) cat > ${CONFIG_FILE} < ${FETCHED_NODES} +curl -sX POST --data '{ "action" : "nodes", "id" : "5a786626-fbc6-4c04-98c2-48027e68c2fa" }' http://localhost:8080/api/v1 > ${FETCHED_NODES} # Shutdown VILLASnode kill $! diff --git a/tests/integration/api-restart.sh b/tests/integration/api-restart.sh index 336c30d1c..ec80896ae 100755 --- a/tests/integration/api-restart.sh +++ b/tests/integration/api-restart.sh @@ -29,6 +29,9 @@ FETCHED_CONF=$(mktemp) cat < ${LOCAL_CONF} { + "http" : { + "port" : 8080 + }, "nodes" : { "node1" : { "type" : "socket", @@ -61,7 +64,7 @@ villas-node & sleep 0.2 # Restart with configuration -curl -sX POST --data '{ "action" : "restart", "request" : { "config": "'${LOCAL_CONF}'" }, "id" : "5a786626-fbc6-4c04-98c2-48027e68c2fa" }' http://localhost/api/v1 +curl -sX POST --data '{ "action" : "restart", "request" : { "config": "'${LOCAL_CONF}'" }, "id" : "5a786626-fbc6-4c04-98c2-48027e68c2fa" }' http://localhost:8080/api/v1 # Wait for node to complete init sleep 1 diff --git a/tests/integration/api-shutdown.sh b/tests/integration/api-shutdown.sh index d92aad6d5..c5bb442c2 100755 --- a/tests/integration/api-shutdown.sh +++ b/tests/integration/api-shutdown.sh @@ -25,15 +25,20 @@ set -e # Start without a configuration -timeout -s SIGKILL 3 villas-node & +timeout -s SIGKILL 3 villas-node & <0 (fail) in case the 3 second timeout was reached -wait $! \ No newline at end of file +wait $! diff --git a/tests/integration/api-stress.sh b/tests/integration/api-stress.sh index c372924a2..9ddd3ac11 100755 --- a/tests/integration/api-stress.sh +++ b/tests/integration/api-stress.sh @@ -56,7 +56,7 @@ for J in {1..${RUNS}}; do FETCHED_CONF=$(mktemp) - curl -sX POST --data '{ "action" : "config", "id" : "'$(uuidgen)'" }' http://localhost/api/v1 > ${FETCHED_CONF} + curl -sX POST --data '{ "action" : "config", "id" : "'$(uuidgen)'" }' http://localhost:8080/api/v1 > ${FETCHED_CONF} diff -u <(jq -S .response < ${FETCHED_CONF}) <(jq -S . < ${LOCAL_CONF}) RC=$?