mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
e2e: add validation for subvolumePath
as we are adding the subvolumepath to the PV spec. this commits adds an E2E testing to verify it. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
8cd901d2dd
commit
1aaccd0e5a
@ -138,3 +138,16 @@ func listCephFSSubVolumes(f *framework.Framework, filesystem, groupname string)
|
||||
}
|
||||
return subVols, nil
|
||||
}
|
||||
|
||||
// getSubvolumepath validates whether subvolumegroup is present.
|
||||
func getSubvolumePath(f *framework.Framework, filesystem, subvolgrp, subvolume string) (string, error) {
|
||||
cmd := fmt.Sprintf("ceph fs subvolume getpath %s %s --group_name=%s", filesystem, subvolume, subvolgrp)
|
||||
stdOut, stdErr, err := execCommandInToolBoxPod(f, cmd, rookNamespace)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if stdErr != "" {
|
||||
return "", fmt.Errorf("failed to getpath for subvolume %s with error %s", subvolume, stdErr)
|
||||
}
|
||||
return strings.TrimSpace(stdOut), nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user