Skip to content

Conversation

@pkoutsovasilis
Copy link
Contributor

@pkoutsovasilis pkoutsovasilis commented Jun 24, 2025

What does this PR do?

This PR fixes an issue in the TestUpgradeAgentWithTamperProtectedEndpoint_DEB integration test where dpkg would prompt to overwrite the modified elastic-agent.yml configuration file during agent upgrade.

To make the test non-interactive and preserve the existing configuration, the test now uses the --force-confold flag when installing .deb packages via dpkg -i.

PS: this was already introduced in 8.19 by this PR #8646 which such a failure was actually occurring

Why is it important?

Without this fix, the test could hang or fail because dpkg detects that the configuration file at /etc/elastic-agent/elastic-agent.yml was modified after enrollment and prompts the user to choose between keeping or replacing it. Since the test runs in a non-interactive context, the prompt leads to unexpected behavior.

Using --force-confold ensures that the test continues smoothly and keeps the current configuration as expected during same-version or upgrade installs since this test is featuring elastic-agents enrolled to fleet.

Checklist

  • I have read and understood the pull request guidelines of this project.
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool
  • I have added an integration test or an E2E test

Disruptive User Impact

None. This change only affects the test harness logic and does not alter agent behavior or packaging.

How to test this PR locally

mage integration:auth
STACK_PROVISIONER=stateful mage integration:single TestUpgradeAgentWithTamperProtectedEndpoint_DEB

Related issues

@pkoutsovasilis pkoutsovasilis self-assigned this Jun 24, 2025
@pkoutsovasilis pkoutsovasilis added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team skip-changelog backport-8.19 Automated backport to the 8.19 branch labels Jun 24, 2025
@elastic-sonarqube
Copy link

@pkoutsovasilis pkoutsovasilis added backport-skip and removed backport-8.19 Automated backport to the 8.19 branch labels Jun 24, 2025
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

cc @pkoutsovasilis

@pkoutsovasilis pkoutsovasilis marked this pull request as ready for review June 24, 2025 12:08
@pkoutsovasilis pkoutsovasilis requested a review from a team as a code owner June 24, 2025 12:08
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

Copy link
Member

@pchila pchila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thank you for taking care of this

@pkoutsovasilis pkoutsovasilis merged commit d002dc6 into elastic:main Jun 24, 2025
25 checks passed
v1v added a commit that referenced this pull request Jun 25, 2025
…-hosted

* feature/hosted-stack-using-oblt-cli: (26 commits)
  Use the current official docker image for oblt-cli
  Mark the elasticinframetrics processor as deprecated and schedule for removal (#8659)
  [main][Automation] Update versions (#8668)
  chore: Update create_deployment_csp_configuration.yaml (#8669)
  Attempt to make test more reliable by querying ES directly (#8422)
  [test] split up ess and beats serverless integration tests (#8551)
  Remove resource/k8s processor and use k8sattributes processor for service attributes (#8599)
  fix: use --force-confold for deb tests in TestUpgradeAgentWithTamperProtectedEndpoint_DEB (#8649)
  [main][Automation] Bump stack images versions to 9.1.0-ea0b7542 (#8612)
  chore: Update to elastic/beats@f6594fb72670 (#8640)
  [deb/rpm] restart endpoint with tamper protection after elastic-agent  (#8637)
  ci: don't preinstall fleet packages on retried CI steps (#8636)
  chore: Update to elastic/beats@6b6941eed496 (#8619)
  [main][Automation] Bump VM Image version to 1750467641 (#8617)
  flaky: skip TestUpgradeAgentWithTamperProtectedEndpoint_RPM (#8626)
  Add skip-changelog PR label for bump VM PRs (#8627)
  build(deps): bump github.com/elastic/go-seccomp-bpf from 1.5.0 to 1.6.0 (#8611)
  [ci] fix k8s integration tests flakiness (#8575)
  bump apmconfig Otel extension to v0.3.0 (#8600)
  Enhancement/6394 allow deb rpm to upgrade with endpoint tamper protection (#6907)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants