Skip to content

Commit

Permalink
tests: Skip kmod tests when secure boot is enabled
Browse files Browse the repository at this point in the history
Kernel lockdown blocks loading unsigned kernel modules, so these tests need to
be disabled. Eventually the zfs sysext should ship a signed kernel modules, but
falco is built on the running system and won't work the same way. Falco
suggests running in eBPF mode instead.
  • Loading branch information
jepio committed Sep 10, 2024
1 parent c1dbf61 commit d7b7a14
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
7 changes: 7 additions & 0 deletions kola/harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,13 @@ var (
}
)

func SkipSecureboot(_ semver.Version, channel, arch, platform string) bool {
if Options.EnableSecureboot {
return true
}
return false
}

// NativeRunner is a closure passed to all kola test functions and used
// to run native go functions directly on kola machines. It is necessary
// glue until kola does introspection.
Expand Down
4 changes: 3 additions & 1 deletion kola/tests/misc/falco.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package misc

import (
"github.com/flatcar/mantle/kola"
"github.com/flatcar/mantle/kola/cluster"
"github.com/flatcar/mantle/kola/register"
)
Expand All @@ -16,7 +17,8 @@ func init() {
// falco builder container can't handle our arm64 config (yet)
Architectures: []string{"amd64"},
// selinux blocks insmod from within container
Flags: []register.Flag{register.NoEnableSelinux},
Flags: []register.Flag{register.NoEnableSelinux},
SkipFunc: kola.SkipSecureboot,
})
}

Expand Down
17 changes: 14 additions & 3 deletions kola/tests/sysext/zfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net/http"

"github.com/coreos/go-semver/semver"
"github.com/flatcar/mantle/kola"
"github.com/flatcar/mantle/kola/cluster"
"github.com/flatcar/mantle/kola/register"
"github.com/flatcar/mantle/platform"
Expand Down Expand Up @@ -133,7 +134,7 @@ func init() {
// This test is normally not related to the cloud environment
Platforms: []string{"qemu", "qemu-unpriv"},
MinVersion: semver.Version{Major: 3902},
SkipFunc: skipOnGha,
SkipFunc: skipZfs,
})

register.Register(&register.Test{
Expand All @@ -144,7 +145,7 @@ func init() {
// This test is normally not related to the cloud environment
Platforms: []string{"qemu", "qemu-unpriv"},
MinVersion: semver.Version{Major: 3902},
SkipFunc: skipOnGha,
SkipFunc: skipZfs,
})

register.Register(&register.Test{
Expand All @@ -155,10 +156,20 @@ func init() {
// This test is normally not related to the cloud environment
Platforms: []string{"qemu", "qemu-unpriv"},
MinVersion: semver.Version{Major: 3902},
SkipFunc: skipOnGha,
SkipFunc: skipZfs,
})
}

func skipZfs(version semver.Version, channel, arch, platform string) bool {
if kola.SkipSecureboot(version, channel, arch, platform) {
return true
}
if skipOnGha(version, channel, arch, platform) {
return true
}
return false
}

func skipOnGha(version semver.Version, channel, arch, platform string) bool {
// Skip for release tests as we don't yet have a sysext signed with the
// prod key, nor is it on the release server.
Expand Down

0 comments on commit d7b7a14

Please sign in to comment.