2727import org .elasticsearch .test .rest .ObjectPath ;
2828import org .elasticsearch .xcontent .XContentBuilder ;
2929import org .elasticsearch .xcontent .XContentType ;
30- import org .junit .Before ;
3130import org .junit .ClassRule ;
3231import org .junit .rules .RuleChain ;
3332import org .junit .rules .TestRule ;
@@ -75,11 +74,6 @@ protected String getTestRestCluster() {
7574 return cluster .getHttpAddresses ();
7675 }
7776
78- @ Before
79- public void skipFips () {
80- assumeFalse ("getting these tests to run in a FIPS JVM is kinda fiddly and we don't really need the extra coverage" , inFipsJvm ());
81- }
82-
8377 public void testReloadCredentialsFromKeystore () throws IOException {
8478 final TestHarness testHarness = new TestHarness ();
8579 testHarness .putRepository ();
@@ -88,7 +82,7 @@ public void testReloadCredentialsFromKeystore() throws IOException {
8882 final String accessKey1 = randomIdentifier ();
8983 repositoryAccessKey = accessKey1 ;
9084 keystoreSettings .put ("s3.client.default.access_key" , accessKey1 );
91- keystoreSettings .put ("s3.client.default.secret_key" , randomIdentifier ());
85+ keystoreSettings .put ("s3.client.default.secret_key" , randomSecretKey ());
9286 cluster .updateStoredSecureSettings ();
9387 assertOK (client ().performRequest (new Request ("POST" , "/_nodes/reload_secure_settings" )));
9488
@@ -128,9 +122,9 @@ public void testReloadCredentialsFromAlternativeClient() throws IOException {
128122
129123 repositoryAccessKey = accessKey1 ;
130124 keystoreSettings .put ("s3.client.default.access_key" , accessKey1 );
131- keystoreSettings .put ("s3.client.default.secret_key" , randomIdentifier ());
125+ keystoreSettings .put ("s3.client.default.secret_key" , randomSecretKey ());
132126 keystoreSettings .put ("s3.client." + alternativeClient + ".access_key" , accessKey2 );
133- keystoreSettings .put ("s3.client." + alternativeClient + ".secret_key" , randomIdentifier ());
127+ keystoreSettings .put ("s3.client." + alternativeClient + ".secret_key" , randomSecretKey ());
134128 cluster .updateStoredSecureSettings ();
135129 assertOK (client ().performRequest (new Request ("POST" , "/_nodes/reload_secure_settings" )));
136130
@@ -164,7 +158,7 @@ public void testReloadCredentialsFromMetadata() throws IOException {
164158 final String accessKey1 = randomIdentifier ();
165159 final String accessKey2 = randomValueOtherThan (accessKey1 , ESTestCase ::randomIdentifier );
166160
167- testHarness .putRepository (b -> b .put ("access_key" , accessKey1 ).put ("secret_key" , randomIdentifier ()));
161+ testHarness .putRepository (b -> b .put ("access_key" , accessKey1 ).put ("secret_key" , randomSecretKey ()));
168162 repositoryAccessKey = accessKey1 ;
169163
170164 testHarness .createFrozenSearchableSnapshotIndex ();
@@ -182,7 +176,7 @@ public void testReloadCredentialsFromMetadata() throws IOException {
182176
183177 // Adjust repository to use new client
184178 logger .info ("--> update repository metadata" );
185- testHarness .putRepository (b -> b .put ("access_key" , accessKey2 ).put ("secret_key" , randomIdentifier ()));
179+ testHarness .putRepository (b -> b .put ("access_key" , accessKey2 ).put ("secret_key" , randomSecretKey ()));
186180
187181 // Check access using refreshed credentials
188182 logger .info ("--> expect success" );
0 commit comments