github.com/mvdan/u-root-coreutils@v0.0.0-20230122170626-c2eef2898555/pkg/acpi/rsdp_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  package acpi
     6  
     7  import (
     8  	"runtime"
     9  	"testing"
    10  
    11  	"github.com/mvdan/u-root-coreutils/pkg/testutil"
    12  )
    13  
    14  // TestRSDP tests whether any method for getting an RSDP works.
    15  func TestRSDP(t *testing.T) {
    16  	testutil.SkipIfNotRoot(t)
    17  
    18  	// Our QEMU aarch64 does not boot via UEFI, so RSDP only works on x86.
    19  	if runtime.GOARCH != "amd64" {
    20  		t.Skip("RSDP in QEMU only available on amd64 for now")
    21  	}
    22  
    23  	_, err := GetRSDP()
    24  	if err != nil {
    25  		t.Fatalf("GetRSDP: got %v, want nil", err)
    26  	}
    27  }