Skip to content

Commit d7f934b

Browse files
committed
oncrpc: bind service to localhost during unit testing.
Motivation: java.net.SocketException: Network is unreachable at sun.nio.ch.Net.connect0(Native Method) at sun.nio.ch.Net.connect(Net.java:454) at sun.nio.ch.Net.connect(Net.java:446) at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:648) Acked-by: Paul Millar Target: master, 3.0
1 parent 8a994e9 commit d7f934b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

oncrpc4j-core/src/test/java/org/dcache/oncrpc4j/rpc/TestGitHubIssue56.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public void DumpTest() throws IOException, TimeoutException {
2020
.withTCP()
2121
.withUDP()
2222
.withoutAutoPublish()
23+
.withBindAddress("127.0.0.1")
2324
.withRpcService(new OncRpcProgram(OncRpcPortmap.PORTMAP_PROGRAMM, OncRpcPortmap.PORTMAP_V2), new OncRpcbindServer())
2425
.build();
2526
rpcbindServer.start();
@@ -36,6 +37,7 @@ public void SetUnsetTest() throws IOException, TimeoutException {
3637
OncRpcSvc rpcbindServer = new OncRpcSvcBuilder()
3738
.withTCP()
3839
.withUDP()
40+
.withBindAddress("127.0.0.1")
3941
.withoutAutoPublish()
4042
.withRpcService(new OncRpcProgram(OncRpcPortmap.PORTMAP_PROGRAMM, OncRpcPortmap.PORTMAP_V2), new OncRpcbindServer())
4143
.build();

0 commit comments

Comments
 (0)