diff --git a/cephfs/cephfs_test.go b/cephfs/cephfs_test.go index 63b1e18..ccf7852 100644 --- a/cephfs/cephfs_test.go +++ b/cephfs/cephfs_test.go @@ -164,9 +164,11 @@ func TestUnmountMount(t *testing.T) { require.NoError(t, err) require.NotNil(t, mount) assert.False(t, mount.IsMounted()) + assert.NoError(t, mount.Release()) }) t.Run("mountUnmount", func(t *testing.T) { mount := fsConnect(t) + defer func() { assert.NoError(t, mount.Release()) }() assert.True(t, mount.IsMounted()) err := mount.Unmount() @@ -292,12 +294,14 @@ func TestCreateMountWithId(t *testing.T) { mount, err := CreateMountWithId("bobolink") assert.NoError(t, err) assert.NotNil(t, mount) + defer func() { assert.NoError(t, mount.Release()) }() err = mount.ReadDefaultConfigFile() assert.NoError(t, err) err = mount.Mount() assert.NoError(t, err) + defer func() { assert.NoError(t, mount.Unmount()) }() // verify the custom entity_id is visible in the 'session ls' output // of mds. @@ -400,6 +404,7 @@ func TestGetSetConfigOption(t *testing.T) { mount, err := CreateMount() require.NoError(t, err) require.NotNil(t, mount) + defer func() { assert.NoError(t, mount.Release()) }() err = mount.SetConfigOption("__dne__", "value") assert.Error(t, err) diff --git a/cephfs/conn_nautilus_test.go b/cephfs/conn_nautilus_test.go index 96a1253..6b9819a 100644 --- a/cephfs/conn_nautilus_test.go +++ b/cephfs/conn_nautilus_test.go @@ -12,6 +12,7 @@ import ( func TestGetFsCid(t *testing.T) { t.Run("unmounted", func(t *testing.T) { mount, err := CreateMount() + defer func() { assert.NoError(t, mount.Release()) }() require.NoError(t, err) require.NotNil(t, mount)