From ca540a730c0b880922e86074f994a95b8d413bea Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 13 Oct 2019 10:37:32 +0200 Subject: Merging upstream version 1.18.0. Signed-off-by: Daniel Baumann --- tests/stress.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'tests/stress.sh') diff --git a/tests/stress.sh b/tests/stress.sh index 9c9393d3b..97cced032 100755 --- a/tests/stress.sh +++ b/tests/stress.sh @@ -1,8 +1,14 @@ #!/bin/bash # SPDX-License-Identifier: GPL-3.0-or-later +if ! hash curl 2>/dev/null +then + 1>&2 echo "'curl' not found on system. Please install 'curl'." + exit 1 +fi + # set the host to connect to -if [ ! -z "$1" ] +if [ -n "$1" ] then host="$1" else @@ -11,17 +17,17 @@ fi echo "using netdata server at: $host" # shellcheck disable=SC2207 disable=SC1117 -charts=($(curl "$host/netdata.conf" 2>/dev/null | grep "^\[" | cut -d '[' -f 2 | cut -d ']' -f 1 | grep -v ^global$ | grep -v "^plugin" | sort -u)) +charts=($(curl -k "$host/netdata.conf" 2>/dev/null | grep "^\[" | cut -d '[' -f 2 | cut -d ']' -f 1 | grep -v ^global$ | grep -v "^plugin" | sort -u)) if [ "${#charts[@]}" -eq 0 ] then echo "Cannot download charts from server: $host" exit 1 fi -update_every="$(curl "$host/netdata.conf" 2>/dev/null | grep "update every = " | head -n 1 | cut -d '=' -f 2)" +update_every="$(curl -k "$host/netdata.conf" 2>/dev/null | grep "update every = " | head -n 1 | cut -d '=' -f 2)" [ $(( update_every + 1 - 1)) -eq 0 ] && update_every=1 -entries="$(curl "$host/netdata.conf" 2>/dev/null | grep "history = " | head -n 1 | cut -d '=' -f 2)" +entries="$(curl -k "$host/netdata.conf" 2>/dev/null | grep "history = " | head -n 1 | cut -d '=' -f 2)" [ $(( entries + 1 - 1)) -eq 0 ] && entries=3600 # to compare equal things, set the entries to 3600 max @@ -49,7 +55,7 @@ trap cleanup EXIT while true do - echo "curl --compressed --keepalive-time 120 --header \"Connection: keep-alive\" \\" >"$file" + echo "curl -k --compressed --keepalive-time 120 --header \"Connection: keep-alive\" \\" >"$file" # shellcheck disable=SC2034 for x in {1..100} do -- cgit v1.2.3