Skip to content

Commit

Permalink
If windows node then TestAntreaPolicy will be skipped
Browse files Browse the repository at this point in the history
Skip TestFQDNCacheMinTTL if cluster has Windows Nodes

The TestFQDNCacheMinTTL e2e test currently does not support Windows.
We skip it if any Node in the test cluster is a Windows Node, which is also
consistent with other AntreaPolicy e2e tests.

Skip TestFQDNCacheMinTTL if cluster has Windows Nodes. Fixes #6891

Skip TestFQDNCacheMinTTL if cluster has Windows Nodes. Fixes #6891 The TestFQDNCacheMinTTL e2e test currently does not support Windows. We skip it if any Node in the test cluster is a Windows Node, which is also consistent with other AntreaPolicy e2e tests.

As @antoninbas suggested, I have relocated the skipX condition to the beginning of TestFQDNCacheMinTTL. Now, the skip condition will execute before any subset of TestFQDNCacheMinTTL, making testWithFQDNCacheMinTTL shorter and possibly more efficient.

remove an line from antreapolicy_test.go
  • Loading branch information
devc007 committed Jan 13, 2025
1 parent 357d38f commit 683bace
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions test/e2e/antreapolicy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5303,6 +5303,12 @@ func testAntreaClusterNetworkPolicyStats(t *testing.T, data *TestData) {
// by TestFQDNCacheMinTTL with 2 fqdnCacheMinTTL values where `0` represents a default value
// when fqdnCacheMinTTL is unset .
func TestFQDNCacheMinTTL(t *testing.T) {
skipIfAntreaPolicyDisabled(t)
skipIfHasWindowsNodes(t)
skipIfNotIPv4Cluster(t)
skipIfIPv6Cluster(t)
skipIfNotRequired(t, "mode-irrelevant")

t.Run("minTTLUnset", func(t *testing.T) { testWithFQDNCacheMinTTL(t, 0) })
t.Run("minTTL20s", func(t *testing.T) { testWithFQDNCacheMinTTL(t, 20) })
}
Expand All @@ -5314,11 +5320,6 @@ func testWithFQDNCacheMinTTL(t *testing.T, fqdnCacheMinTTL int) {
dnsTTL = 5
)

skipIfAntreaPolicyDisabled(t)
skipIfNotIPv4Cluster(t)
skipIfIPv6Cluster(t)
skipIfNotRequired(t, "mode-irrelevant")

data, err := setupTest(t)
if err != nil {
t.Fatalf("Error when setting up test: %v", err)
Expand Down

0 comments on commit 683bace

Please sign in to comment.