Skip to content

Commit 441a1a4

Browse files
author
kaanyalti
committed
enhancement(6394): added test logs, updated rpm installation to set agent socket path
1 parent b2314e4 commit 441a1a4

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

pkg/testing/fixture_install.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ func (f *Fixture) simpleInstallRPM(ctx context.Context) ([]byte, error) {
465465
}
466466

467467
// sudo apt-get install the deb
468-
out, err := exec.CommandContext(ctx, "sudo", "dnf", "install", f.srcPackage).CombinedOutput() // #nosec G204 -- Need to pass in name of package
468+
out, err := exec.CommandContext(ctx, "sudo", "rpm", "-Uvh", f.srcPackage).CombinedOutput() // #nosec G204 -- Need to pass in name of package
469469
if err != nil {
470470
return out, fmt.Errorf("apt install failed: %w output:%s", err, string(out))
471471
}
@@ -641,6 +641,10 @@ func (f *Fixture) installRpm(ctx context.Context, installOpts *InstallOpts, shou
641641
return out, fmt.Errorf("systemctl start elastic-agent failed: %w", err)
642642
}
643643

644+
socketPath := "unix:///var/lib/elastic-agent/elastic-agent.sock" // Why does controlSocketRunSylink not work here?
645+
c := client.New(client.WithAddress(socketPath))
646+
f.setClient(c)
647+
644648
if !shouldEnroll {
645649
return nil, nil
646650
}

testing/integration/endpoint_security_test.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ func TestUpgradeAgentWithTamperProtectedEndpoint_DEB(t *testing.T) {
6767
Local: false, // requires Agent installation
6868
Sudo: true, // requires Agent installation
6969
OS: []define.OS{
70-
{Type: define.Linux},
70+
{
71+
Type: define.Linux,
72+
},
7173
},
7274
})
7375
testTamperProtectedDebRpmUpgrades(t, info, "deb")
@@ -80,7 +82,10 @@ func TestUpgradeAgentWithTamperProtectedEndpoint_RPM(t *testing.T) {
8082
Local: false, // requires Agent installation
8183
Sudo: true, // requires Agent installation
8284
OS: []define.OS{
83-
{Type: define.Linux},
85+
{
86+
Type: define.Linux,
87+
Distro: "rhel",
88+
},
8489
},
8590
})
8691
testTamperProtectedDebRpmUpgrades(t, info, "rpm")

0 commit comments

Comments
 (0)