Skip to content

Commit a85efe9

Browse files
committed
kola: add support for tests with Secure Boot enabled
Add a new kola tag to configure qemu with Secure Boot enabled Fixes: #4112
1 parent e7b71cf commit a85efe9

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

mantle/kola/harness.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ const snoozeFormat = "2006-01-02"
100100
// This overlaps with SkipBaseChecksTag above, but is really a special flag for kola-denylist.yaml.
101101
const SkipConsoleWarningsTag = "skip-console-warnings"
102102

103+
// NeedsSecureBoot will setup the machines with uefi with secure boot enabled on supported platforms
104+
const secureBoot = "secure-boot"
105+
103106
var (
104107
plog = capnslog.NewPackageLogger("github.com/coreos/coreos-assembler/mantle", "kola")
105108

@@ -338,6 +341,10 @@ func testRequiresInternet(test *register.Test) bool {
338341
return HasString(NeedsInternetTag, test.Tags)
339342
}
340343

344+
func testSecureBoot(test *register.Test) bool {
345+
return HasString(secureBoot, test.Tags)
346+
}
347+
341348
func markTestForRerunSuccess(test *register.Test, msg string) {
342349
if !HasString(AllowRerunSuccessTag, test.Tags) {
343350
plog.Warningf("%s Adding as candidate for rerun success: %s", msg, test.Name)
@@ -1759,6 +1766,10 @@ func runTest(h *harness.H, t *register.Test, pltfrm string, flight platform.Flig
17591766
SkipStartMachine: true,
17601767
}
17611768

1769+
if testSecureBoot(t) {
1770+
options.Firmware = "uefi-secure"
1771+
}
1772+
17621773
// Providers sometimes fail to bring up a machine within a
17631774
// reasonable time frame. Let's try twice and then bail if
17641775
// it doesn't work.

mantle/platform/machine/qemu/cluster.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ func (qc *Cluster) NewMachine(userdata *conf.UserData) (platform.Machine, error)
5151
func (qc *Cluster) NewMachineWithOptions(userdata *conf.UserData, options platform.MachineOptions) (platform.Machine, error) {
5252
return qc.NewMachineWithQemuOptions(userdata, platform.QemuMachineOptions{
5353
MachineOptions: options,
54+
Firmware: options.Firmware,
5455
})
5556
}
5657

mantle/platform/platform.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ type MachineOptions struct {
163163
AppendKernelArgs string
164164
AppendFirstbootKernelArgs string
165165
SkipStartMachine bool // Skip platform.StartMachine on machine bringup
166+
Firmware string
166167
}
167168

168169
// SystemdDropin is a userdata type agnostic struct representing a systemd dropin

0 commit comments

Comments
 (0)