From f9f115f42314ed52e6548b49f518976979c84cea Mon Sep 17 00:00:00 2001 From: Michael Montgomery Date: Tue, 28 Mar 2023 09:48:19 -0500 Subject: [PATCH 1/2] Remove disabling of agent e2e tests because of 6331. Signed-off-by: Michael Montgomery --- test/e2e/agent/config_test.go | 7 +++++-- test/e2e/agent/recipes_test.go | 18 +++++++++++++++--- test/e2e/agent/tls_test.go | 8 +++++--- test/e2e/agent/upgrade_test.go | 14 ++++++++++++-- 4 files changed, 37 insertions(+), 10 deletions(-) diff --git a/test/e2e/agent/config_test.go b/test/e2e/agent/config_test.go index 125452e64f..e0050598ba 100644 --- a/test/e2e/agent/config_test.go +++ b/test/e2e/agent/config_test.go @@ -124,10 +124,13 @@ func TestMultipleOutputConfig(t *testing.T) { } func TestFleetMode(t *testing.T) { + v := version.MustParse(test.Ctx().ElasticStackVersion) - test.SkipUntilResolution(t, 6331) + // https://github.com/elastic/cloud-on-k8s/issues/6331 + if v.LT(version.MinFor(8, 8, 0)) && v.GE(version.MinFor(8, 6, 0)) { + t.SkipNow() + } - v := version.MustParse(test.Ctx().ElasticStackVersion) // installation of policies and integrations through Kibana file based configuration was broken between those versions: if v.LT(version.MinFor(8, 1, 0)) && v.GTE(version.MinFor(8, 0, 0)) { t.SkipNow() diff --git a/test/e2e/agent/recipes_test.go b/test/e2e/agent/recipes_test.go index a6de84b295..69c190ddd4 100644 --- a/test/e2e/agent/recipes_test.go +++ b/test/e2e/agent/recipes_test.go @@ -88,8 +88,12 @@ func TestMultiOutputRecipe(t *testing.T) { } func TestFleetKubernetesIntegrationRecipe(t *testing.T) { + v := version.MustParse(test.Ctx().ElasticStackVersion) - test.SkipUntilResolution(t, 6331) + // https://github.com/elastic/cloud-on-k8s/issues/6331 + if v.LT(version.MinFor(8, 8, 0)) && v.GE(version.MinFor(8, 6, 0)) { + t.SkipNow() + } customize := func(builder agent.Builder) agent.Builder { if !builder.Agent.Spec.FleetServerEnabled { @@ -133,8 +137,12 @@ func TestFleetKubernetesIntegrationRecipe(t *testing.T) { } func TestFleetCustomLogsIntegrationRecipe(t *testing.T) { + v := version.MustParse(test.Ctx().ElasticStackVersion) - test.SkipUntilResolution(t, 6331) + // https://github.com/elastic/cloud-on-k8s/issues/6331 + if v.LT(version.MinFor(8, 8, 0)) && v.GE(version.MinFor(8, 6, 0)) { + t.SkipNow() + } notLoggingPod := beat.NewPodBuilder("test") loggingPod := beat.NewPodBuilder("test") @@ -162,8 +170,12 @@ func TestFleetCustomLogsIntegrationRecipe(t *testing.T) { } func TestFleetAPMIntegrationRecipe(t *testing.T) { + v := version.MustParse(test.Ctx().ElasticStackVersion) - test.SkipUntilResolution(t, 6331) + // https://github.com/elastic/cloud-on-k8s/issues/6331 + if v.LT(version.MinFor(8, 8, 0)) && v.GE(version.MinFor(8, 6, 0)) { + t.SkipNow() + } customize := func(builder agent.Builder) agent.Builder { if !builder.Agent.Spec.FleetServerEnabled { diff --git a/test/e2e/agent/tls_test.go b/test/e2e/agent/tls_test.go index c1bebbdc36..5e7e38d080 100644 --- a/test/e2e/agent/tls_test.go +++ b/test/e2e/agent/tls_test.go @@ -18,11 +18,13 @@ import ( // TestFleetAgentWithoutTLS tests a Fleet Server, and Elastic Agent with TLS disabled for the HTTP layer. func TestFleetAgentWithoutTLS(t *testing.T) { - - test.SkipUntilResolution(t, 6331) - v := version.MustParse(test.Ctx().ElasticStackVersion) + // https://github.com/elastic/cloud-on-k8s/issues/6331 + if v.LT(version.MinFor(8, 8, 0)) && v.GE(version.MinFor(8, 6, 0)) { + t.SkipNow() + } + // Disabling TLS for Fleet isn't supported before 7.16, as Elasticsearch doesn't allow // api keys to be enabled when TLS is disabled. if v.LT(version.MustParse("7.16.0")) { diff --git a/test/e2e/agent/upgrade_test.go b/test/e2e/agent/upgrade_test.go index 4072543146..2c2598b1c8 100644 --- a/test/e2e/agent/upgrade_test.go +++ b/test/e2e/agent/upgrade_test.go @@ -9,6 +9,7 @@ package agent import ( "testing" + "github.com/elastic/cloud-on-k8s/v2/pkg/controller/common/version" "github.com/elastic/cloud-on-k8s/v2/test/e2e/test" "github.com/elastic/cloud-on-k8s/v2/test/e2e/test/agent" "github.com/elastic/cloud-on-k8s/v2/test/e2e/test/elasticsearch" @@ -17,12 +18,21 @@ import ( func TestAgentVersionUpgradeToLatest8x(t *testing.T) { - test.SkipUntilResolution(t, 6331) - srcVersion, dstVersion := test.GetUpgradePathTo8x(test.Ctx().ElasticStackVersion) test.SkipInvalidUpgrade(t, srcVersion, dstVersion) + sv := version.MustParse(srcVersion) + dv := version.MustParse(dstVersion) + + // https://github.com/elastic/cloud-on-k8s/issues/6331 + if sv.LT(version.MinFor(8, 8, 0)) && sv.GE(version.MinFor(8, 6, 0)) { + t.SkipNow() + } + if dv.LT(version.MinFor(8, 8, 0)) && dv.GE(version.MinFor(8, 6, 0)) { + t.SkipNow() + } + name := "test-agent-upgrade" esBuilder := elasticsearch.NewBuilder(name). WithVersion(srcVersion). From 22d329badbf5bcee470a4b40503646f03f391bfc Mon Sep 17 00:00:00 2001 From: Michael Montgomery Date: Tue, 28 Mar 2023 14:41:29 -0500 Subject: [PATCH 2/2] Adjust 8.8.0 => 8.7.0 for test. Signed-off-by: Michael Montgomery --- test/e2e/agent/config_test.go | 2 +- test/e2e/agent/recipes_test.go | 6 +++--- test/e2e/agent/tls_test.go | 2 +- test/e2e/agent/upgrade_test.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/e2e/agent/config_test.go b/test/e2e/agent/config_test.go index e0050598ba..d88fe4d72a 100644 --- a/test/e2e/agent/config_test.go +++ b/test/e2e/agent/config_test.go @@ -127,7 +127,7 @@ func TestFleetMode(t *testing.T) { v := version.MustParse(test.Ctx().ElasticStackVersion) // https://github.com/elastic/cloud-on-k8s/issues/6331 - if v.LT(version.MinFor(8, 8, 0)) && v.GE(version.MinFor(8, 6, 0)) { + if v.LT(version.MinFor(8, 7, 0)) && v.GE(version.MinFor(8, 6, 0)) { t.SkipNow() } diff --git a/test/e2e/agent/recipes_test.go b/test/e2e/agent/recipes_test.go index 69c190ddd4..91a1736a77 100644 --- a/test/e2e/agent/recipes_test.go +++ b/test/e2e/agent/recipes_test.go @@ -91,7 +91,7 @@ func TestFleetKubernetesIntegrationRecipe(t *testing.T) { v := version.MustParse(test.Ctx().ElasticStackVersion) // https://github.com/elastic/cloud-on-k8s/issues/6331 - if v.LT(version.MinFor(8, 8, 0)) && v.GE(version.MinFor(8, 6, 0)) { + if v.LT(version.MinFor(8, 7, 0)) && v.GE(version.MinFor(8, 6, 0)) { t.SkipNow() } @@ -140,7 +140,7 @@ func TestFleetCustomLogsIntegrationRecipe(t *testing.T) { v := version.MustParse(test.Ctx().ElasticStackVersion) // https://github.com/elastic/cloud-on-k8s/issues/6331 - if v.LT(version.MinFor(8, 8, 0)) && v.GE(version.MinFor(8, 6, 0)) { + if v.LT(version.MinFor(8, 7, 0)) && v.GE(version.MinFor(8, 6, 0)) { t.SkipNow() } @@ -173,7 +173,7 @@ func TestFleetAPMIntegrationRecipe(t *testing.T) { v := version.MustParse(test.Ctx().ElasticStackVersion) // https://github.com/elastic/cloud-on-k8s/issues/6331 - if v.LT(version.MinFor(8, 8, 0)) && v.GE(version.MinFor(8, 6, 0)) { + if v.LT(version.MinFor(8, 7, 0)) && v.GE(version.MinFor(8, 6, 0)) { t.SkipNow() } diff --git a/test/e2e/agent/tls_test.go b/test/e2e/agent/tls_test.go index 5e7e38d080..c1552ef686 100644 --- a/test/e2e/agent/tls_test.go +++ b/test/e2e/agent/tls_test.go @@ -21,7 +21,7 @@ func TestFleetAgentWithoutTLS(t *testing.T) { v := version.MustParse(test.Ctx().ElasticStackVersion) // https://github.com/elastic/cloud-on-k8s/issues/6331 - if v.LT(version.MinFor(8, 8, 0)) && v.GE(version.MinFor(8, 6, 0)) { + if v.LT(version.MinFor(8, 7, 0)) && v.GE(version.MinFor(8, 6, 0)) { t.SkipNow() } diff --git a/test/e2e/agent/upgrade_test.go b/test/e2e/agent/upgrade_test.go index 2c2598b1c8..ee57c8d338 100644 --- a/test/e2e/agent/upgrade_test.go +++ b/test/e2e/agent/upgrade_test.go @@ -26,10 +26,10 @@ func TestAgentVersionUpgradeToLatest8x(t *testing.T) { dv := version.MustParse(dstVersion) // https://github.com/elastic/cloud-on-k8s/issues/6331 - if sv.LT(version.MinFor(8, 8, 0)) && sv.GE(version.MinFor(8, 6, 0)) { + if sv.LT(version.MinFor(8, 7, 0)) && sv.GE(version.MinFor(8, 6, 0)) { t.SkipNow() } - if dv.LT(version.MinFor(8, 8, 0)) && dv.GE(version.MinFor(8, 6, 0)) { + if dv.LT(version.MinFor(8, 7, 0)) && dv.GE(version.MinFor(8, 6, 0)) { t.SkipNow() }