Skip to content

Commit c9d1864

Browse files
author
kaanyalti
committed
enhancement(6394): resorted to using previous major instead of minor in upgrade test
1 parent 109a15b commit c9d1864

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

testing/integration/endpoint_security_test.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,11 @@ func getEndpointVersion(t *testing.T) string {
127127
// cleanup functions are set
128128
func testTamperProtectedDebRpmUpgrades(t *testing.T, info *define.Info, packageFormat string) {
129129
ctx := context.Background()
130-
131-
t.Log("Preparing fixture with an older version of the agent")
132-
upgradeFromVersion, err := upgradetest.PreviousMinor()
130+
upgradeables, err := upgradetest.GetUpgradableVersions()
133131
require.NoError(t, err)
132+
upgradeFromVersion := upgradeables[0]
133+
t.Logf("Preparing fixture with agent version %s", upgradeFromVersion.String())
134+
134135
startFixture, err := atesting.NewFixture(
135136
t,
136137
upgradeFromVersion.String(),
@@ -208,6 +209,9 @@ func testTamperProtectedDebRpmUpgrades(t *testing.T, info *define.Info, packageF
208209

209210
t.Log("The initial installation of both the agent and endpoint are healthy")
210211

212+
initEndpointVersion := getEndpointVersion(t)
213+
t.Logf("The initial endpoint version is %s", initEndpointVersion)
214+
211215
// try to uninstall endpoint without token and assert that endpoint is not removed
212216
_, err = exec.Command("sudo", "/opt/Elastic/Endpoint/elastic-endpoint", "uninstall", "--log", "stdout").CombinedOutput()
213217
require.Error(t, err)
@@ -235,9 +239,10 @@ func testTamperProtectedDebRpmUpgrades(t *testing.T, info *define.Info, packageF
235239
t.Log("The upgraded agent and endpoint are both healthy")
236240

237241
t.Log("Validate that the initial endpoint version is smaller than the upgraded version")
238-
initEndpointVersion := getEndpointVersion(t)
239242
upgradedEndpointVersion := getEndpointVersion(t)
240243

244+
t.Logf("The upgraded endpoint version is %s", upgradedEndpointVersion)
245+
241246
startEndpointVersion, err := version.ParseVersion(initEndpointVersion)
242247
require.NoError(t, err)
243248

0 commit comments

Comments
 (0)