Fix tests

This commit is contained in:
Johannes 'fish' Ziemke 2014-07-04 18:44:51 +02:00
parent eb17b5fc9d
commit 7cb4c0edb6

View file

@ -9,8 +9,8 @@ import (
const ( const (
loadExpected = 0.21 loadExpected = 0.21
memTotalExpected = "3742148" memTotalExpected = 3831959552
memDirectMap2MExpected = "3698688" memDirectMap2MExpected = 3787456512
interruptsNmi1Expected = "5031" interruptsNmi1Expected = "5031"
@ -51,11 +51,11 @@ func TestMemInfo(t *testing.T) {
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
if memInfo["MemTotal_kB"] != memTotalExpected { if memInfo["MemTotal"] != memTotalExpected {
t.Fatalf("Unexpected memory: %s != %s", memInfo["MemTotal_kB"], memTotalExpected) t.Fatalf("Unexpected memory: %s != %s", memInfo["MemTotal"], memTotalExpected)
} }
if memInfo["DirectMap2M_kB"] != memDirectMap2MExpected { if memInfo["DirectMap2M"] != memDirectMap2MExpected {
t.Fatalf("Unexpected memory: %s != %s", memInfo["MemTotal_kB"], memTotalExpected) t.Fatalf("Unexpected memory: %s != %s", memInfo["MemTotal"], memTotalExpected)
} }
} }
@ -105,14 +105,13 @@ func TestDiskStats(t *testing.T) {
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
if diskStats["sda4"][0] != diskSda4ReadsCompleted {
if diskStats["sda4"]["reads_completed"] != diskSda4ReadsCompleted { t.Fatalf("Unexpected diskstats: %s != %s", diskStats["sda4"][0],
t.Fatalf("Unexpected diskstats: %s != %s", diskStats["sda4"]["reads_completed"],
diskSda4ReadsCompleted) diskSda4ReadsCompleted)
} }
if diskStats["mmcblk0p2"]["io_time_weighted"] != diskMmcIoTimeWeighted { if diskStats["mmcblk0p2"][10] != diskMmcIoTimeWeighted {
t.Fatalf("Unexpected diskstats: %s != %s", t.Fatalf("Unexpected diskstats: %s != %s",
diskStats["mmcblk0p2"]["io_time_weighted"], diskMmcIoTimeWeighted) diskStats["mmcblk0p2"][10], diskMmcIoTimeWeighted)
} }
} }