diff --git a/test/integration/connect/envoy/helpers.windows.bash b/test/integration/connect/envoy/helpers.windows.bash index 76934cb5bd5d..3d78c2bbcf2b 100644 --- a/test/integration/connect/envoy/helpers.windows.bash +++ b/test/integration/connect/envoy/helpers.windows.bash @@ -610,10 +610,9 @@ function kill_envoy { local BOOTSTRAP_NAME=$1 local DC=${2:-primary} - PORT=$( cat /c/workdir/$DC/envoy/${BOOTSTRAP_NAME}-bootstrap.json | jq .admin.address.socket_address.port_value ) PID=$( netstat -qo | grep "127.0.0.1:$PORT" | sed -r "s/.* //g" ) - KILL=$( tskill $PID ) + tskill $PID } function must_match_in_statsd_logs { @@ -853,7 +852,8 @@ function get_ca_root { function wait_for_agent_service_register { local SERVICE_ID=$1 local DC=${2:-primary} - retry_default docker_curl "$DC" -sLf "http://consul-${DC}:8500/v1/agent/service/${SERVICE_ID}" >/dev/null + + retry_default docker_consul_exec "$DC" bash -c "curl -sLf 'http://consul-${DC}:8500/v1/agent/service/${SERVICE_ID}' >/dev/null" } function set_ttl_check_state { @@ -873,7 +873,7 @@ function set_ttl_check_state { return 1 esac - retry_default docker_curl "${DC}" -sL -XPUT "http://consul-${DC}:8500/v1/agent/check/warn/${CHECK_ID}" + retry_default docker_consul_exec "$DC" bash -c "curl -sL -XPUT 'http://consul-${DC}:8500/v1/agent/check/warn/${CHECK_ID}' >/dev/null" } function get_upstream_fortio_name { diff --git a/test/integration/connect/envoy/run-tests.windows.sh b/test/integration/connect/envoy/run-tests.windows.sh index 1dd1fa71ef5c..45fd7086bb49 100644 --- a/test/integration/connect/envoy/run-tests.windows.sh +++ b/test/integration/connect/envoy/run-tests.windows.sh @@ -77,6 +77,7 @@ function init_workdir { # don't wipe logs between runs as they are already split and we need them to # upload as artifacts later. rm -rf workdir/${CLUSTER} + rm -rf workdir/logs mkdir -p workdir/${CLUSTER}/{consul,consul-server,register,envoy,bats,statsd,data} # Reload consul config from defaults @@ -451,12 +452,12 @@ function stop_and_copy_files { # Create CMD file to execute within the container echo "XCOPY C:\workdir_bak C:\workdir /e /h /c /i /y" > copy.cmd # Stop dummy container to copy local workdir to container's workdir_bak - docker.exe stop envoy_workdir_1 + docker.exe stop envoy_workdir_1 > /dev/null docker.exe cp workdir/. envoy_workdir_1:/workdir_bak # Copy CMD file into container docker.exe cp copy.cmd envoy_workdir_1:/ # Start dummy container and execute the CMD file - docker.exe start envoy_workdir_1 + docker.exe start envoy_workdir_1 > /dev/null docker.exe exec envoy_workdir_1 copy.cmd # Delete local CMD file after execution rm copy.cmd @@ -470,7 +471,7 @@ function run_tests { init_vars - # Initialize the workdir + echo "Initialize the workdir" init_workdir primary if is_set $REQUIRE_SECONDARY @@ -494,12 +495,13 @@ function run_tests { return 0 fi - # Wipe state + echo "Wipe volumes" wipe_volumes - # Use this function to populate the shared volume + echo "Copying base files to shared volume" stop_and_copy_files + echo "Starting Consul primary cluster" start_consul primary if is_set $REQUIRE_SECONDARY; then