/usr/share/gocode/src/github.com/pkg/sftp/client_integration_darwin_test.go is in golang-github-pkg-sftp-dev 0.0~git20160930.0.4d0e916-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | package sftp
import (
"syscall"
"testing"
)
const sftpServer = "/usr/libexec/sftp-server"
func TestClientStatVFS(t *testing.T) {
if *testServerImpl {
t.Skipf("go server does not support FXP_EXTENDED")
}
sftp, cmd := testClient(t, READWRITE, NO_DELAY)
defer cmd.Wait()
defer sftp.Close()
vfs, err := sftp.StatVFS("/")
if err != nil {
t.Fatal(err)
}
// get system stats
s := syscall.Statfs_t{}
err = syscall.Statfs("/", &s)
if err != nil {
t.Fatal(err)
}
// check some stats
if vfs.Files != uint64(s.Files) {
t.Fatal("fr_size does not match")
}
if vfs.Bfree != uint64(s.Bfree) {
t.Fatal("f_bsize does not match")
}
if vfs.Favail != uint64(s.Ffree) {
t.Fatal("f_namemax does not match")
}
}
|