Skip to content

Commit c2d812a

Browse files
committed
Add version constraint to test
1 parent f2199d4 commit c2d812a

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

testing/integration/upgrade_standalone_fips_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ func TestStandaloneUpgradeFIPStoFIPS(t *testing.T) {
3131
Sudo: true, // requires Agent installation
3232
})
3333

34+
// parse the version we are testing
35+
currentVersion, err := version.ParseVersion(define.Version())
36+
require.NoError(t, err)
37+
38+
// 9.1.0-SNAPSHOT is the minimum version we need for testing upgrading from FIPS to FIPS.
39+
if currentVersion.Less(*upgradetest.Version_9_1_0_SNAPSHOT) {
40+
t.Skipf("Minimum version for running this test is %q, current version: %q", *upgradetest.Version_9_1_0_SNAPSHOT, currentVersion)
41+
}
42+
3443
// Start with a FIPS-compliant Agent artifact
3544
fipsArtifactFetcher := atesting.ArtifactFetcher(atesting.WithArtifactFIPSOnly())
3645

testing/upgradetest/versions.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ var (
4141
Version_8_14_0_SNAPSHOT = version.NewParsedSemVer(8, 14, 0, "SNAPSHOT", "")
4242
// Version_8_14_0_SNAPSHOT is the minimum version for proper unprivileged execution on all platforms
4343
Version_9_0_0_SNAPSHOT = version.NewParsedSemVer(9, 0, 0, "SNAPSHOT", "")
44+
// Version_9_1_0_SNAPSHOT is the minimum version for testing upgrades from FIPS-enabled artifacts to FIPS-enabled
45+
// Artifacts
46+
Version_9_1_0_SNAPSHOT = version.NewParsedSemVer(9, 1, 0, "SNAPSHOT", "")
4447

4548
// ErrNoSnapshot is returned when a requested snapshot is not on the version list.
4649
ErrNoSnapshot = errors.New("failed to find a snapshot on the version list")

0 commit comments

Comments
 (0)