mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-09 16:00:22 +00:00
e2e: add e2e testcase of new image features
adding e2e testcase to validate the workflow of pvc creation and attaching to pod works for new image features like fast-diff,obj-map,exclusive-lock and layering. fixes: #2695 Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
2bf17007d9
commit
4ebfeaaa75
74
e2e/rbd.go
74
e2e/rbd.go
@ -649,6 +649,80 @@ var _ = Describe("RBD", func() {
|
||||
}
|
||||
})
|
||||
|
||||
By("create PVC with layering,fast-diff image-features and bind it to an app",
|
||||
func() {
|
||||
if util.CheckKernelSupport(kernelRelease, fastDiffSupport) {
|
||||
err := deleteResource(rbdExamplePath + "storageclass.yaml")
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to delete storageclass: %v", err)
|
||||
}
|
||||
err = createRBDStorageClass(
|
||||
f.ClientSet,
|
||||
f,
|
||||
defaultSCName,
|
||||
nil,
|
||||
map[string]string{
|
||||
"imageFeatures": "layering,exclusive-lock,object-map,fast-diff",
|
||||
},
|
||||
deletePolicy)
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to create storageclass: %v", err)
|
||||
}
|
||||
err = validatePVCAndAppBinding(pvcPath, appPath, f)
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to validate CephFS pvc and application binding: %v", err)
|
||||
}
|
||||
// validate created backend rbd images
|
||||
validateRBDImageCount(f, 0, defaultRBDPool)
|
||||
err = deleteResource(rbdExamplePath + "storageclass.yaml")
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to delete storageclass: %v", err)
|
||||
}
|
||||
err = createRBDStorageClass(f.ClientSet, f, defaultSCName, nil, nil, deletePolicy)
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to create storageclass: %v", err)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
By("create PVC with journaling,fast-diff image-features and bind it to an app using rbd-nbd mounter",
|
||||
func() {
|
||||
if util.CheckKernelSupport(kernelRelease, fastDiffSupport) {
|
||||
err := deleteResource(rbdExamplePath + "storageclass.yaml")
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to delete storageclass: %v", err)
|
||||
}
|
||||
// Storage class with rbd-nbd mounter
|
||||
err = createRBDStorageClass(
|
||||
f.ClientSet,
|
||||
f,
|
||||
defaultSCName,
|
||||
nil,
|
||||
map[string]string{
|
||||
"mounter": "rbd-nbd",
|
||||
"imageFeatures": "layering,journaling,exclusive-lock,object-map,fast-diff",
|
||||
},
|
||||
deletePolicy)
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to create storageclass: %v", err)
|
||||
}
|
||||
err = validatePVCAndAppBinding(pvcPath, appPath, f)
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to validate CephFS pvc and application binding: %v", err)
|
||||
}
|
||||
// validate created backend rbd images
|
||||
validateRBDImageCount(f, 0, defaultRBDPool)
|
||||
err = deleteResource(rbdExamplePath + "storageclass.yaml")
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to delete storageclass: %v", err)
|
||||
}
|
||||
err = createRBDStorageClass(f.ClientSet, f, defaultSCName, nil, nil, deletePolicy)
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to create storageclass: %v", err)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// NOTE: RWX is restricted for FileSystem VolumeMode at ceph-csi,
|
||||
// see pull#261 for more details.
|
||||
By("Create RWX+Block Mode PVC and bind to multiple pods via deployment using rbd-nbd mounter", func() {
|
||||
|
@ -40,6 +40,18 @@ var nbdResizeSupport = []util.KernelVersion{
|
||||
}, // standard 5.3+ versions
|
||||
}
|
||||
|
||||
// nolint:gomnd // numbers specify Kernel versions.
|
||||
var fastDiffSupport = []util.KernelVersion{
|
||||
{
|
||||
Version: 5,
|
||||
PatchLevel: 3,
|
||||
SubLevel: 0,
|
||||
ExtraVersion: 0,
|
||||
Distribution: "",
|
||||
Backport: false,
|
||||
}, // standard 5.3+ versions
|
||||
}
|
||||
|
||||
// To use `io-timeout=0` we need
|
||||
// www.mail-archive.com/linux-block@vger.kernel.org/msg38060.html
|
||||
// nolint:gomnd // numbers specify Kernel versions.
|
||||
|
Loading…
Reference in New Issue
Block a user