From 3b9317b60805fc5f961284c02c7c4a1100f85462 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Fri, 12 Mar 2021 10:41:24 -0500 Subject: [PATCH] cephfs: remove a use of external mount of test fs The external mount point was mainly used for stat prior to a Stat function being part of go-ceph's cephfs package. Now that we have Statx, we can replace the need for the external mount and os.Stat. Signed-off-by: John Mulligan --- cephfs/mount_perms_mimic_test.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cephfs/mount_perms_mimic_test.go b/cephfs/mount_perms_mimic_test.go index 86c98ee..9116f62 100644 --- a/cephfs/mount_perms_mimic_test.go +++ b/cephfs/mount_perms_mimic_test.go @@ -3,9 +3,6 @@ package cephfs import ( - "os" - "path" - "syscall" "testing" "github.com/stretchr/testify/assert" @@ -33,13 +30,12 @@ func TestSetMountPerms(t *testing.T) { defer func() { assert.NoError(t, mount.Unmount()) }() t.Run("checkStat", func(t *testing.T) { - useMount(t) dirname := "/check-mount-perms" err := mount.MakeDir(dirname, 0755) assert.NoError(t, err) defer mount.RemoveDir(dirname) - s, err := os.Stat(path.Join(CephMountDir, dirname)) + sx, err := mount.Statx(dirname, StatxBasicStats, 0) require.NoError(t, err) - assert.EqualValues(t, s.Sys().(*syscall.Stat_t).Gid, 500) + assert.EqualValues(t, sx.Gid, 500) }) }