From 69bdacb677d6bb59fb62816865375454b31453ff Mon Sep 17 00:00:00 2001 From: Patrick McCarty Date: Fri, 19 Oct 2018 17:33:48 -0700 Subject: [PATCH] test: add localhost for no_proxy if not present I see the checkupdate/chk-update-slow-server test fail when the http_proxy env variable is set, but no_proxy is not set. Resolve the issue by adding "localhost" to no_proxy if needed, since the test web servers run on localhost. Signed-off-by: Patrick McCarty --- test/functional/testlib.bash | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/functional/testlib.bash b/test/functional/testlib.bash index e32f4f5b..fa3bfbf0 100644 --- a/test/functional/testlib.bash +++ b/test/functional/testlib.bash @@ -1441,6 +1441,14 @@ start_web_server() { # swupd_function echo "$server_pid" > "$SERVER_PID_FILE" + # make sure localhost is present in no_proxy settings + if [ -n "$no_proxy" ] && grep -v 'localhost' <<< "$no_proxy"; then + no_proxy="${no_proxy},localhost" + elif [ -z "$no_proxy" ]; then + no_proxy="localhost" + fi + export no_proxy + # wait for server to be available for i in $(seq 1 100); do if [ -f "$PORT_FILE" ]; then