Github user squito commented on a diff in the pull request:
https://github.com/apache/spark/pull/8218#discussion_r37155626
--- Diff:
network/shuffle/src/test/java/org/apache/spark/network/sasl/SaslIntegrationSuite.java
---
@@ -160,6 +164,111 @@ public void testNoSaslServer() {
}
}
+ /**
+ * This test is not actually testing SASL behavior, but testing that the
shuffle service
+ * performs correct authorization checks based on the SASL
authentication data.
+ */
+ @Test
+ public void testAppIsolation() throws Exception {
+ // Start a new server with the correct RPC handler to serve block data.
+ ExternalShuffleBlockResolver blockResolver =
mock(ExternalShuffleBlockResolver.class);
+ ExternalShuffleBlockHandler blockHandler = new
ExternalShuffleBlockHandler(
+ new OneForOneStreamManager(), blockResolver);
+ TransportServerBootstrap bootstrap = new SaslServerBootstrap(conf,
secretKeyHolder);
+ TransportContext blockServerContext = new TransportContext(conf,
blockHandler);
+ TransportServer blockServer =
blockServerContext.createServer(Arrays.asList(bootstrap));
+
+ TransportClient client1 = null;
+ TransportClient client2 = null;
+ TransportClientFactory clientFactory2 = null;
+ try {
+ // Create a client, and make a request to fetch blocks from a
different app.
+ clientFactory = blockServerContext.createClientFactory(
+ Lists.<TransportClientBootstrap>newArrayList(
+ new SaslClientBootstrap(conf, "app-1", secretKeyHolder)));
+ client1 = clientFactory.createClient(TestUtils.getLocalHost(),
+ blockServer.getPort());
+
+ final AtomicBoolean result = new AtomicBoolean(false);
--- End diff --
how about renaming this to `gotException`? I was momentarily confused
thinking this was the result of a successful request.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]