File: attribute_test.go

package info (click to toggle)
golang-github-ungerik-go-sysfs 0.0~git20210209.68e6f4d-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 92 kB
  • sloc: makefile: 2
file content (29 lines) | stat: -rw-r--r-- 509 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package sysfs

import (
	"testing"
)

func TestCPU(t *testing.T) {

	online := Devices.Object("system").SubObject("cpu").Attribute("online")
	s, err := online.Read()

	// cpu0 := Devices.Object("system").SubObject("cpu").SubObject("cpu0")
	// if !cpu0.Exists() {
	// 	t.Fail()
	// }

	// bios_limit := cpu0.SubObject("power").Attribute("control")
	// if !bios_limit.Exists() {
	// 	t.Fail()
	// }

	// s, err := bios_limit.Read()
	if err != nil {
		t.Fatal(err)
	}
	if s == "" {
		t.Fatal("No value in")
	}
}