Skip to content

Commit baaa686

Browse files
author
kaanyalti
committed
enhancement(6394): updated endpoint version function in the tests, updated function name in testing tools
1 parent 672a77c commit baaa686

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

pkg/testing/tools/tools.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func InstallAgentWithPolicy(ctx context.Context, t *testing.T,
7373
}
7474

7575
if createPolicyReq.IsProtected {
76-
if err := GetandSetUninstallTokens(ctx, t, kibClient, agentFixture, policy.ID); err != nil {
76+
if err := SetPolicyUninstallTokenInFixture(ctx, t, kibClient, agentFixture, policy.ID); err != nil {
7777
return policy, err
7878
}
7979
}

testing/integration/endpoint_security_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,13 @@ func getEndpointVersion(t *testing.T) string {
9797
output, err := cmd.CombinedOutput()
9898
require.NoError(t, err)
9999
// version: 8.18.0-SNAPSHOT, compiled: Wed Feb 19 01:00:00 2025, branch: HEAD, commit: c450b50f91507c3166b072df8557f5efd871103a
100-
return strings.Split(strings.Split(string(output), "version: ")[1], ",")[0]
100+
endpointVersionFragment, _, found := strings.Cut(string(output), ",")
101+
require.True(t, found)
102+
103+
endpointVersion, found := strings.CutPrefix(endpointVersionFragment, "version: ")
104+
require.True(t, found)
105+
106+
return endpointVersion
101107
}
102108

103109
// The steps in this test are the following
@@ -160,7 +166,7 @@ func testTamperProtectedDebRpmUpgrades(t *testing.T, info *define.Info, packageF
160166
_, err = info.KibanaClient.UpdatePolicy(ctx, policyResp.ID, updateReq)
161167

162168
t.Log("Get the policy uinstall token and store it in the fixture")
163-
tools.GetandSetUninstallTokens(ctx, t, info.KibanaClient, startFixture, policyResp.ID)
169+
tools.SetPolicyUninstallTokenInFixture(ctx, t, info.KibanaClient, startFixture, policyResp.ID)
164170

165171
opts := atesting.InstallOpts{}
166172
t.Log("Install and enroll the first agent")

0 commit comments

Comments
 (0)