Skip to content

Commit

Permalink
Remove the apparmor e2e test from test suite since is covered by hack…
Browse files Browse the repository at this point in the history
…/ci/e2e-apparmor test

Change-Id: I6e0df97860c205b97cd67a1545237e895c523b04
Signed-off-by: Cosmin Cojocar <[email protected]>
  • Loading branch information
ccojocar authored and k8s-ci-robot committed Dec 3, 2024
1 parent aae2e0e commit ce7b9ac
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 190 deletions.
5 changes: 2 additions & 3 deletions hack/ci/e2e-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ set -euo pipefail
export E2E_CLUSTER_TYPE=vanilla
export E2E_TEST_LOG_ENRICHER=true
export E2E_TEST_SECCOMP=false
export E2E_TEST_APPARMOR=true
export E2E_TEST_FLAKY_TESTS_ONLY=${E2E_TEST_FLAKY_TESTS_ONLY:-false}

if "${E2E_TEST_FLAKY_TESTS_ONLY}"; then
make test-flaky-e2e
make test-flaky-e2e
else
make test-e2e
make test-e2e
fi
4 changes: 0 additions & 4 deletions test/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ func (e *e2e) TestSecurityProfilesOperator() {
"SELinux: Metrics (update, delete)",
e.testCaseSelinuxMetrics,
},
{
"AppArmor: base case (install policy, run pod and delete)",
e.testCaseAppArmorBaseUsage,
},
{
"SPOD: Update SELinux flag",
e.testCaseSPODUpdateSelinux,
Expand Down
28 changes: 0 additions & 28 deletions test/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ var (
envSkipFlakyTests = os.Getenv("E2E_SKIP_FLAKY_TESTS")
envSkipNamespacedTests = os.Getenv("E2E_SKIP_NAMESPACED_TESTS")
envSelinuxTestsEnabled = os.Getenv("E2E_TEST_SELINUX")
envApparmorTestsEnabled = os.Getenv("E2E_TEST_APPARMOR")
envLogEnricherTestsEnabled = os.Getenv("E2E_TEST_LOG_ENRICHER")
envSeccompTestsEnabled = os.Getenv("E2E_TEST_SECCOMP")
envBpfRecorderTestsEnabled = os.Getenv("E2E_TEST_BPF_RECORDER")
Expand Down Expand Up @@ -99,7 +98,6 @@ type e2e struct {
nodeRootfsPrefix string
operatorManifest string
selinuxEnabled bool
apparmorEnabled bool
logEnricherEnabled bool
testSeccomp bool
bpfRecorderEnabled bool
Expand Down Expand Up @@ -150,10 +148,6 @@ func TestSuite(t *testing.T) {
if err != nil {
selinuxEnabled = false
}
apparmorEnabled, err := strconv.ParseBool(envApparmorTestsEnabled)
if err != nil {
apparmorEnabled = false
}
logEnricherEnabled, err := strconv.ParseBool(envLogEnricherTestsEnabled)
if err != nil {
logEnricherEnabled = false
Expand Down Expand Up @@ -215,7 +209,6 @@ func TestSuite(t *testing.T) {
containerRuntime: containerRuntime,
nodeRootfsPrefix: nodeRootfsPrefix,
selinuxEnabled: selinuxEnabled,
apparmorEnabled: apparmorEnabled,
logEnricherEnabled: logEnricherEnabled,
testSeccomp: testSeccomp,
selinuxdImage: selinuxdImage,
Expand Down Expand Up @@ -249,7 +242,6 @@ func TestSuite(t *testing.T) {
containerRuntime: containerRuntime,
nodeRootfsPrefix: nodeRootfsPrefix,
selinuxEnabled: selinuxEnabled,
apparmorEnabled: apparmorEnabled,
logEnricherEnabled: logEnricherEnabled,
testSeccomp: testSeccomp,
selinuxdImage: selinuxdImage,
Expand Down Expand Up @@ -277,7 +269,6 @@ func TestSuite(t *testing.T) {
containerRuntime: containerRuntime,
nodeRootfsPrefix: nodeRootfsPrefix,
selinuxEnabled: selinuxEnabled,
apparmorEnabled: apparmorEnabled,
logEnricherEnabled: logEnricherEnabled,
testSeccomp: testSeccomp,
selinuxdImage: selinuxdImage,
Expand Down Expand Up @@ -710,13 +701,6 @@ func (e *e2e) selinuxOnlyTestCase() {
e.enableSelinuxInSpod()
}

func (e *e2e) apparmorOnlyTestCase() {
if !e.apparmorEnabled {
e.T().Skip("Skipping AppArmor-related test")
}
e.enableApparmorInSpod()
}

func (e *e2e) enableSelinuxInSpod() {
selinuxEnabledInSPODDS := e.kubectlOperatorNS("get", "ds", "spod", "-o", "yaml")
if !strings.Contains(selinuxEnabledInSPODDS, "--with-selinux=true") {
Expand All @@ -733,18 +717,6 @@ func (e *e2e) enableSelinuxInSpod() {
}
}

func (e *e2e) enableApparmorInSpod() {
apparmorEnabledInSPODDS := e.kubectlOperatorNS("get", "ds", "spod", "-o", "yaml")
if !strings.Contains(apparmorEnabledInSPODDS, "--with-apparmor=true") {
e.logf("Enable AppArmor in SPOD")
e.kubectlOperatorNS("patch", "spod", "spod", "-p", `{"spec":{"enableAppArmor": true}}`, "--type=merge")
time.Sleep(defaultWaitTime)
e.waitInOperatorNSFor("condition=ready", "spod", "spod")

e.kubectlOperatorNS("rollout", "status", "ds", "spod", "--timeout", defaultSelinuxOpTimeout)
}
}

func (e *e2e) logEnricherOnlyTestCase() {
if !e.logEnricherEnabled {
e.T().Skip("Skipping log-enricher related test")
Expand Down
155 changes: 0 additions & 155 deletions test/tc_apparmor_base_usage_test.go

This file was deleted.

0 comments on commit ce7b9ac

Please sign in to comment.