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.
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)
})
}
