|
@@ -129,11 +129,10 @@ public class EnvironmentTests extends ESTestCase {
|
|
|
final Settings settings =
|
|
|
Settings.builder()
|
|
|
.put("path.home", pathHome)
|
|
|
- .put("node.local_storage", false)
|
|
|
.put("node.master", false)
|
|
|
.put("node.data", false)
|
|
|
.build();
|
|
|
- final Environment environment = new Environment(settings, null);
|
|
|
+ final Environment environment = new Environment(settings, null, false);
|
|
|
assertThat(environment.dataFiles(), arrayWithSize(0));
|
|
|
}
|
|
|
|
|
@@ -144,11 +143,10 @@ public class EnvironmentTests extends ESTestCase {
|
|
|
Settings.builder()
|
|
|
.put("path.home", pathHome)
|
|
|
.put("path.data", pathData)
|
|
|
- .put("node.local_storage", false)
|
|
|
.put("node.master", false)
|
|
|
.put("node.data", false)
|
|
|
.build();
|
|
|
- final IllegalStateException e = expectThrows(IllegalStateException.class, () -> new Environment(settings, null));
|
|
|
+ final IllegalStateException e = expectThrows(IllegalStateException.class, () -> new Environment(settings, null, false));
|
|
|
assertThat(e, hasToString(containsString("node does not require local storage yet path.data is set to [" + pathData + "]")));
|
|
|
}
|
|
|
|
|
@@ -156,7 +154,7 @@ public class EnvironmentTests extends ESTestCase {
|
|
|
Settings build = Settings.builder()
|
|
|
.put(Environment.PATH_HOME_SETTING.getKey(), createTempDir())
|
|
|
.build();
|
|
|
- Environment environment = new Environment(build, null, createTempDir().resolve("this_does_not_exist"));
|
|
|
+ Environment environment = new Environment(build, null, true, createTempDir().resolve("this_does_not_exist"));
|
|
|
FileNotFoundException e = expectThrows(FileNotFoundException.class, environment::validateTmpFile);
|
|
|
assertThat(e.getMessage(), startsWith("Temporary file directory ["));
|
|
|
assertThat(e.getMessage(), endsWith("this_does_not_exist] does not exist or is not accessible"));
|
|
@@ -166,7 +164,7 @@ public class EnvironmentTests extends ESTestCase {
|
|
|
Settings build = Settings.builder()
|
|
|
.put(Environment.PATH_HOME_SETTING.getKey(), createTempDir())
|
|
|
.build();
|
|
|
- Environment environment = new Environment(build, null, createTempFile("something", ".test"));
|
|
|
+ Environment environment = new Environment(build, null, true, createTempFile("something", ".test"));
|
|
|
IOException e = expectThrows(IOException.class, environment::validateTmpFile);
|
|
|
assertThat(e.getMessage(), startsWith("Configured temporary file directory ["));
|
|
|
assertThat(e.getMessage(), endsWith(".test] is not a directory"));
|
|
@@ -186,7 +184,7 @@ public class EnvironmentTests extends ESTestCase {
|
|
|
// the above paths will be treated as relative to the working directory
|
|
|
final Path workingDirectory = PathUtils.get(System.getProperty("user.dir"));
|
|
|
|
|
|
- final Environment environment = new Environment(settings, null, createTempDir());
|
|
|
+ final Environment environment = new Environment(settings, null, true, createTempDir());
|
|
|
final String homePath = Environment.PATH_HOME_SETTING.get(environment.settings());
|
|
|
assertPath(homePath, workingDirectory.resolve("home"));
|
|
|
|