This repository was archived by the owner on Sep 17, 2024. It is now read-only.

Description
Scenario should be as follow:
2 versions of agent are available (must differ in last commit)
- first agent is the one which is installed
- second one is made available using some public API or local fileserver (must be available at
{uri}:{port}/beats/elastic-agent/{tar_name}
First agent is installed and is ONLINE in fleet.
Second agent artifacts is made available
for local test i'm using fileserver with artifacts at ~/server/beats/elastic-agent/*
then from ~/server i run python3 -m http.server
Update is initiated either using UI (manual tests) or using API (manual/automated tests)
API for initiating upgrade using fileserver serving at localhost
curl -X POST -H 'kbn-xsrf: true' -u elastic:changeme http://localhost:5601/api/ingest_manager/fleet/agents/{AGENT_ID}/upgrade \
-H 'Content-Type: application/json' \
-d '{"source_uri":"http://localhost:8000","version":"8.0.0"}'
If fleet does not send SourceURI it is good to configure agent.download.sourceURI to http://localhost:8000 in elastic-agent.yml
Agent is listed as UPDATING in fleet
- with file server this will be only for a fraction of second or couple of seconds max (update is very fast)
Update action is ACKed in fleet
Agent version is changed and agent is listed as ONLINE in fleet
- state should be running
- all beats has to be started and collecting again based on config assigned
No ERROR should be reported during this procedure.
Prerequisites
elastic/kibana#78810
elastic/beats#21461