@@ -16,7 +16,7 @@ if ! [ -z "${GCP_ZONE:-}" ]; then
16
16
fi
17
17
18
18
sync_file_to_vm () {
19
- gcloud compute scp $@ $windows_node :" C:\\ Users \\ ${current_account} "
19
+ gcloud compute scp $@ $windows_node :" C:\\ "
20
20
}
21
21
22
22
compile_csi_proxy_integration_tests () {
@@ -25,6 +25,10 @@ compile_csi_proxy_integration_tests() {
25
25
}
26
26
27
27
sync_csi_proxy_integration_tests () {
28
+ # delete the pod that is potentially using the old file
29
+ # if there is a pod accessing the existing file, this command would hang
30
+ kubectl delete -f $pkgdir /scripts/integration-test.yaml --ignore-not-found=true
31
+
28
32
echo " Sync the integrationtests.exe binary"
29
33
local integration_bin_path=" $pkgdir /bin/integrationtests.test.exe"
30
34
sync_file_to_vm $integration_bin_path
@@ -33,12 +37,13 @@ sync_csi_proxy_integration_tests() {
33
37
run_csi_proxy_integration_tests () {
34
38
echo " Run integration tests"
35
39
local ps1=$( cat << 'EOF '
36
- "& {
37
- $ErrorActionPreference = \"Stop\";
38
- .\integrationtests.test.exe --test.v
39
- }"
40
+ $ErrorActionPreference = "Stop";
41
+ .$Env:CONTAINER_SANDBOX_MOUNT_POINT\integration-test\integrationtests.test.exe --test.v
40
42
EOF
41
43
) ;
42
-
43
- gcloud compute ssh $windows_node --command=" powershell -c $( echo $ps1 | tr ' \n' ' ' ) "
44
+ kubectl delete -f $pkgdir /scripts/integration-test.yaml --ignore-not-found=true
45
+ sed " s/windows_node/$windows_node /g" < <( cat $pkgdir /scripts/integration-test.yaml) | kubectl create -f -
46
+ kubectl wait --for=condition=ready pod -l app=integration-test --timeout=600s
47
+ kubectl exec pods/integration-test -- powershell -c $( echo $ps1 | tr ' \n' ' ' )
44
48
}
49
+
0 commit comments