Skip to content

Commit bf6319e

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 592d922 commit bf6319e

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

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)
@@ -1762,6 +1769,10 @@ func runTest(h *harness.H, t *register.Test, pltfrm string, flight platform.Flig
17621769
InstanceType: t.InstanceType,
17631770
}
17641771

1772+
if testSecureBoot(t) {
1773+
options.Firmware = "uefi-secure"
1774+
}
1775+
17651776
// Providers sometimes fail to bring up a machine within a
17661777
// reasonable time frame. Let's try twice and then bail if
17671778
// it doesn't work.

mantle/platform/machine/qemu/cluster.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ func (qc *Cluster) NewMachineWithOptions(userdata *conf.UserData, options platfo
5454
}
5555
return qc.NewMachineWithQemuOptions(userdata, platform.QemuMachineOptions{
5656
MachineOptions: options,
57+
Firmware: options.Firmware,
5758
})
5859
}
5960

mantle/platform/platform.go

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

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

0 commit comments

Comments
 (0)