blob: 826a1b0beb78e2766f9fe89b39241f56075c2e16 [file] [log] [blame]
package sftp
import (
"syscall"
"testing"
)
func TestClientStatVFS(t *testing.T) {
if *testServerImpl {
t.Skipf("go server does not support FXP_EXTENDED")
}
sftp, cmd := testClient(t, READWRITE, NODELAY)
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")
}
}