vfs: fix TestVFSStatfs with known total, used and unknown free

This commit is contained in:
Nick Craig-Wood 2020-05-25 16:46:56 +01:00
parent 31f21551bf
commit 1bd3365868

View File

@ -295,7 +295,11 @@ func TestVFSStatfs(t *testing.T) {
if vfs.usage.Free != nil {
assert.Equal(t, *vfs.usage.Free, free)
} else {
assert.True(t, free >= int64(unknownFreeBytes))
if vfs.usage.Total != nil && vfs.usage.Used != nil {
assert.Equal(t, free, total-used)
} else {
assert.True(t, free >= int64(unknownFreeBytes))
}
}
if vfs.usage.Used != nil {
assert.Equal(t, *vfs.usage.Used, used)