Skip to content

Commit c46bb8d

Browse files
author
kaanyalti
committed
enhancement(6394): remove unnecessary comments, refactor unused function
1 parent a36a2e8 commit c46bb8d

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

pkg/testing/fixture_install.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ func (f *Fixture) simpleInstallRPM(ctx context.Context) ([]byte, error) {
470470
return out, fmt.Errorf("apt install failed: %w output:%s", err, string(out))
471471
}
472472

473-
socketPath := "unix:///var/lib/elastic-agent/elastic-agent.sock" // Why does controlSocketRunSylink not work here?
473+
socketPath := "unix:///var/lib/elastic-agent/elastic-agent.sock"
474474
c := client.New(client.WithAddress(socketPath))
475475
f.setClient(c)
476476
return nil, nil
@@ -490,7 +490,7 @@ func (f *Fixture) simpleInstallDeb(ctx context.Context) ([]byte, error) {
490490
return out, fmt.Errorf("apt install failed: %w output:%s", err, string(out))
491491
}
492492

493-
socketPath := "unix:///var/lib/elastic-agent/elastic-agent.sock" // Why does controlSocketRunSylink not work here?
493+
socketPath := "unix:///var/lib/elastic-agent/elastic-agent.sock"
494494
c := client.New(client.WithAddress(socketPath))
495495
f.setClient(c)
496496

@@ -550,7 +550,7 @@ func (f *Fixture) installDeb(ctx context.Context, installOpts *InstallOpts, shou
550550
return out, fmt.Errorf("systemctl start elastic-agent failed: %w", err)
551551
}
552552

553-
socketPath := "unix:///var/lib/elastic-agent/elastic-agent.sock" // Why does controlSocketRunSylink not work here?
553+
socketPath := "unix:///var/lib/elastic-agent/elastic-agent.sock"
554554
c := client.New(client.WithAddress(socketPath))
555555
f.setClient(c)
556556

@@ -641,7 +641,7 @@ 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?
644+
socketPath := "unix:///var/lib/elastic-agent/elastic-agent.sock"
645645
c := client.New(client.WithAddress(socketPath))
646646
f.setClient(c)
647647

testing/integration/endpoint_security_test.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -350,12 +350,6 @@ func installSecurityAgent(ctx context.Context, t *testing.T, info *define.Info,
350350
fixture, err := define.NewFixtureFromLocalBuild(t, define.Version())
351351
require.NoError(t, err, "could not create agent fixture")
352352

353-
policyResp := installSecurityAgentWithFixture(ctx, t, info, fixture, protected)
354-
355-
return fixture, policyResp
356-
}
357-
358-
func installSecurityAgentWithFixture(ctx context.Context, t *testing.T, info *define.Info, fixture *atesting.Fixture, protected bool) kibana.PolicyResponse {
359353
t.Log("Enrolling the agent in Fleet")
360354
policyUUID := uuid.Must(uuid.NewV4()).String()
361355

@@ -378,10 +372,11 @@ func installSecurityAgentWithFixture(ctx context.Context, t *testing.T, info *de
378372
Privileged: true,
379373
}
380374

381-
policy, err := tools.InstallAgentWithPolicy(ctx, t,
375+
policyResp, err := tools.InstallAgentWithPolicy(ctx, t,
382376
installOpts, fixture, info.KibanaClient, createPolicyReq)
383377
require.NoError(t, err, "failed to install agent with policy")
384-
return policy
378+
379+
return fixture, policyResp
385380
}
386381

387382
// buildPolicyWithTamperProtection helper function to build the policy request with or without tamper protection

0 commit comments

Comments
 (0)