summaryrefslogtreecommitdiffstats
path: root/packaging/scripts/test.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-02-07 11:49:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-02-07 12:42:05 +0000
commit2e85f9325a797977eea9dfea0a925775ddd211d9 (patch)
tree452c7f30d62fca5755f659b99e4e53c7b03afc21 /packaging/scripts/test.sh
parentReleasing debian version 1.19.0-4. (diff)
downloadnetdata-2e85f9325a797977eea9dfea0a925775ddd211d9.tar.xz
netdata-2e85f9325a797977eea9dfea0a925775ddd211d9.zip
Merging upstream version 1.29.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/scripts/test.sh')
-rwxr-xr-xpackaging/scripts/test.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/packaging/scripts/test.sh b/packaging/scripts/test.sh
new file mode 100755
index 000000000..24ba2966f
--- /dev/null
+++ b/packaging/scripts/test.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+wait_for() {
+ host="${1}"
+ port="${2}"
+ name="${3}"
+ timeout="${4:-30}"
+
+ printf "Waiting for %s on %s:%s ... " "${name}" "${host}" "${port}"
+
+ i=0
+ while ! nc -z "${host}" "${port}"; do
+ sleep 1
+ if [ "$i" -gt "$timeout" ]; then
+ printf "Timed out!\n"
+ return 1
+ fi
+ i="$((i + 1))"
+ done
+ printf "OK\n"
+}
+
+netdata -D > netdata.log 2>&1 &
+
+wait_for localhost 19999 netdata
+
+curl -sS http://127.0.0.1:19999/api/v1/info | jq '.version'