mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-09 16:00:22 +00:00
e2e: add function to get subvolume list
added a helper function in e2e to list subvolumes in a filesystem Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
07890aace6
commit
141b89f514
16
e2e/utils.go
16
e2e/utils.go
@ -948,6 +948,22 @@ func writeDataInPod(app *v1.Pod, f *framework.Framework) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type cephfsSubVolume struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func listCephFSSubVolumes(f *framework.Framework, filesystem, groupname string) []cephfsSubVolume {
|
||||||
|
stdout, stdErr := execCommandInToolBoxPod(f, fmt.Sprintf("ceph fs subvolume ls %s --group_name=%s --format=json", filesystem, groupname), rookNamespace)
|
||||||
|
Expect(stdErr).Should(BeEmpty())
|
||||||
|
var subVols []cephfsSubVolume
|
||||||
|
|
||||||
|
err := json.Unmarshal([]byte(stdout), &subVols)
|
||||||
|
if err != nil {
|
||||||
|
Fail(err.Error())
|
||||||
|
}
|
||||||
|
return subVols
|
||||||
|
}
|
||||||
|
|
||||||
func checkDataPersist(pvcPath, appPath string, f *framework.Framework) error {
|
func checkDataPersist(pvcPath, appPath string, f *framework.Framework) error {
|
||||||
data := "checking data persist"
|
data := "checking data persist"
|
||||||
pvc, err := loadPVC(pvcPath)
|
pvc, err := loadPVC(pvcPath)
|
||||||
|
Loading…
Reference in New Issue
Block a user