mirror of
https://github.com/ceph/go-ceph
synced 2024-12-24 15:13:11 +00:00
cephfs: TestMountWithRoot should only try unmounting after mounting
The defer function in TestMountWithRoot was always trying to call unmount before release. This is not correct if the fs was not mounted so we reorganize this code to more closely match what should be done in normal practice. Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
parent
6a08124775
commit
bdee9f4aab
@ -354,7 +354,6 @@ func TestMountWithRoot(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, mount)
|
||||
defer func() {
|
||||
assert.NoError(t, mount.Unmount())
|
||||
assert.NoError(t, mount.Release())
|
||||
}()
|
||||
|
||||
@ -363,6 +362,9 @@ func TestMountWithRoot(t *testing.T) {
|
||||
|
||||
err = mount.MountWithRoot(dir1)
|
||||
assert.NoError(t, err)
|
||||
defer func() {
|
||||
assert.NoError(t, mount.Unmount())
|
||||
}()
|
||||
|
||||
err = mount.ChangeDir(sub1)
|
||||
assert.NoError(t, err)
|
||||
|
Loading…
Reference in New Issue
Block a user