Skip to content

Commit cc729e9

Browse files
committed
test: add subDir e2e test
1 parent 16c442a commit cc729e9

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

test/e2e/dynamic_provisioning_test.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,35 @@ var _ = ginkgo.Describe("Dynamic Provisioning", func() {
186186
test.Run(cs, ns)
187187
})
188188

189+
ginkgo.It("[subDir]should create a deployment object, write and read to it, delete the pod and write and read to it again [nfs.csi.k8s.io]", func() {
190+
pod := testsuites.PodDetails{
191+
Cmd: "echo 'hello world' >> /mnt/test-1/data && while true; do sleep 100; done",
192+
Volumes: []testsuites.VolumeDetails{
193+
{
194+
ClaimSize: "10Gi",
195+
VolumeMount: testsuites.VolumeMountDetails{
196+
NameGenerate: "test-volume-",
197+
MountPathGenerate: "/mnt/test-",
198+
},
199+
},
200+
},
201+
}
202+
203+
podCheckCmd := []string{"cat", "/mnt/test-1/data"}
204+
expectedString := "hello world\n"
205+
206+
test := testsuites.DynamicallyProvisionedDeletePodTest{
207+
CSIDriver: testDriver,
208+
Pod: pod,
209+
PodCheck: &testsuites.PodExecCheck{
210+
Cmd: podCheckCmd,
211+
ExpectedString: expectedString, // pod will be restarted so expect to see 2 instances of string
212+
},
213+
StorageClassParameters: subDirStorageClassParameters,
214+
}
215+
test.Run(cs, ns)
216+
})
217+
189218
ginkgo.It(fmt.Sprintf("should delete PV with reclaimPolicy %q [nfs.csi.k8s.io]", v1.PersistentVolumeReclaimDelete), func() {
190219
reclaimPolicy := v1.PersistentVolumeReclaimDelete
191220
volumes := []testsuites.VolumeDetails{

0 commit comments

Comments
 (0)