fix(e2e): wire mirror hardening into step-by-step suite - #55359
Conversation
The step-by-step suite installs packages directly via VMclient and never built an installer/host.Host, so it never got the CentOS 7 vault.centos.org fix (#54987) or the Ubuntu apt-mirror fix (#54459/#55229). CentOS 7's `install_rhel` step now fails with the same "403 Forbidden" / "No more mirrors to try" signature those PRs fixed elsewhere (see 7.82.x job 1977865870).
host.New() unconditionally probes systemd via setSystemdVersion(), which fatals the test on CentOS 6 (Upstart, not systemd — see the initctl branch already handled in ConfigureAndRunAgentService). ConfigureYumMirrors() only applies to CentOS 7 anyway, so skip host construction entirely for the CentOS 6.10 descriptor instead of letting host.New() blow up.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 240d9c0b26
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // that descriptor runs Upstart, not systemd (see the initctl branch below and in | ||
| // ConfigureAndRunAgentService). Mirror hardening is only needed for CentOS 7 anyway | ||
| // (ConfigureYumMirrors no-ops on any other version), so skip host construction entirely here. | ||
| if is.osDesc.Flavor == e2eos.CentOS && is.osVersion == 6.10 { |
There was a problem hiding this comment.
Check the raw CentOS 6 descriptor in the guard
When invoked with --osdescriptors=centos/x86_64/610, BuildOSDescriptor stores the raw version as "610"; the parser at lines 96–108 sees no hyphen and therefore sets is.osVersion to 0. Consequently this guard is false, host.New still executes systemctl --version on the Upstart host, and setup fails before the test runs. The fresh evidence after the earlier thread is that the newly added skip compares against a derived value that this supported descriptor never produces; compare osDesc.Version directly or parse 610 in the one-part case.
AGENTS.md reference: AGENTS.md:L169-L169
Useful? React with 👍 / 👎.
Files inventory check summaryFile checks results against ancestor a03b6b77: Results for datadog-agent_7.82.3~rc.1.git.3.c3e2b14.pipeline.133039961-1_amd64.deb:No change detected |
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
This PR is rejected because it was updated |
## Summary Backport of #55358 to `7.83.x` (alongside #55359 for `7.82.x`). - The `step-by-step` suite (`test/new-e2e/tests/agent-platform/tests/step_by_step_test.go`) installs packages directly via `VMclient` and never builds an `installer/host.Host`, so it never got the CentOS 7 `vault.centos.org` fix (#54987) or the Ubuntu apt-mirror fix (#54459 / #55229). - CentOS 7's `install_rhel` step fails with the same `403 Forbidden` / `No more mirrors to try` signature those PRs already fixed elsewhere — see the [7.82.x job](https://gitlab.ddbuild.io/DataDog/datadog-agent/-/jobs/1977865870) (`TestStepByStepScript/test_step_by_step_on_centos-x86-64-79/TestStepByStep/install_rhel`). - Adds a `SetupSuite` to `stepByStepSuite` that builds an `installer/host.Host` and calls the existing `ConfigureYumMirrors()` / `ConfigureAptMirrors()` helpers before any install step runs, matching the pattern already used by `ddotInstallSuite`. Each call is a no-op on the other package manager. ## Test plan - [x] `dda inv new-e2e-tests.run --targets=./tests/agent-platform/tests` compiles cleanly (verified with a non-matching `--run` filter). - [ ] CI: confirm `TestStepByStepScript/.../install_rhel` on CentOS 7 no longer hits the vault 403. Co-authored-by: axel.vonengel <axel.vonengel@datadoghq.com>
host.New() unconditionally probes systemd via setSystemdVersion(), which fatals the test on CentOS 6 (Upstart, not systemd — see the initctl branch already handled in ConfigureAndRunAgentService). ConfigureYumMirrors() only applies to CentOS 7 anyway, so skip host construction entirely for the CentOS 6.10 descriptor instead of letting host.New() blow up.
Summary
Backport of #55358 to
7.82.x, opened directly since the failure was first observed on this release branch.step-by-stepsuite (test/new-e2e/tests/agent-platform/tests/step_by_step_test.go) installs packages directly viaVMclientand never builds aninstaller/host.Host, so it never got the CentOS 7vault.centos.orgfix (fix(e2e): CentOS 7 yum vault mirrors #54987) or the Ubuntu apt-mirror fix (e2e/installer: harden apt against mirror outages #54459 / Harden ddot ubuntu e2e job against apt mirror 503 #55229).install_rhelstep fails with the same403 Forbidden/No more mirrors to trysignature those PRs already fixed elsewhere — see the 7.82.x job (TestStepByStepScript/test_step_by_step_on_centos-x86-64-79/TestStepByStep/install_rhel).SetupSuitetostepByStepSuitethat builds aninstaller/host.Hostand calls the existingConfigureYumMirrors()/ConfigureAptMirrors()helpers before any install step runs, matching the pattern already used byddotInstallSuite. Each call is a no-op on the other package manager.Test plan
dda inv new-e2e-tests.run --targets=./tests/agent-platform/testscompiles cleanly (verified with a non-matching--runfilter).TestStepByStepScript/.../install_rhelon CentOS 7 no longer hits the vault 403.