Fix assumptions about tmpfs in metrics du tests
This commit is contained in:
@@ -298,13 +298,18 @@ func TestMetrics(t *testing.T) {
|
||||
// Need to create the subdirectory
|
||||
os.MkdirAll(builder.GetPath(), 0755)
|
||||
|
||||
expectedEmptyDirUsage, err := volume.FindEmptyDirectoryUsageOnTmpfs()
|
||||
if err != nil {
|
||||
t.Errorf("Unexpected error finding expected empty directory usage on tmpfs: %v", err)
|
||||
}
|
||||
|
||||
// TODO(pwittroc): Move this into a reusable testing utility
|
||||
metrics, err := builder.GetMetrics()
|
||||
if err != nil {
|
||||
t.Errorf("Unexpected error when calling GetMetrics %v", err)
|
||||
}
|
||||
if metrics.Used.Value() != 4096 {
|
||||
t.Errorf("Expected Used %d to be 4096", metrics.Used.Value())
|
||||
if e, a := expectedEmptyDirUsage.Value(), metrics.Used.Value(); e != a {
|
||||
t.Errorf("Unexpected value for empty directory; expected %v, got %v", e, a)
|
||||
}
|
||||
if metrics.Capacity.Value() <= 0 {
|
||||
t.Errorf("Expected Capacity to be greater than 0")
|
||||
|
Reference in New Issue
Block a user