Add missing entries to conffiles (#35810)

This commit is contained in:
Alpar Torok 2018-11-27 16:38:56 +02:00 committed by GitHub
parent 1da9c6faa0
commit 541869a96a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 55 additions and 10 deletions

View File

@ -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

View File

@ -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(

View File

@ -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 -> {
).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));
});
}
}

View File

@ -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),