Skip to content

Commit f77d575

Browse files
ldematteafoucret
authored andcommitted
Create test entitlement libs dir and jar to pass validation (elastic#123013)
1 parent 5051ebe commit f77d575

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

distribution/tools/server-cli/src/test/java/org/elasticsearch/server/cli/JvmOptionsParserTests.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@
1111

1212
import org.elasticsearch.common.settings.Settings;
1313
import org.elasticsearch.common.util.concurrent.EsExecutors;
14+
import org.elasticsearch.core.IOUtils;
1415
import org.elasticsearch.core.Strings;
1516
import org.elasticsearch.test.ESTestCase;
1617
import org.elasticsearch.test.ESTestCase.WithoutSecurityManager;
18+
import org.junit.AfterClass;
19+
import org.junit.BeforeClass;
1720

1821
import java.io.BufferedReader;
1922
import java.io.IOException;
@@ -44,6 +47,19 @@ public class JvmOptionsParserTests extends ESTestCase {
4447

4548
private static final Map<String, String> TEST_SYSPROPS = Map.of("os.name", "Linux", "os.arch", "aarch64");
4649

50+
private static final Path ENTITLEMENTS_LIB_DIR = Path.of("lib", "entitlement-bridge");
51+
52+
@BeforeClass
53+
public static void beforeClass() throws IOException {
54+
Files.createDirectories(ENTITLEMENTS_LIB_DIR);
55+
Files.createTempFile(ENTITLEMENTS_LIB_DIR, "mock-entitlements-bridge", ".jar");
56+
}
57+
58+
@AfterClass
59+
public static void afterClass() throws IOException {
60+
IOUtils.rm(Path.of("lib"));
61+
}
62+
4763
public void testSubstitution() {
4864
final List<String> jvmOptions = JvmOptionsParser.substitutePlaceholders(
4965
List.of("-Djava.io.tmpdir=${ES_TMPDIR}"),

0 commit comments

Comments
 (0)