1// Copyright 2017 The Go Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// +build solaris 6 7package unix_test 8 9import ( 10 "os/exec" 11 "testing" 12 13 "golang.org/x/sys/unix" 14) 15 16func TestStatvfs(t *testing.T) { 17 if err := unix.Statvfs("", nil); err == nil { 18 t.Fatal(`Statvfs("") expected failure`) 19 } 20 21 statvfs := unix.Statvfs_t{} 22 if err := unix.Statvfs("/", &statvfs); err != nil { 23 t.Errorf(`Statvfs("/") failed: %v`, err) 24 } 25 26 if t.Failed() { 27 mount, err := exec.Command("mount").CombinedOutput() 28 if err != nil { 29 t.Logf("mount: %v\n%s", err, mount) 30 } else { 31 t.Logf("mount: %s", mount) 32 } 33 } 34} 35