Skip to content

Commit

Permalink
AP-2322 Move Amazon linux install script test to new-e2e (#21149)
Browse files Browse the repository at this point in the history
AP-2322 Move Amazon linux install script test to new-e2e
  • Loading branch information
KevinFairise2 authored Nov 30, 2023
1 parent e94970c commit 0fa6ade
Show file tree
Hide file tree
Showing 9 changed files with 138 additions and 101 deletions.
4 changes: 4 additions & 0 deletions .gitlab/e2e_test_junit_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ e2e_test_junit_upload:
- new-e2e-agent-platform-install-script-debian-iot-agent-a7-x86_64
- new-e2e-agent-platform-install-script-debian-dogstatsd-a7-x86_64
- new-e2e-agent-platform-install-script-debian-heroku-agent-a7-x86_64
- new-e2e-agent-platform-install-script-amazonlinux-a6-x86_64
- new-e2e-agent-platform-install-script-amazonlinux-a6-arm64
- new-e2e-agent-platform-install-script-amazonlinux-a7-x64
- new-e2e-agent-platform-install-script-amazonlinux-a7-arm64
- new-e2e-npm-main
- new-e2e-cws-main
script:
Expand Down
1 change: 0 additions & 1 deletion .gitlab/kitchen_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# Contains jobs which run kitchen tests on the Agent packages.

include:
- /.gitlab/kitchen_testing/amazonlinux.yml
- /.gitlab/kitchen_testing/centos.yml
- /.gitlab/kitchen_testing/debian.yml
- /.gitlab/kitchen_testing/suse.yml
Expand Down
96 changes: 0 additions & 96 deletions .gitlab/kitchen_testing/amazonlinux.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .gitlab/kitchen_tests_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ kitchen_tests_upload_common:
- !reference [.except_mergequeue]
- when: always
dependencies:
- kitchen_amazonlinux_install_script_agent-a6_arm64
- kitchen_amazonlinux_install_script_agent-a6_x64
- kitchen_amazonlinux_install_script_agent-a7_arm64
- kitchen_amazonlinux_install_script_agent-a7_x64
- kitchen_centos_fips_install_script_agent-a6
- kitchen_centos_fips_install_script_agent-a7
- kitchen_centos_fips_install_script_dogstatsd-a7
Expand Down
1 change: 1 addition & 0 deletions .gitlab/new-e2e_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@

include:
- /.gitlab/new-e2e_testing/debian.yml
- /.gitlab/new-e2e_testing/amazonlinux.yml
90 changes: 90 additions & 0 deletions .gitlab/new-e2e_testing/amazonlinux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@

.new-e2e_os_amazonlinux:
variables:
E2E_PLATFORM: amazonlinux

.new-e2e_install_script:
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 --major-version $AGENT_MAJOR_VERSION --arch $E2E_ARCH --flavor $FLAVOR

.new-e2e_amazonlinux_a6_x86_64:
variables:
E2E_ARCH: x86_64
E2E_OSVERS: "amazonlinux2-5-10,amazonlinux2022-5-15,amazonlinux2023"
E2E_CWS_SUPPORTED_OSVERS: "amazonlinux2-5-10,amazonlinux2022-5-15,amazonlinux2023"
E2E_BRANCH_OSVERS: "amazonlinux2023"
needs: ["deploy_rpm_testing-a6_x64"]

.new-e2e_amazonlinux_a6_arm64:
variables:
E2E_ARCH: arm64
E2E_OSVERS: "amazonlinux2-5-10,amazonlinux2022-5-15,amazonlinux2023"
E2E_CWS_SUPPORTED_OSVERS: "amazonlinux2-5-10,amazonlinux2022-5-15,amazonlinux2023"
E2E_BRANCH_OSVERS: "amazonlinux2023"
needs: ["deploy_rpm_testing-a6_arm64"]

.new-e2e_amazonlinux_a7_x86_64:
variables:
E2E_ARCH: x86_64
E2E_OSVERS: "amazonlinux2-5-10,amazonlinux2022-5-15,amazonlinux2023"
E2E_CWS_SUPPORTED_OSVERS: "amazonlinux2-5-10,amazonlinux2022-5-15,amazonlinux2023"
E2E_BRANCH_OSVERS: "amazonlinux2023"
needs: ["deploy_rpm_testing-a7_x64"]

.new-e2e_amazonlinux_a7_arm64:
variables:
E2E_ARCH: arm64
E2E_OSVERS: "amazonlinux2-5-10,amazonlinux2022-5-15,amazonlinux2023"
E2E_CWS_SUPPORTED_OSVERS: "amazonlinux2-5-10,amazonlinux2022-5-15,amazonlinux2023"
E2E_BRANCH_OSVERS: "amazonlinux2023"
needs: ["deploy_rpm_testing-a7_arm64"]

new-e2e-agent-platform-install-script-amazonlinux-a6-x86_64:
stage: kitchen_testing
extends:
- .new_e2e_template
- .new-e2e_install_script
- .new-e2e_os_amazonlinux
- .new-e2e_amazonlinux_a6_x86_64
- .new-e2e_agent_a6
variables:
FLAVOR: datadog-agent

new-e2e-agent-platform-install-script-amazonlinux-a6-arm64:
stage: kitchen_testing
extends:
- .new_e2e_template
- .new-e2e_install_script
- .new-e2e_os_amazonlinux
- .new-e2e_amazonlinux_a6_arm64
- .new-e2e_agent_a6
variables:
FLAVOR: datadog-agent

new-e2e-agent-platform-install-script-amazonlinux-a7-x64:
stage: kitchen_testing
extends:
- .new_e2e_template
- .new-e2e_install_script
- .new-e2e_os_amazonlinux
- .new-e2e_amazonlinux_a7_x86_64
- .new-e2e_agent_a7
rules:
!reference [.on_default_new-e2e_tests_a7]
variables:
FLAVOR: datadog-agent

new-e2e-agent-platform-install-script-amazonlinux-a7-arm64:
stage: kitchen_testing
extends:
- .new_e2e_template
- .new-e2e_install_script
- .new-e2e_os_amazonlinux
- .new-e2e_amazonlinux_a7_arm64
- .new-e2e_agent_a7
rules:
!reference [.on_all_new-e2e_tests_a7]
variables:
FLAVOR: datadog-agent
25 changes: 25 additions & 0 deletions test/new-e2e/tests/agent-platform/common/pkg-manager/yum.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.

package pkgmanager

import (
e2eClient "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client"
)

// YumPackageManager struct for the Yum package manager
type YumPackageManager struct {
vmClient e2eClient.VM
}

// NewYumPackageManager return yum package manager
func NewYumPackageManager(vmClient e2eClient.VM) *YumPackageManager {
return &YumPackageManager{vmClient: vmClient}
}

// Remove executes remove command from yum
func (s *YumPackageManager) Remove(pkg string) (string, error) {
return s.vmClient.ExecuteWithError("sudo yum remove -y " + pkg)
}
4 changes: 4 additions & 0 deletions test/new-e2e/tests/agent-platform/common/test_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ func getPackageManager(vmClient e2eClient.VM) PackageManager {
if _, err := vmClient.ExecuteWithError("command -v apt"); err == nil {
return pkgmanager.NewAptPackageManager(vmClient)
}

if _, err := vmClient.ExecuteWithError("command -v yum"); err == nil {
return pkgmanager.NewYumPackageManager(vmClient)
}
return nil
}

Expand Down
14 changes: 14 additions & 0 deletions test/new-e2e/tests/agent-platform/platforms/platforms.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,19 @@
"debian-11": "ami-03ea090ddd75eb738",
"debian-12": "ami-02aab8d5301cb8d68"
}
},
"amazonlinux": {
"x86_64": {
"amazonlinux2-4-14": "ami-038b3df3312ddf25d",
"amazonlinux2-5-10": "ami-06a0cd9728546d178",
"amazonlinux2022-5-15": "ami-0309aede310b9cc1f",
"amazonlinux2023": "ami-0889a44b331db0194"
},
"arm64": {
"amazonlinux2-4-14": "ami-090230ed0c6b13c74",
"amazonlinux2-5-10": "ami-09e51988f56677f44",
"amazonlinux2022-5-15": "ami-0a8495f6303122235",
"amazonlinux2023": "ami-08fc6fb8ad2e794bb"
}
}
}

0 comments on commit 0fa6ade

Please sign in to comment.