diff --git a/kola/tests/coretest/core.go b/kola/tests/coretest/core.go index 4f4e20d53..b80632939 100644 --- a/kola/tests/coretest/core.go +++ b/kola/tests/coretest/core.go @@ -41,6 +41,7 @@ func init() { "ReadOnly": TestReadOnlyFs, "RandomUUID": TestFsRandomUUID, "Useradd": TestUseradd, + "MachineID": TestMachineID, }, }) register.Register(®ister.Test{ @@ -337,3 +338,12 @@ func TestUseradd() error { return nil } + +// Test that /etc/machine-id isn't empty or COREOS_BLANK_MACHINE_ID +func TestMachineID() error { + id := MachineID() + if id == "" || id == "COREOS_BLANK_MACHINE_ID" { + return fmt.Errorf("machine-id is %s", id) + } + return nil +}