mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-22 14:20:19 +00:00
e2e: add rbd test for testing sc, secret via helm
add rbd test for validating storageclass and secret deployment via helm. Signed-off-by: Yug <yuggupta27@gmail.com>
This commit is contained in:
parent
d865670f97
commit
7d28896e36
30
e2e/rbd.go
30
e2e/rbd.go
@ -199,10 +199,14 @@ var _ = Describe("RBD", func() {
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to create configmap with error %v", err)
|
||||
}
|
||||
// Since helm deploys storageclass, skip storageclass creation if
|
||||
// ceph-csi is deployed via helm.
|
||||
if !helmTest {
|
||||
err = createRBDStorageClass(f.ClientSet, f, defaultSCName, nil, nil, deletePolicy)
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to create storageclass with error %v", err)
|
||||
}
|
||||
}
|
||||
// create rbd provisioner secret
|
||||
key, err := createCephUser(f, keyringRBDProvisionerUsername, rbdProvisionerCaps("", ""))
|
||||
if err != nil {
|
||||
@ -306,6 +310,32 @@ var _ = Describe("RBD", func() {
|
||||
}
|
||||
})
|
||||
|
||||
// test only if ceph-csi is deployed via helm
|
||||
if helmTest {
|
||||
By("verify PVC and app binding on helm installation", func() {
|
||||
err := validatePVCAndAppBinding(pvcPath, appPath, f)
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to validate CephFS pvc and application binding with error %v", err)
|
||||
}
|
||||
// validate created backend rbd images
|
||||
validateRBDImageCount(f, 0, defaultRBDPool)
|
||||
// Deleting the storageclass and secret created by helm
|
||||
err = deleteResource(rbdExamplePath + "storageclass.yaml")
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to delete storageclass with error %v", err)
|
||||
}
|
||||
err = deleteResource(rbdExamplePath + "secret.yaml")
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to delete secret with error %v", err)
|
||||
}
|
||||
// Re-create the RBD storageclass
|
||||
err = createRBDStorageClass(f.ClientSet, f, defaultSCName, nil, nil, deletePolicy)
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to create storageclass with error %v", err)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
By("create a PVC and validate owner", func() {
|
||||
err := validateImageOwner(pvcPath, f)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user