mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-23 21:40: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() {
|
||||
err := deleteResource(rbdExamplePath + "storageclass.yaml")
|
||||
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 {
|
||||
e2elog.Failf("failed to validate controller with error %v", err)
|
||||
e2elog.Failf("failed to validate controller : %v", err)
|
||||
}
|
||||
// validate created backend rbd images
|
||||
validateRBDImageCount(f, 0, defaultRBDPool)
|
||||
err = createRBDStorageClass(f.ClientSet, f, defaultSCName, nil, nil, deletePolicy)
|
||||
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)
|
||||
// Resize the 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"
|
||||
poolName := defaultRBDPool
|
||||
expandSize := "10Gi"
|
||||
var err error
|
||||
// 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 {
|
||||
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 {
|
||||
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 {
|
||||
return fmt.Errorf("failed to create storageclass: %w", err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user