Skip to content

Commit

Permalink
test: add secretName e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
andyzhangx committed Dec 23, 2021
1 parent b012489 commit a0a25f2
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/e2e/dynamic_provisioning_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"os"
"os/exec"
"strings"
"time"

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

ginkgo.It("should create a volume on demand with specified secretName", func() {
pods := []testsuites.PodDetails{
{
Cmd: "echo 'hello world' > /mnt/test-1/data && grep 'hello world' /mnt/test-1/data",
Volumes: []testsuites.VolumeDetails{
{
ClaimSize: "10Gi",
MountOptions: []string{
"-o allow_other",
"--file-cache-timeout-in-seconds=120",
"--cancel-list-on-mount-seconds=0",
},
VolumeMount: testsuites.VolumeMountDetails{
NameGenerate: "test-volume-",
MountPathGenerate: "/mnt/test-",
},
},
},
},
}
scParameters := map[string]string{
"skuName": "Standard_LRS",
"secretNamespace": "kube-system",
}
scParameters["secretName"] = fmt.Sprintf("secret-%d", time.Now().Unix())
test := testsuites.DynamicallyProvisionedCmdVolumeTest{
CSIDriver: testDriver,
Pods: pods,
StorageClassParameters: scParameters,
}
test.Run(cs, ns)
})

ginkgo.It("should create a deployment object, write and read to it, delete the pod and write and read to it again", func() {
pod := testsuites.PodDetails{
Cmd: "echo 'hello world' >> /mnt/test-1/data && while true; do sleep 1; done",
Expand Down

0 comments on commit a0a25f2

Please sign in to comment.