diff --git a/plugins/arrow-flight-rpc/src/test/java/org/opensearch/arrow/flight/FlightStreamPluginTests.java b/plugins/arrow-flight-rpc/src/test/java/org/opensearch/arrow/flight/FlightStreamPluginTests.java index 3a2dbef4c0fff..6b691d69c7cc7 100644 --- a/plugins/arrow-flight-rpc/src/test/java/org/opensearch/arrow/flight/FlightStreamPluginTests.java +++ b/plugins/arrow-flight-rpc/src/test/java/org/opensearch/arrow/flight/FlightStreamPluginTests.java @@ -42,7 +42,7 @@ public class FlightStreamPluginTests extends OpenSearchTestCase { @Override public void setUp() throws Exception { super.setUp(); - settings = Settings.builder().put("node.attr.transport.stream.port", "9880").put(ARROW_STREAMS_SETTING.getKey(), true).build(); + settings = Settings.builder().put(ARROW_STREAMS_SETTING.getKey(), true).build(); clusterService = mock(ClusterService.class); ClusterState clusterState = mock(ClusterState.class); DiscoveryNodes nodes = mock(DiscoveryNodes.class); @@ -53,10 +53,7 @@ public void setUp() throws Exception { public void testPluginEnableAndDisable() throws IOException { - Settings disabledSettings = Settings.builder() - .put("node.attr.transport.stream.port", "9880") - .put(ARROW_STREAMS_SETTING.getKey(), false) - .build(); + Settings disabledSettings = Settings.builder().put(ARROW_STREAMS_SETTING.getKey(), false).build(); FeatureFlags.initializeFeatureFlags(disabledSettings); FlightStreamPlugin disabledPlugin = new FlightStreamPlugin(disabledSettings); diff --git a/plugins/arrow-flight-rpc/src/test/java/org/opensearch/arrow/flight/bootstrap/ServerConfigTests.java b/plugins/arrow-flight-rpc/src/test/java/org/opensearch/arrow/flight/bootstrap/ServerConfigTests.java index 8324906976ec8..9419e26318046 100644 --- a/plugins/arrow-flight-rpc/src/test/java/org/opensearch/arrow/flight/bootstrap/ServerConfigTests.java +++ b/plugins/arrow-flight-rpc/src/test/java/org/opensearch/arrow/flight/bootstrap/ServerConfigTests.java @@ -22,7 +22,6 @@ public class ServerConfigTests extends OpenSearchTestCase { public void setUp() throws Exception { super.setUp(); settings = Settings.builder() - .put("node.attr.transport.stream.port", 9880) .put("arrow.allocation.manager.type", "Netty") .put("arrow.enable_null_check_for_get", false) .put("arrow.enable_unsafe_memory_access", true) diff --git a/plugins/arrow-flight-rpc/src/test/resources/org/opensearch/bootstrap/test.policy b/plugins/arrow-flight-rpc/src/test/resources/org/opensearch/bootstrap/test.policy new file mode 100644 index 0000000000000..cc8856b3ab199 --- /dev/null +++ b/plugins/arrow-flight-rpc/src/test/resources/org/opensearch/bootstrap/test.policy @@ -0,0 +1,35 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +grant codeBase "${codebase.grpc-netty-shaded}" { + permission java.net.SocketPermission "*", "accept,connect,listen,resolve"; + permission java.lang.RuntimePermission "*", "setContextClassLoader"; +}; + +grant codeBase "${codebase.grpc-core}" { + permission java.net.SocketPermission "*", "accept,connect,listen,resolve"; + permission java.lang.RuntimePermission "*", "setContextClassLoader"; +}; + +grant { + // arrow flight service permissions + permission java.util.PropertyPermission "arrow.allocation.manager.type", "write"; + permission java.util.PropertyPermission "arrow.enable_null_check_for_get", "write"; + permission java.util.PropertyPermission "arrow.enable_unsafe_memory_access", "write"; + permission java.util.PropertyPermission "arrow.memory.debug.allocator", "write"; + + permission java.util.PropertyPermission "io.netty.tryReflectionSetAccessible", "write"; + permission java.util.PropertyPermission "io.netty.allocator.numDirectArenas", "write"; + permission java.util.PropertyPermission "io.netty.noUnsafe", "write"; + permission java.util.PropertyPermission "io.netty.tryUnsafe", "write"; + + // Needed for netty based arrow flight server for netty configs related to buffer allocator + permission java.security.AllPermission "modifyThreadGroup"; + permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; + permission java.util.PropertyPermission "arrow.allocation.manager.type", "write"; +};