...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package sysfs
18
19 import (
20 "reflect"
21 "testing"
22
23 "github.com/prometheus/procfs/internal/util"
24 )
25
26 func TestClassThermalZoneStats(t *testing.T) {
27 fs, err := NewFS(sysTestFixtures)
28 if err != nil {
29 t.Fatal(err)
30 }
31
32 thermalTest, err := fs.ClassThermalZoneStats()
33 if err != nil {
34 t.Fatal(err)
35 }
36
37 enabled := util.ParseBool("enabled")
38 passive := uint64(0)
39
40 classThermalZoneStats := []ClassThermalZoneStats{
41 {
42 Name: "0",
43 Type: "bcm2835_thermal",
44 Policy: "step_wise",
45 Temp: 49925,
46 Mode: nil,
47 Passive: nil,
48 },
49 {
50 Name: "1",
51 Type: "acpitz",
52 Policy: "step_wise",
53 Temp: -44000,
54 Mode: enabled,
55 Passive: &passive,
56 },
57 }
58
59 if !reflect.DeepEqual(classThermalZoneStats, thermalTest) {
60 t.Errorf("Result not correct: want %v, have %v", classThermalZoneStats, thermalTest)
61 }
62 }
63
View as plain text