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/elasticsearch.yml'
|
||||||
configurationFile '/etc/elasticsearch/jvm.options'
|
configurationFile '/etc/elasticsearch/jvm.options'
|
||||||
configurationFile '/etc/elasticsearch/log4j2.properties'
|
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') {
|
into('/etc/elasticsearch') {
|
||||||
dirMode 0750
|
dirMode 0750
|
||||||
fileMode 0660
|
fileMode 0660
|
||||||
|
|
|
@ -87,6 +87,16 @@ public abstract class DebPreservationTestCase extends PackagingTestCase {
|
||||||
installation.config("log4j2.properties")
|
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
|
// keystore was removed
|
||||||
|
|
||||||
assertPathsDontExist(
|
assertPathsDontExist(
|
||||||
|
|
|
@ -100,10 +100,22 @@ public abstract class RpmPreservationTestCase extends PackagingTestCase {
|
||||||
|
|
||||||
sh.run("echo foobar | " + installation.executables().elasticsearchKeystore + " add --stdin foo.bar");
|
sh.run("echo foobar | " + installation.executables().elasticsearchKeystore + " add --stdin foo.bar");
|
||||||
Stream.of(
|
Stream.of(
|
||||||
installation.config("elasticsearch.yml"),
|
"elasticsearch.yml",
|
||||||
installation.config("jvm.options"),
|
"jvm.options",
|
||||||
installation.config("log4j2.properties")
|
"log4j2.properties"
|
||||||
).forEach(path -> append(path, "# foo"));
|
)
|
||||||
|
.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());
|
remove(distribution());
|
||||||
assertRemoved(distribution());
|
assertRemoved(distribution());
|
||||||
|
@ -131,11 +143,22 @@ public abstract class RpmPreservationTestCase extends PackagingTestCase {
|
||||||
"elasticsearch.yml",
|
"elasticsearch.yml",
|
||||||
"jvm.options",
|
"jvm.options",
|
||||||
"log4j2.properties"
|
"log4j2.properties"
|
||||||
).forEach(configFile -> {
|
).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 original = installation.config(configFile);
|
||||||
final Path saved = installation.config(configFile + ".rpmsave");
|
final Path saved = installation.config(configFile + ".rpmsave");
|
||||||
assertFalse(original + " should not exist", Files.exists(original));
|
assertFalse(original + " should not exist", Files.exists(original));
|
||||||
assertTrue(saved + " should exist", Files.exists(saved));
|
assertTrue(saved + " should exist", Files.exists(saved));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,14 @@ public enum Distribution {
|
||||||
return flavor.name + "-" + version + packaging.extension;
|
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 {
|
public enum Packaging {
|
||||||
|
|
||||||
TAR(".tar.gz", Platforms.LINUX),
|
TAR(".tar.gz", Platforms.LINUX),
|
||||||
|
|
Loading…
Reference in New Issue