@@ -402,37 +402,58 @@ var _ = Describe("RBD", func() {
402402 }
403403 })
404404
405- // todo: may be remove the below deletion test later once the migration nodestage tests are adjusted
406- // also to have deletion validation through the same.
407- By ("validate RBD migration+static Block PVC Deletion" , func () {
408- err := generateClusterIDConfigMapForMigration (f , c )
405+ By ("validate RBD migration PVC" , func () {
406+ err := setupMigrationCMSecretAndSC (f , "" )
409407 if err != nil {
410- e2elog .Failf ("failed to generate clusterID configmap : %v" , err )
408+ e2elog .Failf ("failed to setup migration prerequisites : %v" , err )
411409 }
410+ err = validatePVCAndAppBinding (pvcPath , appPath , f )
411+ if err != nil {
412+ e2elog .Failf ("failed to validate pvc and application binding: %v" , err )
413+ }
414+ // validate created backend rbd images
415+ validateRBDImageCount (f , 0 , defaultRBDPool )
412416
413- // create a sc with different migration secret
414- err = createMigrationUserSecretAndSC ( f , "migrationsc" )
417+ // Block PVC resize
418+ err = resizePVCAndValidateSize ( rawPvcPath , rawAppPath , f )
415419 if err != nil {
416- e2elog .Failf ("failed to create storageclass : %v" , err )
420+ e2elog .Failf ("failed to resize block PVC : %v" , err )
417421 }
418- err = validateRBDStaticMigrationPVDeletion (f , rawAppPath , "migrationsc" , true )
422+
423+ // FileSystem PVC resize
424+ err = resizePVCAndValidateSize (pvcPath , appPath , f )
419425 if err != nil {
420- e2elog .Failf ("failed to validate rbd migrated static block pv : %v" , err )
426+ e2elog .Failf ("failed to resize filesystem PVC : %v" , err )
421427 }
422- // validate created backend rbd images
423- validateRBDImageCount (f , 0 , defaultRBDPool )
424- err = deleteConfigMap (rbdDirPath )
428+ err = deleteResource (rbdExamplePath + "storageclass.yaml" )
425429 if err != nil {
426- e2elog .Failf ("failed to delete configmap: %v" , err )
430+ e2elog .Failf ("failed to delete storageclass: %v" , err )
431+ }
432+ err = createRBDStorageClass (f .ClientSet , f , defaultSCName , nil , nil , deletePolicy )
433+ if err != nil {
434+ e2elog .Failf ("failed to create storageclass: %v" , err )
427435 }
428- err = createConfigMap ( rbdDirPath , f . ClientSet , f )
436+ err = tearDownMigrationSetup ( f )
429437 if err != nil {
430- e2elog .Failf ("failed to create configmap : %v" , err )
438+ e2elog .Failf ("failed to tear down migration setup : %v" , err )
431439 }
440+ })
432441
433- err = deleteProvNodeMigrationSecret (f , true , true )
442+ By ("validate RBD migration+static FileSystem" , func () {
443+ err := setupMigrationCMSecretAndSC (f , "migrationsc" )
444+ if err != nil {
445+ e2elog .Failf ("failed to setup migration prerequisites: %v" , err )
446+ }
447+ // validate filesystem pvc mount
448+ err = validateRBDStaticMigrationPVC (f , appPath , "migrationsc" , false )
434449 if err != nil {
435- e2elog .Failf ("failed to delete migration users and Secrets associated: %v" , err )
450+ e2elog .Failf ("failed to validate rbd migrated static file mode pvc: %v" , err )
451+ }
452+ // validate created backend rbd images
453+ validateRBDImageCount (f , 0 , defaultRBDPool )
454+ err = tearDownMigrationSetup (f )
455+ if err != nil {
456+ e2elog .Failf ("failed to tear down migration setup: %v" , err )
436457 }
437458 err = createRBDStorageClass (f .ClientSet , f , defaultSCName , nil , nil , deletePolicy )
438459 if err != nil {
@@ -2117,72 +2138,6 @@ var _ = Describe("RBD", func() {
21172138 validateRBDImageCount (f , 0 , defaultRBDPool )
21182139 })
21192140
2120- By ("validate RBD migration+static FileSystem PVC" , func () {
2121- err := generateClusterIDConfigMapForMigration (f , c )
2122- if err != nil {
2123- e2elog .Failf ("failed to generate clusterID configmap: %v" , err )
2124- }
2125- // create node user and migration secret.
2126- err = createProvNodeCephUserAndSecret (f , false , true )
2127- if err != nil {
2128- e2elog .Failf ("failed to create users and secret: %v" , err )
2129- }
2130-
2131- err = validateRBDStaticMigrationPV (f , appPath , rbdMigrationNodePluginSecretName , false )
2132- if err != nil {
2133- e2elog .Failf ("failed to validate rbd migrated static pv: %v" , err )
2134- }
2135- // validate created backend rbd images
2136- validateRBDImageCount (f , 0 , defaultRBDPool )
2137-
2138- err = deleteProvNodeMigrationSecret (f , false , true )
2139- if err != nil {
2140- e2elog .Failf ("failed to delete users and secret: %v" , err )
2141- }
2142-
2143- err = deleteConfigMap (rbdDirPath )
2144- if err != nil {
2145- e2elog .Failf ("failed to delete configmap: %v" , err )
2146- }
2147- err = createConfigMap (rbdDirPath , f .ClientSet , f )
2148- if err != nil {
2149- e2elog .Failf ("failed to create configmap: %v" , err )
2150- }
2151- })
2152-
2153- By ("validate RBD migration+static Block PVC" , func () {
2154- err := generateClusterIDConfigMapForMigration (f , c )
2155- if err != nil {
2156- e2elog .Failf ("failed to generate clusterID configmap: %v" , err )
2157- }
2158- // create node user and migration secret.
2159- err = createProvNodeCephUserAndSecret (f , false , true )
2160- if err != nil {
2161- e2elog .Failf ("failed to create users and secret: %v" , err )
2162- }
2163-
2164- err = validateRBDStaticMigrationPV (f , rawAppPath , rbdMigrationNodePluginSecretName , true )
2165- if err != nil {
2166- e2elog .Failf ("failed to validate rbd migrated static block pv: %v" , err )
2167- }
2168- // validate created backend rbd images
2169- validateRBDImageCount (f , 0 , defaultRBDPool )
2170-
2171- err = deleteProvNodeMigrationSecret (f , false , true )
2172- if err != nil {
2173- e2elog .Failf ("failed to delete users and secret: %v" , err )
2174- }
2175-
2176- err = deleteConfigMap (rbdDirPath )
2177- if err != nil {
2178- e2elog .Failf ("failed to delete configmap: %v" , err )
2179- }
2180- err = createConfigMap (rbdDirPath , f .ClientSet , f )
2181- if err != nil {
2182- e2elog .Failf ("failed to create configmap: %v" , err )
2183- }
2184- })
2185-
21862141 By ("validate failure of RBD static PVC without imageFeatures parameter" , func () {
21872142 err := validateRBDStaticPV (f , rawAppPath , true , true )
21882143 if err != nil {
0 commit comments