From e0d981a8ee0eff52d3890db61ce45852ea595847 Mon Sep 17 00:00:00 2001 From: Jose Ignacio Lorenzo <74208929+joselo85@users.noreply.github.com> Date: Fri, 16 Sep 2022 10:45:36 -0300 Subject: [PATCH] [CONSUL-439] Parse nc Command in function (#61) --- .../connect/envoy/helpers.windows.bash | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/test/integration/connect/envoy/helpers.windows.bash b/test/integration/connect/envoy/helpers.windows.bash index c4fccdab099d..e39cb69a5baa 100644 --- a/test/integration/connect/envoy/helpers.windows.bash +++ b/test/integration/connect/envoy/helpers.windows.bash @@ -1,5 +1,16 @@ #!/bin/bash +MOD_ARG="" + +function split_hostport { + local HOSTPORT="$@" + + if [[ $HOSTPORT == *":"* ]] + then + MOD_ARG=$( <<< $HOSTPORT sed 's/:/ /' ) + fi +} + # retry based on # https://github.com/fernandoacorreia/azure-docker-registry/blob/master/tools/scripts/create-registry-server # under MIT license. @@ -18,7 +29,11 @@ function retry { fi if [[ $1 == "curl" ]]; then - set -- ${@} -m 10 + set -- "${@}" -m 10 + elif [[ $1 == "nc" ]] + then + split_hostport $3 + set -- "${@:1:2}" $MOD_ARG "${@:4}" fi # This if block, was added to check if curl is being executed directly on a test,