Files
go-linux-lowlevel-hw/pkg/hwapi/e820_test.go
Christopher Meis e1381eccc3 Rework of api:
* Remove functions from API:
	IsReservedInE820, UsableMemoryAbove4G, UsableMemoryBelow4G

* Keep them as convenience functions in package

* Adapt test
Signed-off-by: Christopher Meis <christopher.meis@9elements.com>
2021-10-06 11:15:42 +02:00

31 lines
522 B
Go

package hwapi
import (
"os"
"testing"
)
func TestE820ReservedCheck(t *testing.T) {
h := GetAPI()
if os.Getenv("RUN_IN_QEMU") != "TRUE" {
t.Skip("Not running on QEMU")
}
ranges := []struct {
start uint64
end uint64
}{
{0xf0000, 0xfffff},
{0xfffc0000, 0xffffffff},
}
for _, s := range ranges {
reserved, err := IsReservedInE820(h, s.start, s.end)
if err != nil {
t.Errorf("Checking range %x-%x failed: %s", s.start, s.end, err)
}
t.Logf("range %x-%x: %t", s.start, s.end, reserved)
}
}