Skip to content

Commit

Permalink
[9.0](backport #4403) Use --develop flag for agent install e2e tests (#…
Browse files Browse the repository at this point in the history
…4406)

* Use --develop flag for agent install e2e tests (#4403)

* Use --develop flag for agent install e2e tests

* Update testing stack version to 9.1.0-SNAPSHOT

(cherry picked from commit 23bd61a)

* use 9.0.0-SNAPSHOT version

---------

Co-authored-by: Michel Laterman <82832767+michel-laterman@users.noreply.github.com>
Co-authored-by: michel-laterman <michel.laterman@elastic.co>
  • Loading branch information
3 people authored Feb 4, 2025
1 parent 9c57ff4 commit 3791c11
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dev-tools/e2e/kibana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ xpack.fleet.agentPolicies:
namespace: default
package_policies:
- name: fleet_server-2
id: default-fleet-server
id: apm-fleet-server
package:
name: fleet_server
xpack.fleet.outputs:
Expand Down
10 changes: 7 additions & 3 deletions testing/e2e/agent_install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (suite *AgentInstallSuite) SetupSuite() {
return
}
// check if agent is installed
if _, err := exec.LookPath(agentName); err == nil {
if _, err := exec.LookPath(agentDevName); err == nil {
suite.installDetected = true
return // don't bother with setup, skip all tests
}
Expand Down Expand Up @@ -277,15 +277,16 @@ func (suite *AgentInstallSuite) TearDownTest() {
return
}

out, err := exec.Command("sudo", "elastic-agent", "uninstall", "--force").CombinedOutput()
suite.Assert().NoErrorf(err, "elastic-agent uninstall failed. Output: %s", out)
out, err := exec.Command("sudo", "elastic-development-agent", "uninstall", "--force").CombinedOutput()
suite.Assert().NoErrorf(err, "elastic-development-agent uninstall failed. Output: %s", out)
}

func (suite *AgentInstallSuite) TestHTTP() {
ctx, cancel := context.WithTimeout(context.Background(), time.Minute*3)
defer cancel()

cmd := exec.CommandContext(ctx, "sudo", suite.agentPath, "install",
"--develop", "--install-servers",
"--fleet-server-es=http://"+suite.ESHosts,
"--fleet-server-service-token="+suite.ServiceToken,
"--fleet-server-insecure-http=true",
Expand All @@ -310,6 +311,7 @@ func (suite *AgentInstallSuite) TestWithSecretFiles() {
defer cancel()

cmd := exec.CommandContext(ctx, "sudo", suite.agentPath, "install",
"--develop", "--install-servers",
"--url=https://localhost:8220",
"--certificate-authorities="+filepath.Join(suite.CertPath, "e2e-test-ca.crt"),
"--fleet-server-es=http://"+suite.ESHosts,
Expand Down Expand Up @@ -365,6 +367,7 @@ func (suite *AgentInstallSuite) TestAPMInstrumentationFile() {
defer cancel()

cmd := exec.CommandContext(ctx, "sudo", suite.agentPath, "install",
"--develop", "--install-servers",
"--fleet-server-es=http://"+suite.ESHosts,
"--fleet-server-service-token="+suite.ServiceToken,
"--fleet-server-insecure-http=true",
Expand Down Expand Up @@ -403,6 +406,7 @@ func (suite *AgentInstallSuite) TestAPMInstrumentationPolicy() {
})

cmd := exec.CommandContext(ctx, "sudo", suite.agentPath, "install",
"--develop", "--install-servers",
"--fleet-server-es=http://"+suite.ESHosts,
"--fleet-server-service-token="+suite.ServiceToken,
"--fleet-server-insecure-http=true",
Expand Down
5 changes: 3 additions & 2 deletions testing/e2e/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@

package e2e

const binaryName = "fleet-server" //nolint:unused // work around to get platform specific binary name for tests
const agentName = "elastic-agent" //nolint:unused // work around to get platform specific binary name for tests
const binaryName = "fleet-server" //nolint:unused // work around to get platform specific binary name for tests
const agentName = "elastic-agent" //nolint:unused // work around to get platform specific binary name for tests
const agentDevName = "elastic-development-agent" //nolint:unused // work around to get platform specific binary name for tests
1 change: 1 addition & 0 deletions testing/e2e/const_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ package e2e

const binaryName = "fleet-server.exe"
const agentName = "elastic-agent.exe"
const agentDevName = "elastic-development-agent.exe"

0 comments on commit 3791c11

Please sign in to comment.