Add additional test for mdadm_linux collector

This commit is contained in:
Ben Kochie 2016-06-07 07:53:00 +02:00
parent a09bbaacd1
commit 8c809cd29a
2 changed files with 13 additions and 0 deletions

View file

@ -0,0 +1,5 @@
Personalities : [invalid]
md3 : invalid
314159265 blocks 64k chunks
unused devices: <none>

View file

@ -46,3 +46,11 @@ func TestMdadm(t *testing.T) {
t.Errorf("expected number of parsed md-device to be %d, but was %d", len(refs), len(mdStates))
}
}
func TestInvalidMdstat(t *testing.T) {
_, err := parseMdstat("fixtures/proc/mdstat_invalid")
if err == nil {
t.Fatalf("parsing of invalid reference file did not find any errors")
}
}