mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-11-27 02:53:02 +01:00
24 lines
388 B
Go
24 lines
388 B
Go
package collector
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func TestInterrupts(t *testing.T) {
|
|
file, err := os.Open("fixtures/interrupts")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
defer file.Close()
|
|
|
|
interrupts, err := parseInterrupts(file)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
if want, got := "5031", interrupts["NMI"].values[1]; want != got {
|
|
t.Errorf("want interrupts %s, got %s", want, got)
|
|
}
|
|
}
|