mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-12-28 23:19:46 -08:00
Add additional test for mdadm_linux collector
This commit is contained in:
parent
a09bbaacd1
commit
8c809cd29a
5
collector/fixtures/proc/mdstat_invalid
Normal file
5
collector/fixtures/proc/mdstat_invalid
Normal file
|
@ -0,0 +1,5 @@
|
|||
Personalities : [invalid]
|
||||
md3 : invalid
|
||||
314159265 blocks 64k chunks
|
||||
|
||||
unused devices: <none>
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue