-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HDDS-1903 : Use dynamic ports for SCM in TestSCMClientProtocolServer … #1303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
deeb34b
9dc61c3
054a800
fa94355
169a0f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,9 +16,16 @@ | |
| */ | ||
| package org.apache.hadoop.hdds.scm.server; | ||
|
|
||
| import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_SECURITY_SERVICE_ADDRESS_KEY; | ||
| import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_SECURITY_SERVICE_BIND_HOST_DEFAULT; | ||
|
|
||
| import java.net.ServerSocket; | ||
|
|
||
| import org.apache.commons.lang3.StringUtils; | ||
| import org.apache.hadoop.hdds.conf.OzoneConfiguration; | ||
| import org.junit.After; | ||
| import org.junit.Before; | ||
| import org.junit.BeforeClass; | ||
| import org.junit.Rule; | ||
| import org.junit.Test; | ||
| import org.junit.rules.Timeout; | ||
|
|
@@ -32,10 +39,19 @@ public class TestSCMSecurityProtocolServer { | |
|
|
||
| @Rule | ||
| public Timeout timeout = new Timeout(1000 * 20); | ||
| private static int scmRpcSecurePort; | ||
|
|
||
| @BeforeClass | ||
| public static void setupClass() throws Exception { | ||
| scmRpcSecurePort = new ServerSocket(0).getLocalPort(); | ||
| } | ||
|
|
||
| @Before | ||
| public void setUp() throws Exception { | ||
| config = new OzoneConfiguration(); | ||
| config.set(OZONE_SCM_SECURITY_SERVICE_ADDRESS_KEY, | ||
| StringUtils.join(OZONE_SCM_SECURITY_SERVICE_BIND_HOST_DEFAULT, | ||
| ":", String.valueOf(scmRpcSecurePort))); | ||
|
||
| securityProtocolServer = new SCMSecurityProtocolServer(config, null); | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.