Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
kola/tests: add test for MachineID
Browse files Browse the repository at this point in the history
Fixes #568
  • Loading branch information
arithx committed Feb 2, 2018
1 parent 8ed0065 commit 79e2136
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions kola/tests/coretest/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func init() {
"ReadOnly": TestReadOnlyFs,
"RandomUUID": TestFsRandomUUID,
"Useradd": TestUseradd,
"MachineID": TestMachineID,
},
})
register.Register(&register.Test{
Expand Down Expand Up @@ -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
}

0 comments on commit 79e2136

Please sign in to comment.