Skip to content

Commit

Permalink
tests: Only check the worker nodes testCaseLongSeccompProfileName
Browse files Browse the repository at this point in the history
The test testCaseLongSeccompProfileName was written with assumption that
the profile being tested is only deployed on worker nodes, probably
because the upstream test platforms only schedule spod there.

On clusters where spod is scheduled on all nodes (OCP), this assumption
breaks and the test would list node statuses of both controlplane and
worker nodes but compare that with the number of workers only.

Let's list nodestatuses on worker nodes only to work around that issue.
  • Loading branch information
jhrozek authored and k8s-ci-robot committed Sep 12, 2022
1 parent 7cd33c2 commit 3c7557b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/tc_long_profile_name_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package e2e_test
import (
"encoding/json"
"fmt"
"strings"
"time"

secprofnodestatusv1alpha1 "sigs.k8s.io/security-profiles-operator/api/secprofnodestatus/v1alpha1"
Expand Down Expand Up @@ -49,7 +50,9 @@ func (e *e2e) testCaseLongSeccompProfileName(nodes []string) {
e.logf("List all node statuses for policy by ID")
id := e.getSeccompPolicyID(policyName)
namespace := e.getCurrentContextNamespace(defaultNamespace)
selector := fmt.Sprintf("spo.x-k8s.io/profile-id=%s", id)
selector := fmt.Sprintf(
"spo.x-k8s.io/profile-id in (%s),spo.x-k8s.io/node-name in (%s)",
id, strings.Join(nodes, ","))

const maxTries = 10
for i := 0; i < maxTries; i++ {
Expand Down

0 comments on commit 3c7557b

Please sign in to comment.