mirror of https://github.com/ericonr/sbctl.git
tests: Add secureboot enabled test
Signed-off-by: Morten Linderud <morten@linderud.pw>
This commit is contained in:
parent
95170e5117
commit
683afec1d7
|
@ -14,10 +14,16 @@ import (
|
|||
func TestKeyEnrollment(t *testing.T) {
|
||||
conf := utils.NewConfig()
|
||||
conf.AddFile("sbctl")
|
||||
|
||||
utils.WithVM(conf,
|
||||
func(vm *utils.TestVM) {
|
||||
t.Run("Enroll Keys", vm.RunTest("./integrations/enroll_keys_test.go"))
|
||||
})
|
||||
|
||||
utils.WithVM(conf,
|
||||
func(vm *utils.TestVM) {
|
||||
t.Run("Check SecureBoot enabled", vm.RunTest("./integrations/secure_boot_enabled_test.go"))
|
||||
})
|
||||
}
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/foxboron/go-uefi/efi"
|
||||
"github.com/foxboron/sbctl/tests/utils"
|
||||
)
|
||||
|
||||
func TestSecureBootEnabled(t *testing.T) {
|
||||
|
||||
utils.Exec("/mnt/sbctl status")
|
||||
|
||||
if !efi.GetSecureBoot() {
|
||||
t.Fatal("not in secure boot mode")
|
||||
}
|
||||
|
||||
if efi.GetSetupMode() {
|
||||
t.Fatal("in setup mode")
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue