Skip to content

Commit 9d0269f

Browse files
committed
FIPS upgrade tests should start with FIPS-capable version
1 parent 403e0ef commit 9d0269f

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

testing/integration/upgrade_fleet_test.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,21 @@ func TestFleetManagedUpgradeUnprivilegedFIPS(t *testing.T) {
8383
},
8484
FIPS: true,
8585
})
86+
87+
// parse the version we are testing
88+
currentVersion, err := version.ParseVersion(define.Version())
89+
require.NoError(t, err)
90+
91+
// We need to start the upgrade from a FIPS-capable version
92+
if !isFIPSCapableVersion(currentVersion) {
93+
t.Skipf(
94+
"Minimum start version of FIPS-capable Agent for running this test is either %q or %q, current start version: %q",
95+
*upgradetest.Version_8_19_0_SNAPSHOT,
96+
*upgradetest.Version_9_1_0_SNAPSHOT,
97+
currentVersion,
98+
)
99+
}
100+
86101
postWatcherSuccessHook := upgradetest.PostUpgradeAgentIsFIPSCapable
87102
upgradeOpts := []upgradetest.UpgradeOpt{upgradetest.WithPostWatcherSuccessHook(postWatcherSuccessHook)}
88103
testFleetManagedUpgrade(t, info, true, true, upgradeOpts...)
@@ -104,6 +119,16 @@ func TestFleetManagedUpgradePrivilegedFIPS(t *testing.T) {
104119
FIPS: true,
105120
})
106121

122+
// We need to start the upgrade from a FIPS-capable version
123+
if !isFIPSCapableVersion(currentVersion) {
124+
t.Skipf(
125+
"Minimum start version of FIPS-capable Agent for running this test is either %q or %q, current start version: %q",
126+
*upgradetest.Version_8_19_0_SNAPSHOT,
127+
*upgradetest.Version_9_1_0_SNAPSHOT,
128+
currentVersion,
129+
)
130+
}
131+
107132
// Check that new (post-upgrade) Agent is also FIPS-capable
108133
postWatcherSuccessHook := upgradetest.PostUpgradeAgentIsFIPSCapable
109134
upgradeOpts := []upgradetest.UpgradeOpt{upgradetest.WithPostWatcherSuccessHook(postWatcherSuccessHook)}

0 commit comments

Comments
 (0)