Skip to content

Commit a0a25f2

Browse files
committed
test: add secretName e2e test
1 parent b012489 commit a0a25f2

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

test/e2e/dynamic_provisioning_test.go

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"os"
2424
"os/exec"
2525
"strings"
26+
"time"
2627

2728
"sigs.k8s.io/blob-csi-driver/test/e2e/driver"
2829
"sigs.k8s.io/blob-csi-driver/test/e2e/testsuites"
@@ -121,6 +122,39 @@ var _ = ginkgo.Describe("[blob-csi-e2e] Dynamic Provisioning", func() {
121122
test.Run(cs, ns)
122123
})
123124

125+
ginkgo.It("should create a volume on demand with specified secretName", func() {
126+
pods := []testsuites.PodDetails{
127+
{
128+
Cmd: "echo 'hello world' > /mnt/test-1/data && grep 'hello world' /mnt/test-1/data",
129+
Volumes: []testsuites.VolumeDetails{
130+
{
131+
ClaimSize: "10Gi",
132+
MountOptions: []string{
133+
"-o allow_other",
134+
"--file-cache-timeout-in-seconds=120",
135+
"--cancel-list-on-mount-seconds=0",
136+
},
137+
VolumeMount: testsuites.VolumeMountDetails{
138+
NameGenerate: "test-volume-",
139+
MountPathGenerate: "/mnt/test-",
140+
},
141+
},
142+
},
143+
},
144+
}
145+
scParameters := map[string]string{
146+
"skuName": "Standard_LRS",
147+
"secretNamespace": "kube-system",
148+
}
149+
scParameters["secretName"] = fmt.Sprintf("secret-%d", time.Now().Unix())
150+
test := testsuites.DynamicallyProvisionedCmdVolumeTest{
151+
CSIDriver: testDriver,
152+
Pods: pods,
153+
StorageClassParameters: scParameters,
154+
}
155+
test.Run(cs, ns)
156+
})
157+
124158
ginkgo.It("should create a deployment object, write and read to it, delete the pod and write and read to it again", func() {
125159
pod := testsuites.PodDetails{
126160
Cmd: "echo 'hello world' >> /mnt/test-1/data && while true; do sleep 1; done",

0 commit comments

Comments
 (0)