Skip to content

Commit ecac134

Browse files
Madhu-1humblec
authored andcommitted
Added E2E for rbd nodeplugin restart
Signed-off-by: Madhu Rajanna <[email protected]> (cherry picked from commit 3f8a073)
1 parent 74852cf commit ecac134

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

e2e/rbd.go

+34
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,40 @@ var _ = Describe("RBD", func() {
234234
Fail(err.Error())
235235
}
236236
})
237+
238+
By("Test unmount after nodeplugin restart", func() {
239+
pvc, err := loadPVC(pvcPath)
240+
if err != nil {
241+
Fail(err.Error())
242+
}
243+
pvc.Namespace = f.UniqueName
244+
245+
app, err := loadApp(appPath)
246+
if err != nil {
247+
Fail(err.Error())
248+
}
249+
app.Namespace = f.UniqueName
250+
err = createPVCAndApp("", f, pvc, app)
251+
if err != nil {
252+
Fail(err.Error())
253+
}
254+
255+
// delete rbd nodeplugin pods
256+
err = deletePodWithLabel("app=csi-rbdplugin")
257+
if err != nil {
258+
Fail(err.Error())
259+
}
260+
// wait for nodeplugin pods to come up
261+
err = waitForDaemonSets(rbdDaemonsetName, namespace, f.ClientSet, deployTimeout)
262+
if err != nil {
263+
Fail(err.Error())
264+
}
265+
266+
err = deletePVCAndApp("", f, pvc, app)
267+
if err != nil {
268+
Fail(err.Error())
269+
}
270+
})
237271
})
238272
})
239273

e2e/utils.go

+7
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,13 @@ func validatePVCAndAppBinding(pvcPath, appPath string, f *framework.Framework) {
611611
Fail(err.Error())
612612
}
613613
}
614+
func deletePodWithLabel(label string) error {
615+
_, err := framework.RunKubectl("delete", "po", "-l", label)
616+
if err != nil {
617+
e2elog.Logf("failed to delete pod %v", err)
618+
}
619+
return err
620+
}
614621

615622
func validateNormalUserPVCAccess(pvcPath string, f *framework.Framework) {
616623
pvc, err := loadPVC(pvcPath)

0 commit comments

Comments
 (0)