Skip to content

Commit ef48222

Browse files
authored
Fix MapperSizeClientYamlTestSuiteIT when FIPS is enabled (#93357) (#93365)
The issue with this test failure is actually that we were silently failing to install the plugin under test into the cluster. The root cause here was the FIPS security policy file was not copied into cluster config directory before we attempting to run the plugin installer. Since we pass the FIPS JVM arguments to all CLI tools as well this caused plugin installation to fail. We now ensure that these files are copied before we attempt to run _any_ ES tools. Closes #93303
1 parent 8bc2312 commit ef48222

File tree

2 files changed

+14
-11
lines changed
  • plugins/mapper-size/src/yamlRestTest/resources/rest-api-spec/test/mapper_size
  • test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local

2 files changed

+14
-11
lines changed

plugins/mapper-size/src/yamlRestTest/resources/rest-api-spec/test/mapper_size/10_basic.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
---
55
"Mapper Size":
66

7-
- skip:
8-
version: "all"
9-
reason: "AwaitsFix https://github.com/elastic/elasticsearch/issues/93303"
10-
117
- do:
128
indices.create:
139
index: test

test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/LocalClusterFactory.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,22 +107,20 @@ public synchronized void start() {
107107
distributionDescriptor = resolveDistribution();
108108
LOGGER.info("Distribution for node '{}': {}", spec.getName(), distributionDescriptor);
109109
initializeWorkingDirectory();
110+
createConfigDirectory();
111+
copyExtraConfigFiles(); // extra config files might be needed for running cli tools like plugin install
110112
copyExtraJarFiles();
111113
installPlugins();
112114
if (spec.getDistributionType() == DistributionType.INTEG_TEST) {
113115
installModules();
114116
}
115117
initialized = true;
118+
} else {
119+
createConfigDirectory();
120+
copyExtraConfigFiles();
116121
}
117122

118-
try {
119-
IOUtils.deleteWithRetry(configDir);
120-
Files.createDirectories(configDir);
121-
} catch (IOException e) {
122-
throw new UncheckedIOException("An error occurred creating config directory", e);
123-
}
124123
writeConfiguration();
125-
copyExtraConfigFiles();
126124
createKeystore();
127125
addKeystoreSettings();
128126
configureSecurity();
@@ -188,6 +186,15 @@ public void waitUntilReady() {
188186
}
189187
}
190188

189+
private void createConfigDirectory() {
190+
try {
191+
IOUtils.deleteWithRetry(configDir);
192+
Files.createDirectories(configDir);
193+
} catch (IOException e) {
194+
throw new UncheckedIOException("An error occurred creating config directory", e);
195+
}
196+
}
197+
191198
private List<String> readPortsFile(Path file) {
192199
try (Stream<String> lines = Files.lines(file, StandardCharsets.UTF_8)) {
193200
return lines.map(String::trim).collect(Collectors.toList());

0 commit comments

Comments
 (0)