From df98304f9e35530c78432f38f99addbe00433c08 Mon Sep 17 00:00:00 2001 From: Kevin Fairise Date: Wed, 22 Nov 2023 17:36:19 +0100 Subject: [PATCH] Small refacto and add agent 6 --- .gitlab/new-e2e_common/testing.yml | 8 ++ .gitlab/new-e2e_testing/debian.yml | 90 ++++++++++++++----- .../install-script/install_script_test.go | 14 +-- 3 files changed, 85 insertions(+), 27 deletions(-) diff --git a/.gitlab/new-e2e_common/testing.yml b/.gitlab/new-e2e_common/testing.yml index efacd2d46d2e0..6ee11acd639f3 100644 --- a/.gitlab/new-e2e_common/testing.yml +++ b/.gitlab/new-e2e_common/testing.yml @@ -1,3 +1,11 @@ +.new-e2e_agent_a6: + rules: + !reference [.on_kitchen_tests_a6] #TODO: Change when migration is complete to another name without 'kitchen' + variables: + AGENT_MAJOR_VERSION: 6 + + + .new-e2e_agent_a7: rules: !reference [.on_kitchen_tests_a7] #TODO: Change when migration is complete to another name without 'kitchen' diff --git a/.gitlab/new-e2e_testing/debian.yml b/.gitlab/new-e2e_testing/debian.yml index 5c4094de0e638..cffa1170c2281 100644 --- a/.gitlab/new-e2e_testing/debian.yml +++ b/.gitlab/new-e2e_testing/debian.yml @@ -3,85 +3,131 @@ variables: E2E_PLATFORM: debian -.new-e2e_debian_a7_x64: +.new-e2e_install_script: variables: + TARGET: ./tests/install-script + TEAM: agent-platform + EXTRA_PARAMS: --osversion $E2E_OSVERS --platform $E2E_PLATFORM --cws-supported-osversion $E2E_CWS_SUPPORTED_OSVERS --major-version $AGENT_MAJOR_VERSION --arch $E2E_ARCH --flavor $FLAVOR + +.new-e2e_debian_a6_x86_64: + variables: + E2E_ARCH: x86_64 + E2E_OSVERS: "debian-9,debian-10,debian-11,debian-12" + E2E_CWS_SUPPORTED_OSVERS: "debian-10,debian-11" + E2E_BRANCH_OSVERS: "debian-11" + E2E_MAJOR_VERSION: 6 + needs: ["deploy_deb_testing-a6_x64"] + +.new-e2e_debian_a6_arm64: + variables: + E2E_ARCH: arm64 + E2E_OSVERS: "debian-10" + E2E_CWS_SUPPORTED_OSVERS: "debian-10" + E2E_BRANCH_OSVERS: "debian-10" + E2E_MAJOR_VERSION: 6 + needs: ["deploy_deb_testing-a6_arm64"] + +.new-e2e_debian_a7_x86_64: + variables: + E2E_ARCH: x86_64 E2E_OSVERS: "debian-9,debian-10,debian-11,debian-12" E2E_CWS_SUPPORTED_OSVERS: "debian-10,debian-11" E2E_BRANCH_OSVERS: "debian-11" + E2E_MAJOR_VERSION: 7 needs: ["deploy_deb_testing-a7_x64"] .new-e2e_debian_a7_arm64: variables: + E2E_ARCH: arm64 E2E_OSVERS: "debian-10" E2E_CWS_SUPPORTED_OSVERS: "debian-10" E2E_BRANCH_OSVERS: "debian-10" + E2E_MAJOR_VERSION: 7 needs: ["deploy_deb_testing-a7_arm64"] +new-e2e-agent-platform-install-script-debian-a6-x86_64: + stage: kitchen_testing + extends: + - .new_e2e_template + - .new-e2e_install_script + - .new-e2e_os_debian + - .new-e2e_debian_a6_x86_64 + - .new-e2e_agent_a6 + +new-e2e-agent-platform-install-script-debian-a6-arm64: + stage: kitchen_testing + extends: + - .new_e2e_template + - .new-e2e_install_script + - .new-e2e_os_debian + - .new-e2e_debian_a6_arm64 + - .new-e2e_agent_a6 + new-e2e-agent-platform-install-script-debian-a7-x64: stage: kitchen_testing extends: - .new_e2e_template + - .new-e2e_install_script - .new-e2e_os_debian - - .new-e2e_debian_a7_x64 + - .new-e2e_debian_a7_x86_64 - .new-e2e_agent_a7 rules: !reference [.on_default_new-e2e_tests_a7] - variables: - TARGETS: ./tests/agent-platform/install-script - TEAM: agent-platform - EXTRA_PARAMS: --osversion $E2E_OSVERS --platform $E2E_PLATFORM --cws-supported-osversion $E2E_CWS_SUPPORTED_OSVERS --arch x86_64 new-e2e-agent-platform-install-script-debian-a7-arm64: stage: kitchen_testing extends: - .new_e2e_template + - .new-e2e_install_script - .new-e2e_os_debian - .new-e2e_debian_a7_arm64 - .new-e2e_agent_a7 rules: !reference [.on_all_new-e2e_tests_a7] - variables: - TARGETS: ./tests/agent-platform/install-script - TEAM: agent-platform - EXTRA_PARAMS: --osversion $E2E_OSVERS --platform $E2E_PLATFORM --cws-supported-osversion $E2E_CWS_SUPPORTED_OSVERS --arch arm64 new-e2e-agent-platform-install-script-debian-iot-agent-a7-x86_64: stage: kitchen_testing extends: - .new_e2e_template + - .new-e2e_install_script - .new-e2e_os_debian - - .new-e2e_debian_a7_x64 + - .new-e2e_debian_a7_x86_64 - .new-e2e_agent_a7 rules: !reference [.on_default_new-e2e_tests_a7] variables: - TARGETS: ./tests/agent-platform/install-script - TEAM: agent-platform - EXTRA_PARAMS: --osversion $E2E_OSVERS --platform $E2E_PLATFORM --cws-supported-osversion $E2E_CWS_SUPPORTED_OSVERS --arch x86_64 --flavor datadog-iot-agent + FLAVOR: datadog-iot-agent new-e2e-agent-platform-install-script-debian-dogstatsd-a7-x86_64: stage: kitchen_testing extends: - .new_e2e_template + - .new-e2e_install_script - .new-e2e_os_debian - - .new-e2e_debian_a7_x64 + - .new-e2e_debian_a7_x86_64 - .new-e2e_agent_a7 variables: - TARGETS: ./tests/agent-platform/install-script - TEAM: agent-platform - EXTRA_PARAMS: --osversion $E2E_OSVERS --platform $E2E_PLATFORM --cws-supported-osversion $E2E_CWS_SUPPORTED_OSVERS --arch x86_64 --flavor datadog-dogstatsd + FLAVOR: datadog-dogstatsd + +new-e2e-agent-platform-install-script-debian-heroku-agent-a6-x86_64: + stage: kitchen_testing + extends: + - .new_e2e_template + - .new-e2e_os_debian + - .new-e2e_debian_a6_x86_64 + - .new-e2e_agent_a6 + variables: + FLAVOR: datadog-heroku-agent new-e2e-agent-platform-install-script-debian-heroku-agent-a7-x86_64: stage: kitchen_testing extends: - .new_e2e_template - .new-e2e_os_debian - - .new-e2e_debian_a7_x64 + - .new-e2e_debian_a7_x86_64 - .new-e2e_agent_a7 variables: - TARGETS: ./tests/agent-platform/install-script - TEAM: agent-platform - EXTRA_PARAMS: --osversion $E2E_OSVERS --platform $E2E_PLATFORM --cws-supported-osversion $E2E_CWS_SUPPORTED_OSVERS --arch x86_64 --flavor datadog-heroku-agent + FLAVOR: datadog-heroku-agent diff --git a/test/new-e2e/tests/agent-platform/install-script/install_script_test.go b/test/new-e2e/tests/agent-platform/install-script/install_script_test.go index a8c3f17027184..318ead96ad5d5 100644 --- a/test/new-e2e/tests/agent-platform/install-script/install_script_test.go +++ b/test/new-e2e/tests/agent-platform/install-script/install_script_test.go @@ -32,8 +32,9 @@ import ( var osVersion = flag.String("osversion", "", "os version to test") var platform = flag.String("platform", "", "platform to test") var cwsSupportedOsVersion = flag.String("cws-supported-osversion", "", "list of os where CWS is supported") -var architecture = flag.String("arch", "", "architecture to test (x86_64, arm64))") -var flavor = flag.String("flavor", "", "flavor to test (datadog-agent, datadog-iot-agent, datadog-dogstatsd, datadog-fips-proxy, datadog-heroku-agent)") +var architecture = flag.String("arch", "x86_64", "architecture to test (x86_64, arm64))") +var flavor = flag.String("flavor", "datadog-agent", "flavor to test (datadog-agent, datadog-iot-agent, datadog-dogstatsd, datadog-fips-proxy, datadog-heroku-agent)") +var majorVersion = flag.String("major-version", "7", "major version to test (6, 7)") type installScriptSuite struct { e2e.Suite[e2e.VMEnv] @@ -75,10 +76,10 @@ func TestInstallScript(t *testing.T) { } } - t.Run(fmt.Sprintf("test install script on %s %s %s", osVers, *architecture, *flavor), func(tt *testing.T) { + t.Run(fmt.Sprintf("test install script on %s %s %s agent %s", osVers, *architecture, *flavor, *majorVersion), func(tt *testing.T) { tt.Parallel() fmt.Printf("Testing %s", osVers) - e2e.Run(tt, &installScriptSuite{cwsSupported: cwsSupported}, e2e.EC2VMStackDef(ec2params.WithImageName(platformJSON[*platform][*architecture][osVers], archMapping[*architecture], osMapping[*platform])), params.WithStackName(fmt.Sprintf("install-script-test-%v-%v-%s-%s", os.Getenv("CI_PIPELINE_ID"), osVers, *architecture, *flavor))) + e2e.Run(tt, &installScriptSuite{cwsSupported: cwsSupported}, e2e.EC2VMStackDef(ec2params.WithImageName(platformJSON[*platform][*architecture][osVers], archMapping[*architecture], osMapping[*platform])), params.WithStackName(fmt.Sprintf("install-script-test-%v-%v-%s-%s-%v", os.Getenv("CI_PIPELINE_ID"), osVers, *architecture, *flavor, *majorVersion))) }) } } @@ -95,13 +96,16 @@ func (is *installScriptSuite) TestInstallAgent() { unixHelper := helpers.NewUnixHelper() client := common.NewTestClient(is.Env().VM, agentClient, fileManager, unixHelper) - install.Unix(is.T(), client, installparams.WithArch(*architecture), installparams.WithFlavor(*flavor)) + install.Unix(is.T(), client, installparams.WithArch(*architecture), installparams.WithFlavor(*flavor), installparams.WithMajorVersion(*majorVersion)) common.CheckInstallation(is.T(), client) common.CheckAgentBehaviour(is.T(), client) common.CheckAgentStops(is.T(), client) common.CheckAgentRestarts(is.T(), client) common.CheckIntegrationInstall(is.T(), client) + if *majorVersion == "6" { + common.CheckAgentPython(is.T(), client, "2") + } common.CheckAgentPython(is.T(), client, "3") common.CheckApmEnabled(is.T(), client) common.CheckApmDisabled(is.T(), client)