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:
Madhu Rajanna 2020-08-05 13:05:56 +05:30 committed by mergify[bot]
parent 07890aace6
commit 141b89f514

View File

@ -948,6 +948,22 @@ func writeDataInPod(app *v1.Pod, f *framework.Framework) error {
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 {
data := "checking data persist"
pvc, err := loadPVC(pvcPath)