From 97736ac46a54073cf7081e9ed08bccbdac79ea6a Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Fri, 7 Sep 2018 21:42:58 -0400 Subject: [PATCH] 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 --- .../elasticsearch/unconfigured_node_name/NodeNameInLogsIT.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qa/unconfigured-node-name/src/test/java/org/elasticsearch/unconfigured_node_name/NodeNameInLogsIT.java b/qa/unconfigured-node-name/src/test/java/org/elasticsearch/unconfigured_node_name/NodeNameInLogsIT.java index 512fc234554..76bc9fa4d55 100644 --- a/qa/unconfigured-node-name/src/test/java/org/elasticsearch/unconfigured_node_name/NodeNameInLogsIT.java +++ b/qa/unconfigured-node-name/src/test/java/org/elasticsearch/unconfigured_node_name/NodeNameInLogsIT.java @@ -19,6 +19,7 @@ package org.elasticsearch.unconfigured_node_name; +import org.elasticsearch.bootstrap.BootstrapInfo; import org.elasticsearch.common.logging.NodeNameInLogsIntegTestCase; import java.io.IOException; @@ -32,6 +33,8 @@ import java.security.PrivilegedAction; public class NodeNameInLogsIT extends NodeNameInLogsIntegTestCase { @Override 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) () -> { try { return Files.newBufferedReader(logFile, StandardCharsets.UTF_8);