github.com/mvdan/u-root-coreutils@v0.0.0-20230122170626-c2eef2898555/pkg/acpi/linux_test.go (about)

     1  // Copyright 2019 the u-root Authors. All rights reserved
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build linux
     6  // +build linux
     7  
     8  package acpi
     9  
    10  import (
    11  	"os"
    12  	"testing"
    13  )
    14  
    15  // TestLinux just verifies that tables read OK.
    16  // It does not verify content as content varies all
    17  // the time.
    18  func TestLinux(t *testing.T) {
    19  	if os.Getuid() != 0 {
    20  		t.Skip("not root")
    21  	}
    22  	tab, err := RawTablesFromSys()
    23  	if err != nil {
    24  		t.Fatalf("Got %v, want nil", err)
    25  	}
    26  	for _, tt := range tab {
    27  		t.Logf("table %s", String(tt))
    28  	}
    29  }