diff --git a/e2e/cephfs.go b/e2e/cephfs.go index 3d7fcb95c..f8173ba34 100644 --- a/e2e/cephfs.go +++ b/e2e/cephfs.go @@ -39,6 +39,7 @@ var _ = Describe("cephfs", func() { deployCephfsPlugin() createCephfsStorageClass(f.ClientSet, f) createCephfsSecret(f.ClientSet, f) + GivePermToCephfsRoot(f) }) AfterEach(func() { diff --git a/e2e/utils.go b/e2e/utils.go index a84de2c3e..de44d6e37 100644 --- a/e2e/utils.go +++ b/e2e/utils.go @@ -745,3 +745,17 @@ func listSnapshots(f *framework.Framework, pool, imageName string) ([]snapInfo, err := json.Unmarshal([]byte(stdout), &snapInfos) return snapInfos, err } + +func GivePermToCephfsRoot(f *framework.Framework) { + opt := metav1.ListOptions{ + LabelSelector: "app=rook-ceph-tools", + } + out := execCommandInPod(f, "mkdir /mnt/cephfs", rookNS, &opt) + e2elog.Logf("Creating temperory mount point in tools pod %s", out) + + out = execCommandInPod(f, "ceph-fuse /mnt/cephfs >/dev/null 2>&1", rookNS, &opt) + e2elog.Logf("Mounting ceph file system at /mnt/cephfs %s", out) + + out = execCommandInPod(f, "chmod 777 /mnt/cephfs/", rookNS, &opt) + e2elog.Logf("Setting chmod 777 on the cepfs root %s", out) +}