Commit 52409d0 1 parent ebe4714 commit 52409d0 Copy full SHA for 52409d0
File tree 1 file changed +25
-6
lines changed
1 file changed +25
-6
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ func TestCPUUsage(t *testing.T) {
38
38
require .EqualValues (t , output , res )
39
39
}
40
40
41
- func TestCPUTemp (t * testing.T ) {
41
+ func TestCPUTemp_Intel (t * testing.T ) {
42
42
input := `
43
43
coretemp-isa-0000
44
44
Adapter: ISA adapter
@@ -57,10 +57,6 @@ func TestCPUTemp(t *testing.T) {
57
57
pch_cannonlake-virtual-0
58
58
Adapter: Virtual device
59
59
temp1: +37.0°C
60
-
61
- k10temp-pci-00c3
62
- Adapter: PCI adapter
63
- Tctl: +39.6°C
64
60
`
65
61
output := & entity.Payload {
66
62
State : "99.0" ,
@@ -72,7 +68,30 @@ func TestCPUTemp(t *testing.T) {
72
68
"core_4" : "38.0" ,
73
69
"core_5" : "39.0" ,
74
70
"temp_1" : "37.0" ,
75
- "Tctl" : "39.6" ,
71
+ },
72
+ }
73
+
74
+ c := NewCPUTemp (entity.Meta {"celsius" : true })
75
+
76
+ res , err := c .process (input )
77
+ require .NoError (t , err )
78
+ require .EqualValues (t , output , res )
79
+ }
80
+
81
+ func TestCPUTemp_AMD (t * testing.T ) {
82
+ input := `
83
+ k10temp-pci-00c3
84
+ Adapter: PCI adapter
85
+ Tctl: +39.6°C
86
+
87
+ acpitz-acpi-0
88
+ Adapter: ACPI interface
89
+ temp1: +27.8°C (crit = +119.0°C)
90
+ `
91
+ output := & entity.Payload {
92
+ State : "39.6" ,
93
+ Attributes : map [string ]interface {}{
94
+ "temp_1" : "27.8" ,
76
95
},
77
96
}
78
97
You can’t perform that action at this time.
0 commit comments