mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 11:13:48 +00:00
Skip AppArmor tests on unsupported distros
This commit is contained in:
parent
c0ecd93801
commit
3d05080982
@ -32,8 +32,11 @@ const (
|
|||||||
appArmorDeniedPath = "/expect_permission_denied"
|
appArmorDeniedPath = "/expect_permission_denied"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// AppArmorDistros are distros with AppArmor support
|
||||||
|
var AppArmorDistros = []string{"gci", "ubuntu"}
|
||||||
|
|
||||||
func SkipIfAppArmorNotSupported() {
|
func SkipIfAppArmorNotSupported() {
|
||||||
framework.SkipUnlessNodeOSDistroIs("gci", "ubuntu")
|
framework.SkipUnlessNodeOSDistroIs(AppArmorDistros...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func LoadAppArmorProfiles(f *framework.Framework) {
|
func LoadAppArmorProfiles(f *framework.Framework) {
|
||||||
|
@ -34,9 +34,22 @@ type AppArmorUpgradeTest struct {
|
|||||||
|
|
||||||
func (AppArmorUpgradeTest) Name() string { return "apparmor-upgrade" }
|
func (AppArmorUpgradeTest) Name() string { return "apparmor-upgrade" }
|
||||||
|
|
||||||
|
func (AppArmorUpgradeTest) Skip(upgCtx UpgradeContext) bool {
|
||||||
|
var supportedImages map[string]bool
|
||||||
|
for _, d := range common.AppArmorDistros {
|
||||||
|
supportedImages[d] = true
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, vCtx := range upgCtx.Versions {
|
||||||
|
if !supportedImages[vCtx.NodeImage] {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
// Setup creates a secret and then verifies that a pod can consume it.
|
// Setup creates a secret and then verifies that a pod can consume it.
|
||||||
func (t *AppArmorUpgradeTest) Setup(f *framework.Framework) {
|
func (t *AppArmorUpgradeTest) Setup(f *framework.Framework) {
|
||||||
common.SkipIfAppArmorNotSupported()
|
|
||||||
By("Loading AppArmor profiles to nodes")
|
By("Loading AppArmor profiles to nodes")
|
||||||
common.LoadAppArmorProfiles(f)
|
common.LoadAppArmorProfiles(f)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user