forked from TrueCloudLab/rclone
vfstest: fix crash if open failed
This commit is contained in:
parent
c1a98768bc
commit
67d4394a37
2 changed files with 3 additions and 2 deletions
|
@ -15,7 +15,7 @@ func TestWriteFileNoWrite(t *testing.T) {
|
||||||
run.skipIfNoFUSE(t)
|
run.skipIfNoFUSE(t)
|
||||||
|
|
||||||
fd, err := osCreate(run.path("testnowrite"))
|
fd, err := osCreate(run.path("testnowrite"))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
err = fd.Close()
|
err = fd.Close()
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
|
@ -8,6 +8,7 @@ import (
|
||||||
|
|
||||||
"github.com/rclone/rclone/vfs/vfscommon"
|
"github.com/rclone/rclone/vfs/vfscommon"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
"golang.org/x/sys/unix"
|
"golang.org/x/sys/unix"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -20,7 +21,7 @@ func TestWriteFileDoubleClose(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
out, err := osCreate(run.path("testdoubleclose"))
|
out, err := osCreate(run.path("testdoubleclose"))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
fd := out.Fd()
|
fd := out.Fd()
|
||||||
|
|
||||||
fd1, err := unix.Dup(int(fd))
|
fd1, err := unix.Dup(int(fd))
|
||||||
|
|
Loading…
Add table
Reference in a new issue