Fix GPU plugin test setup + better error message

Tests fail depending in which order they are run, unless mocked files
are cleaned between test runs.

Without this, the next commit would fail.
This commit is contained in:
Eero Tamminen 2021-03-05 18:45:31 +02:00
parent d737b3388d
commit 49354693fb

View File

@ -138,8 +138,12 @@ func TestScan(t *testing.T) {
t.Errorf("unexpected error: %+v", err)
}
if tc.expectedDevs != notifier.devCount {
t.Errorf("Wrong number of discovered devices")
t.Errorf("Expected %d, discovered %d devices",
tc.expectedDevs, notifier.devCount)
}
// remove dirs/files for next test
os.RemoveAll(sysfs)
os.RemoveAll(devfs)
})
}
}