Skip to content

Commit

Permalink
[CONSUL-510] Support case-wanfed-gw on Windows (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
joselo85 committed Dec 21, 2022
1 parent 0db9f45 commit 13a5b09
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 5 deletions.
4 changes: 2 additions & 2 deletions execute_windows_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ then
echo "Completed 2"
XDS_TARGET=$XDS_TARGET go test -v -timeout=30m -tags integration ./test/integration/connect/envoy -run="TestEnvoy/case-cfg-resolver-dc-failover-gateways-remote" -win=true > test/integration/connect/envoy/results/case-cfg-resolver-dc-failover-gateways-remote.log
echo "Completed 3"
XDS_TARGET=$XDS_TARGET go test -v -timeout=30m -tags integration ./test/integration/connect/envoy -run="TestEnvoy/case-cross-peers" -win=true > test/integration/connect/envoy/results/case-cross-peers.log
XDS_TARGET=$XDS_TARGET go test -v -timeout=30m -tags integration ./test/integration/connect/envoy -run="TestEnvoy/case-cross-peers$" -win=true > test/integration/connect/envoy/results/case-cross-peers.log
echo "Completed 4"
XDS_TARGET=$XDS_TARGET go test -v -timeout=30m -tags integration ./test/integration/connect/envoy -run="TestEnvoy/case-cross-peers-http" -win=true > test/integration/connect/envoy/results/case-cross-peers-http.log
XDS_TARGET=$XDS_TARGET go test -v -timeout=30m -tags integration ./test/integration/connect/envoy -run="TestEnvoy/case-cross-peers-http$" -win=true > test/integration/connect/envoy/results/case-cross-peers-http.log
echo "Completed 5"
XDS_TARGET=$XDS_TARGET go test -v -timeout=30m -tags integration ./test/integration/connect/envoy -run="TestEnvoy/case-cross-peers-http-router" -win=true > test/integration/connect/envoy/results/case-cross-peers-http-router.log
echo "Completed 6"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

# initialize the outputs for each dc
for dc in primary secondary; do
rm -rf "workdir/${dc}/tls"
mkdir -p "workdir/${dc}/tls"
done

container="consul-envoy-integ-tls-init--${CASE_NAME}"

scriptlet="
mkdir /out ;
cd /out ;
consul tls ca create ;
consul tls cert create -dc=primary -server -node=pri ;
consul tls cert create -dc=secondary -server -node=sec ;
"

docker.exe rm -f "$container" &>/dev/null || true
docker.exe run -i --net=none --name="$container" windows/consul:local bash -c "${scriptlet}"

# primary
for f in \
consul-agent-ca.pem \
primary-server-consul-0-key.pem \
primary-server-consul-0.pem \
; do
docker.exe cp "${container}:C:\\Program Files\\Git\\out\\$f" workdir/primary/tls
done

# secondary
for f in \
consul-agent-ca.pem \
secondary-server-consul-0-key.pem \
secondary-server-consul-0.pem \
; do
docker.exe cp "${container}:C:\\Program Files\\Git\\out\\$f" workdir/secondary/tls
done

# Private keys have 600 perms but tests are run as another user
chmod 666 workdir/primary/tls/primary-server-consul-0-key.pem
chmod 666 workdir/secondary/tls/secondary-server-consul-0-key.pem

docker.exe rm -f "$container" >/dev/null || true
6 changes: 3 additions & 3 deletions test/integration/connect/envoy/run-tests.windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,8 @@ function init_vars {
}

function global_setup {
if [ -f "${CASE_DIR}/global-setup.sh" ] ; then
source "${CASE_DIR}/global-setup.sh"
if [ -f "${CASE_DIR}/global-setup-windows.sh" ] ; then
source "${CASE_DIR}/global-setup-windows.sh"
fi
}

Expand Down Expand Up @@ -480,7 +480,7 @@ function run_tests {
fi

global_setup

# Allow vars.sh to set a reason to skip this test case based on the ENV
if [ "$SKIP_CASE" != "" ] ; then
echoyellow "SKIPPING CASE: $SKIP_CASE"
Expand Down

0 comments on commit 13a5b09

Please sign in to comment.