Skip to content

Commit

Permalink
oncrpc: bind service to localhost during unit testing.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kofemann committed Mar 25, 2019
1 parent 8a994e9 commit d7f934b
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public void DumpTest() throws IOException, TimeoutException {
.withTCP()
.withUDP()
.withoutAutoPublish()
.withBindAddress("127.0.0.1")
.withRpcService(new OncRpcProgram(OncRpcPortmap.PORTMAP_PROGRAMM, OncRpcPortmap.PORTMAP_V2), new OncRpcbindServer())
.build();
rpcbindServer.start();
Expand All @@ -36,6 +37,7 @@ public void SetUnsetTest() throws IOException, TimeoutException {
OncRpcSvc rpcbindServer = new OncRpcSvcBuilder()
.withTCP()
.withUDP()
.withBindAddress("127.0.0.1")
.withoutAutoPublish()
.withRpcService(new OncRpcProgram(OncRpcPortmap.PORTMAP_PROGRAMM, OncRpcPortmap.PORTMAP_V2), new OncRpcbindServer())
.build();
Expand Down

0 comments on commit d7f934b

Please sign in to comment.