mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-05-22 07:16:41 +00:00
e2e: Add testcase of invalid mount option
Added a test case to cover unmap of rbd image if the mounting fails. if we pass the invalid mount option the expectation is that mounting of rbd image to stagingpath fails. as the unmap happens it should not block the rbd pvc deletion saying rbd image is in-use. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com> (cherry picked from commit 44da7ffb4e4d8861265f3ecd421cd06dfce9f34a)
This commit is contained in:
parent
c06533de6b
commit
958d2b3974
34
e2e/rbd.go
34
e2e/rbd.go
@ -562,6 +562,40 @@ var _ = Describe("RBD", func() {
|
||||
createRBDStorageClass(f.ClientSet, f, nil, nil)
|
||||
})
|
||||
|
||||
// Mount pvc to pod with invalid mount option,expected that
|
||||
// mounting will fail
|
||||
By("Mount pvc to pod with invalid mount option", func() {
|
||||
deleteResource(rbdExamplePath + "storageclass.yaml")
|
||||
createRBDStorageClass(f.ClientSet, f, map[string]string{rbdmountOptions: "debug,invalidOption"}, nil)
|
||||
pvc, err := loadPVC(pvcPath)
|
||||
if err != nil {
|
||||
Fail(err.Error())
|
||||
}
|
||||
pvc.Namespace = f.UniqueName
|
||||
|
||||
app, err := loadApp(appPath)
|
||||
if err != nil {
|
||||
Fail(err.Error())
|
||||
}
|
||||
app.Namespace = f.UniqueName
|
||||
err = createPVCAndvalidatePV(f.ClientSet, pvc, deployTimeout)
|
||||
if err != nil {
|
||||
Fail(err.Error())
|
||||
}
|
||||
// create an app and wait for 2 min for it to go to running state
|
||||
err = createApp(f.ClientSet, app, 2)
|
||||
if err == nil {
|
||||
Fail("application should not go to running state due to invalid mount option")
|
||||
}
|
||||
err = deletePVCAndApp("", f, pvc, app)
|
||||
if err != nil {
|
||||
Fail(err.Error())
|
||||
}
|
||||
|
||||
deleteResource(rbdExamplePath + "storageclass.yaml")
|
||||
createRBDStorageClass(f.ClientSet, f, nil, nil)
|
||||
})
|
||||
|
||||
// Make sure this should be last testcase in this file, because
|
||||
// it deletes pool
|
||||
By("Create a PVC and Delete PVC when backend pool deleted", func() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user