gitee.com/mirrors_u-root/u-root@v7.0.0+incompatible/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  // +build linux
     6  
     7  package acpi
     8  
     9  import (
    10  	"os"
    11  	"testing"
    12  )
    13  
    14  // TestLinux just verifies that tables read OK.
    15  // It does not verify content as content varies all
    16  // the time.
    17  func TestLinux(t *testing.T) {
    18  	if os.Getuid() != 0 {
    19  		t.Skip("not root")
    20  	}
    21  	tab, err := RawTablesFromSys()
    22  	if err != nil {
    23  		t.Fatalf("Got %v, want nil", err)
    24  	}
    25  	for _, tt := range tab {
    26  		t.Logf("table %s", String(tt))
    27  	}
    28  }