Stop folder when running out of disk space (fixes #2057)

& tweaks by calmh
This commit is contained in:
Lode Hoste
2015-07-16 12:52:36 +02:00
committed by Jakob Borg
parent 6a58033f2b
commit dfaa999291
17 changed files with 217 additions and 1 deletions

View File

@@ -164,3 +164,18 @@ func TestInWritableDirWindowsRename(t *testing.T) {
}
}
}
func TestDiskUsage(t *testing.T) {
free, err := osutil.DiskFreePercentage(".")
if err != nil {
if runtime.GOOS == "netbsd" ||
runtime.GOOS == "openbsd" ||
runtime.GOOS == "solaris" {
t.Skip()
}
t.Errorf("Unexpected error: %s", err)
}
if free < 1 {
t.Error("Disk is full?", free)
}
}