go-ceph/cephfs/makedirs_test.go
Sven Anderson 5875e7f74b cephfs: promote preview API for release v0.23.0
Signed-off-by: Sven Anderson <sven@redhat.com>
2023-08-14 14:43:57 +00:00

28 lines
548 B
Go

package cephfs
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestMakeDirs(t *testing.T) {
mount := fsConnect(t)
defer fsDisconnect(t, mount)
dir1 := "/base/sub/way"
err := mount.MakeDirs(dir1, 0o755)
assert.NoError(t, err)
defer func() {
assert.NoError(t, mount.RemoveDir("/base/sub/way"))
assert.NoError(t, mount.RemoveDir("/base/sub"))
assert.NoError(t, mount.RemoveDir("/base"))
}()
dir, err := mount.OpenDir(dir1)
assert.NoError(t, err)
assert.NotNil(t, dir)
err = dir.Close()
assert.NoError(t, err)
}