Logging: Skip test if it'd fail
If we're running on a platform where we can't install syscall filters Elasticsearch logs a message before it reads the data directory to get the node name. Because that log message doesn't have a node name this test will fail. Since we mostly run the test on OSes where we *can* install the syscall filters we can fairly safely skip the test on OSes where we can't install the syscall filters. Closes #33540
This commit is contained in:
parent
0b62d6bb9d
commit
97736ac46a
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
package org.elasticsearch.unconfigured_node_name;
|
package org.elasticsearch.unconfigured_node_name;
|
||||||
|
|
||||||
|
import org.elasticsearch.bootstrap.BootstrapInfo;
|
||||||
import org.elasticsearch.common.logging.NodeNameInLogsIntegTestCase;
|
import org.elasticsearch.common.logging.NodeNameInLogsIntegTestCase;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -32,6 +33,8 @@ import java.security.PrivilegedAction;
|
||||||
public class NodeNameInLogsIT extends NodeNameInLogsIntegTestCase {
|
public class NodeNameInLogsIT extends NodeNameInLogsIntegTestCase {
|
||||||
@Override
|
@Override
|
||||||
protected BufferedReader openReader(Path logFile) throws IOException {
|
protected BufferedReader openReader(Path logFile) throws IOException {
|
||||||
|
assumeTrue("We log a line without the node name if we can't install the seccomp filters",
|
||||||
|
BootstrapInfo.isSystemCallFilterInstalled());
|
||||||
return AccessController.doPrivileged((PrivilegedAction<BufferedReader>) () -> {
|
return AccessController.doPrivileged((PrivilegedAction<BufferedReader>) () -> {
|
||||||
try {
|
try {
|
||||||
return Files.newBufferedReader(logFile, StandardCharsets.UTF_8);
|
return Files.newBufferedReader(logFile, StandardCharsets.UTF_8);
|
||||||
|
|
Loading…
Reference in New Issue