vfstests: move functional tests from mountlib and make them work with VFS
The tests are now run for the mount commands and for the plain VFS. This makes the tests much easier to debug when running with a VFS than through a mount.
This commit is contained in:
parent
b25f5eb0d1
commit
fd39cbc193
16 changed files with 259 additions and 67 deletions
25
vfs/vfstest/write_non_unix.go
Normal file
25
vfs/vfstest/write_non_unix.go
Normal file
|
@ -0,0 +1,25 @@
|
|||
// +build !linux,!darwin,!freebsd
|
||||
|
||||
package vfstest
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
// TestWriteFileDoubleClose tests double close on write
|
||||
func TestWriteFileDoubleClose(t *testing.T) {
|
||||
t.Skip("not supported on " + runtime.GOOS)
|
||||
}
|
||||
|
||||
// writeTestDup performs the platform-specific implementation of the dup() syscall
|
||||
func writeTestDup(oldfd uintptr) (uintptr, error) {
|
||||
p, err := windows.GetCurrentProcess()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
var h windows.Handle
|
||||
return uintptr(h), windows.DuplicateHandle(p, windows.Handle(oldfd), p, &h, 0, true, windows.DUPLICATE_SAME_ACCESS)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue