mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-26 08:10:20 +00:00
e2e: add prefixname to rbd controller test
Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
parent
f05ac2b25d
commit
0744ad502b
14
e2e/rbd.go
14
e2e/rbd.go
@ -2366,17 +2366,23 @@ var _ = Describe("RBD", func() {
|
|||||||
By("validate the functionality of controller", func() {
|
By("validate the functionality of controller", func() {
|
||||||
err := deleteResource(rbdExamplePath + "storageclass.yaml")
|
err := deleteResource(rbdExamplePath + "storageclass.yaml")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e2elog.Failf("failed to delete storageclass with error %v", err)
|
e2elog.Failf("failed to delete storageclass : %v", err)
|
||||||
}
|
}
|
||||||
err = validateController(f, pvcPath, appPath, rbdExamplePath+"storageclass.yaml")
|
scParams := map[string]string{
|
||||||
|
"volumeNamePrefix": "test-",
|
||||||
|
}
|
||||||
|
err = validateController(f,
|
||||||
|
pvcPath, appPath, rbdExamplePath+"storageclass.yaml",
|
||||||
|
nil,
|
||||||
|
scParams)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e2elog.Failf("failed to validate controller with error %v", err)
|
e2elog.Failf("failed to validate controller : %v", err)
|
||||||
}
|
}
|
||||||
// validate created backend rbd images
|
// validate created backend rbd images
|
||||||
validateRBDImageCount(f, 0, defaultRBDPool)
|
validateRBDImageCount(f, 0, defaultRBDPool)
|
||||||
err = createRBDStorageClass(f.ClientSet, f, defaultSCName, nil, nil, deletePolicy)
|
err = createRBDStorageClass(f.ClientSet, f, defaultSCName, nil, nil, deletePolicy)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e2elog.Failf("failed to create storageclass with error %v", err)
|
e2elog.Failf("failed to create storageclass : %v", err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
11
e2e/utils.go
11
e2e/utils.go
@ -1071,13 +1071,17 @@ func validatePVCSnapshot(
|
|||||||
// Mount the PVC to application (NodeStage/NodePublish should work)
|
// Mount the PVC to application (NodeStage/NodePublish should work)
|
||||||
// Resize the PVC
|
// Resize the PVC
|
||||||
// Delete the Application and PVC.
|
// Delete the Application and PVC.
|
||||||
func validateController(f *framework.Framework, pvcPath, appPath, scPath string) error {
|
func validateController(
|
||||||
|
f *framework.Framework,
|
||||||
|
pvcPath, appPath, scPath string,
|
||||||
|
scOptions, scParams map[string]string) error {
|
||||||
size := "1Gi"
|
size := "1Gi"
|
||||||
poolName := defaultRBDPool
|
poolName := defaultRBDPool
|
||||||
expandSize := "10Gi"
|
expandSize := "10Gi"
|
||||||
var err error
|
var err error
|
||||||
// create storageclass with retain
|
// create storageclass with retain
|
||||||
err = createRBDStorageClass(f.ClientSet, f, defaultSCName, nil, nil, retainPolicy)
|
err = createRBDStorageClass(f.ClientSet, f, defaultSCName, scOptions, scParams,
|
||||||
|
retainPolicy)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to create storageclass: %w", err)
|
return fmt.Errorf("failed to create storageclass: %w", err)
|
||||||
}
|
}
|
||||||
@ -1109,7 +1113,8 @@ func validateController(f *framework.Framework, pvcPath, appPath, scPath string)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to delete storageclass: %w", err)
|
return fmt.Errorf("failed to delete storageclass: %w", err)
|
||||||
}
|
}
|
||||||
err = createRBDStorageClass(f.ClientSet, f, defaultSCName, nil, nil, deletePolicy)
|
err = createRBDStorageClass(f.ClientSet, f, defaultSCName, scOptions, scParams,
|
||||||
|
deletePolicy)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to create storageclass: %w", err)
|
return fmt.Errorf("failed to create storageclass: %w", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user