Add missing entries to conffiles (#35810)
This commit is contained in:
parent
1da9c6faa0
commit
541869a96a
|
@ -167,6 +167,10 @@ Closure commonPackageConfig(String type, boolean oss) {
|
|||
configurationFile '/etc/elasticsearch/elasticsearch.yml'
|
||||
configurationFile '/etc/elasticsearch/jvm.options'
|
||||
configurationFile '/etc/elasticsearch/log4j2.properties'
|
||||
configurationFile '/etc/elasticsearch/role_mapping.yml'
|
||||
configurationFile '/etc/elasticsearch/roles.yml'
|
||||
configurationFile '/etc/elasticsearch/users'
|
||||
configurationFile '/etc/elasticsearch/users_roles'
|
||||
into('/etc/elasticsearch') {
|
||||
dirMode 0750
|
||||
fileMode 0660
|
||||
|
|
|
@ -87,6 +87,16 @@ public abstract class DebPreservationTestCase extends PackagingTestCase {
|
|||
installation.config("log4j2.properties")
|
||||
);
|
||||
|
||||
if (distribution().isDefault()) {
|
||||
assertPathsExist(
|
||||
installation.config,
|
||||
installation.config("role_mapping.yml"),
|
||||
installation.config("roles.yml"),
|
||||
installation.config("users"),
|
||||
installation.config("users_roles")
|
||||
);
|
||||
}
|
||||
|
||||
// keystore was removed
|
||||
|
||||
assertPathsDontExist(
|
||||
|
|
|
@ -100,10 +100,22 @@ public abstract class RpmPreservationTestCase extends PackagingTestCase {
|
|||
|
||||
sh.run("echo foobar | " + installation.executables().elasticsearchKeystore + " add --stdin foo.bar");
|
||||
Stream.of(
|
||||
installation.config("elasticsearch.yml"),
|
||||
installation.config("jvm.options"),
|
||||
installation.config("log4j2.properties")
|
||||
).forEach(path -> append(path, "# foo"));
|
||||
"elasticsearch.yml",
|
||||
"jvm.options",
|
||||
"log4j2.properties"
|
||||
)
|
||||
.map(each -> installation.config(each))
|
||||
.forEach(path -> append(path, "# foo"));
|
||||
if (distribution().isDefault()) {
|
||||
Stream.of(
|
||||
"role_mapping.yml",
|
||||
"roles.yml",
|
||||
"users",
|
||||
"users_roles"
|
||||
)
|
||||
.map(each -> installation.config(each))
|
||||
.forEach(path -> append(path, "# foo"));
|
||||
}
|
||||
|
||||
remove(distribution());
|
||||
assertRemoved(distribution());
|
||||
|
@ -131,11 +143,22 @@ public abstract class RpmPreservationTestCase extends PackagingTestCase {
|
|||
"elasticsearch.yml",
|
||||
"jvm.options",
|
||||
"log4j2.properties"
|
||||
).forEach(configFile -> {
|
||||
final Path original = installation.config(configFile);
|
||||
final Path saved = installation.config(configFile + ".rpmsave");
|
||||
assertFalse(original + " should not exist", Files.exists(original));
|
||||
assertTrue(saved + " should exist", Files.exists(saved));
|
||||
});
|
||||
).forEach(this::assertConfFilePreserved);
|
||||
|
||||
if (distribution().isDefault()) {
|
||||
Stream.of(
|
||||
"role_mapping.yml",
|
||||
"roles.yml",
|
||||
"users",
|
||||
"users_roles"
|
||||
).forEach(this::assertConfFilePreserved);
|
||||
}
|
||||
}
|
||||
|
||||
private void assertConfFilePreserved(String configFile) {
|
||||
final Path original = installation.config(configFile);
|
||||
final Path saved = installation.config(configFile + ".rpmsave");
|
||||
assertFalse(original + " should not exist", Files.exists(original));
|
||||
assertTrue(saved + " should exist", Files.exists(saved));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,6 +43,14 @@ public enum Distribution {
|
|||
return flavor.name + "-" + version + packaging.extension;
|
||||
}
|
||||
|
||||
public boolean isDefault() {
|
||||
return flavor.equals(Flavor.DEFAULT);
|
||||
}
|
||||
|
||||
public boolean isOSS() {
|
||||
return flavor.equals(Flavor.OSS);
|
||||
}
|
||||
|
||||
public enum Packaging {
|
||||
|
||||
TAR(".tar.gz", Platforms.LINUX),
|
||||
|
|
Loading…
Reference in New Issue