mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 02:50:30 +00:00
e2e: add e2e to test static pvc
added e2e test case to verify static pvc with and without fsName in the PV object. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
1d17600401
commit
e008e16095
@ -474,11 +474,19 @@ var _ = Describe(cephfsType, func() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
By("check static PVC", func() {
|
By("check static PVC with FsName", func() {
|
||||||
scPath := cephFSExamplePath + "secret.yaml"
|
scPath := cephFSExamplePath + "secret.yaml"
|
||||||
err := validateCephFsStaticPV(f, appPath, scPath)
|
err := validateCephFsStaticPV(f, appPath, scPath, fileSystemName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
framework.Failf("failed to validate CephFS static pv: %v", err)
|
framework.Failf("failed to validate CephFS static pv with filesystem name: %v", err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
By("check static PVC with without FsName", func() {
|
||||||
|
scPath := cephFSExamplePath + "secret.yaml"
|
||||||
|
err := validateCephFsStaticPV(f, appPath, scPath, "")
|
||||||
|
if err != nil {
|
||||||
|
framework.Failf("failed to validate CephFS static pv without filesystem name: %v", err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -323,7 +323,7 @@ func validateRBDStaticMigrationPVC(f *framework.Framework, appPath, scName strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
//nolint:gocyclo,cyclop // reduce complexity
|
//nolint:gocyclo,cyclop // reduce complexity
|
||||||
func validateCephFsStaticPV(f *framework.Framework, appPath, scPath string) error {
|
func validateCephFsStaticPV(f *framework.Framework, appPath, scPath, fsName string) error {
|
||||||
opt := make(map[string]string)
|
opt := make(map[string]string)
|
||||||
var (
|
var (
|
||||||
cephFsVolName = "testSubVol"
|
cephFsVolName = "testSubVol"
|
||||||
@ -406,7 +406,9 @@ func validateCephFsStaticPV(f *framework.Framework, appPath, scPath string) erro
|
|||||||
}
|
}
|
||||||
|
|
||||||
opt["clusterID"] = fsID
|
opt["clusterID"] = fsID
|
||||||
opt["fsName"] = fileSystemName
|
if fsName != "" {
|
||||||
|
opt["fsName"] = fsName
|
||||||
|
}
|
||||||
opt["staticVolume"] = strconv.FormatBool(true)
|
opt["staticVolume"] = strconv.FormatBool(true)
|
||||||
opt["rootPath"] = rootPath
|
opt["rootPath"] = rootPath
|
||||||
pv := getStaticPV(
|
pv := getStaticPV(
|
||||||
|
Loading…
Reference in New Issue
Block a user