Skip to content

Commit 6ee4391

Browse files
committed
Run the creation/recreation of the PV e2e test
Still a WIP, most of the pumbling is done however once the LVP pod starts it fails to find the volume mount!
1 parent c8b3211 commit 6ee4391

File tree

7 files changed

+324
-333
lines changed

7 files changed

+324
-333
lines changed

hack/e2e.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
set -o errexit
2424
set -o nounset
2525
set -o pipefail
26+
set -x
2627

2728
ROOT=$(unset CDPATH && cd $(dirname "${BASH_SOURCE[0]}")/.. && pwd)
2829
cd $ROOT
@@ -294,12 +295,12 @@ fi
294295

295296
if [ "$PROVIDER" == "gke" ]; then
296297
kubetest2_args+=(
298+
--up
299+
--down
297300
--test exec
298301
-v 1
299302
--cluster-name "$CLUSTER"
300303
--network "$CLUSTER"
301-
--up
302-
--down
303304
--gcp-service-account "$GOOGLE_APPLICATION_CREDENTIALS"
304305
--environment "$GKE_ENVIRONMENT"
305306
)
@@ -322,7 +323,9 @@ if [ "$PROVIDER" == "gke" ]; then
322323
fi
323324

324325
# legacy path
326+
# --up
327+
# --down
325328
go run $ROOT/hack/e2e.go -- "${kubetest_args[@]}" \
326-
--deployment "$DEPLOYMENT" \
327-
--test-cmd "$ROOT/hack/run-e2e.sh" \
328-
--test-cmd-args="$@"
329+
--deployment="$DEPLOYMENT" \
330+
--test-cmd="$ROOT/hack/run-e2e.sh" \
331+
"${@:-}"

hack/run-e2e.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,4 @@ echo "Running e2e tests:" >&2
182182
echo "PROVISIONER_IMAGE_NAME: $PROVISIONER_IMAGE_NAME"
183183
echo "PROVISIONER_IMAGE_PULL_POLICY: $PROVISIONER_IMAGE_PULL_POLICY"
184184
echo "go ${TEST_ARGS[@]}" >&2
185-
exec "go" "${TEST_ARGS[@]}"
185+
eval "go ${TEST_ARGS[@]}"

helm/generated_examples/gke-mauricio.yaml

Lines changed: 0 additions & 280 deletions
This file was deleted.

test/windows/main.go renamed to test/e2e/dev/main.go

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022 The Kubernetes Authors.
2+
Copyright 2021 The Kubernetes Authors.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ import (
2424

2525
"k8s.io/klog/v2"
2626
e2estorageutils "k8s.io/kubernetes/test/e2e/storage/utils"
27+
windows "sigs.k8s.io/sig-storage-local-static-provisioner/test/e2e/windows"
2728
)
2829

2930
func main() {
@@ -39,10 +40,38 @@ func main() {
3940
Name: "e2e-test-mauriciopoppe-windows-node-group-l64t",
4041
},
4142
}
42-
hostExec := NewHostExec()
43+
hostExec := windows.NewHostExec()
4344
result, err := hostExec.Execute("echo $env:USERPROFILE", node)
4445
if err != nil {
4546
panic(err)
4647
}
4748
e2estorageutils.LogResult(result)
49+
50+
vhd := windows.NewVHD("C:\\var\\lib\\kubelet\\plugins\\testplugin-0.csi.io\\disk-dev-9.vhdx", 1024*1024*1024)
51+
52+
vhdStage, err := vhd.StageScript()
53+
if err != nil {
54+
panic(err)
55+
}
56+
result, err = hostExec.Execute(vhdStage, node)
57+
if err != nil {
58+
panic(err)
59+
}
60+
e2estorageutils.LogResult(result)
61+
62+
vhdPublish, err := vhd.PublishScript("C:\\var\\lib\\kubelet\\plugins\\testplugin-0.csi.io\\mount-9")
63+
if err != nil {
64+
panic(err)
65+
}
66+
result, err = hostExec.Execute(vhdPublish, node)
67+
if err != nil {
68+
panic(err)
69+
}
70+
e2estorageutils.LogResult(result)
71+
72+
result, err = hostExec.Execute(`"& { Get-Volume -UniqueId ("\\\\?\\" + (Get-Item -Path C:\\var\\lib\\kubelet\\plugins\\testplugin-0.csi.io\\mount-9).Target) }"`, node)
73+
if err != nil {
74+
panic(err)
75+
}
76+
e2estorageutils.LogResult(result)
4877
}

0 commit comments

Comments
 (0)