@@ -13,6 +13,7 @@ import (
1313
1414 atesting "github.com/elastic/elastic-agent/pkg/testing"
1515 "github.com/elastic/elastic-agent/pkg/testing/define"
16+ "github.com/elastic/elastic-agent/testing/upgradetest"
1617)
1718
1819// This file contains upgrade tests that pertain to FIPS-compliant Agent artifacts.
@@ -27,16 +28,27 @@ func TestStandaloneUpgradeFIPStoFIPS(t *testing.T) {
2728 })
2829
2930 // Start with a FIPS-compliant Agent artifact
30- // TODO: introduce FIPS option for artifact fetcher
31+ fipsArtifactFetcher := atesting . ArtifactFetcher ( atesting . WithArtifactFIPSOnly ())
3132 startFixture , err := atesting .NewFixture (
3233 t ,
3334 startVersion .String (),
34- atesting .WithFetcher (atesting . ArtifactFetcher () ),
35+ atesting .WithFetcher (fipsArtifactFetcher ),
3536 )
3637 require .NoError (t , err , "error creating previous agent fixture" )
3738
3839 // Upgrade to newer version of Agent
40+ endFixture , err := define .NewFixtureFromLocalBuild (t , endVersion )
41+ require .NoError (t , err )
42+
43+ err = upgradetest .PerformUpgrade (ctx , startFixture , endFixture , t , upgradetest .WithUnprivileged (unprivileged ))
44+ assert .NoError (t , err )
3945
4046 // Check that new (post-upgrade) Agent is also FIPS-compliant
41- // TODO: check if Agent status contains information about FIPS mode
47+ client := endFixture .Client ()
48+ err = client .Connect (ctx )
49+ require .NoError (t , err )
50+
51+ ver , err := client .Version (ctx )
52+ require .NoError (t , err )
53+ require .True (t , ver .Fips )
4254}
0 commit comments