Skip to content

Commit

Permalink
test: introduce constant for op NULL
Browse files Browse the repository at this point in the history
Acked-by: Paul Millar
Target: master
  • Loading branch information
kofemann committed Apr 12, 2019
1 parent f07892e commit 23a712d
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class ClientServerTLSTest {
private static final int PROGNUM = 100017;
private static final int PROGVER = 1;

private static final int NULL = 0;
private static final int ECHO = 1;
private static final int UPPER = 2;

Expand All @@ -71,7 +72,7 @@ public class ClientServerTLSTest {
call.reply(s);
break;
}
case 0: {
case NULL: {
call.reply(XdrVoid.XDR_VOID);
}
}
Expand Down Expand Up @@ -272,7 +273,7 @@ public void shouldFailWhenNoTLSOnClient() throws IOException {
RpcTransport t = clnt.connect(svc.getInetSocketAddress(IpProtocolType.TCP));
clntCall = new RpcCall(PROGNUM, PROGVER, new RpcAuthTypeNone(), t);
// poke server to start tls
clntCall.call(0, XdrVoid.XDR_VOID, XdrVoid.XDR_VOID, new RpcAuthTypeTls());
clntCall.call(NULL, XdrVoid.XDR_VOID, XdrVoid.XDR_VOID, new RpcAuthTypeTls());
clntCall.getTransport().startTLS();
}

Expand Down Expand Up @@ -309,7 +310,7 @@ public void shouldFailSecondStartTLS() throws IOException {
RpcTransport t = clnt.connect(svc.getInetSocketAddress(IpProtocolType.TCP));
clntCall = new RpcCall(PROGNUM, PROGVER, new RpcAuthTypeNone(), t);
// poke server to start tls
clntCall.call(0, XdrVoid.XDR_VOID, XdrVoid.XDR_VOID, new RpcAuthTypeTls());
clntCall.call(NULL, XdrVoid.XDR_VOID, XdrVoid.XDR_VOID, new RpcAuthTypeTls());
clntCall.getTransport().startTLS();
clntCall.getTransport().startTLS();
}
Expand Down Expand Up @@ -345,7 +346,7 @@ public void shouldRejectStartTlsWhenNotConfigured() throws IOException {
RpcTransport t = clnt.connect(svc.getInetSocketAddress(IpProtocolType.TCP));
// poke server to start tls
clntCall = new RpcCall(PROGNUM, PROGVER, new RpcAuthTypeNone(), t);
clntCall.call(0, XdrVoid.XDR_VOID, XdrVoid.XDR_VOID, new RpcAuthTypeTls());
clntCall.call(NULL, XdrVoid.XDR_VOID, XdrVoid.XDR_VOID, new RpcAuthTypeTls());
}


Expand Down Expand Up @@ -385,9 +386,7 @@ public void shouldRejectTlsWhenClientCertRequired() throws IOException, Exceptio
RpcTransport t = clnt.connect(svc.getInetSocketAddress(IpProtocolType.TCP));
clntCall = new RpcCall(PROGNUM, PROGVER, new RpcAuthTypeNone(), t);

XdrString s = new XdrString("hello");
XdrString reply = new XdrString();
clntCall.call(ECHO, s, reply);
clntCall.call(NULL, XdrVoid.XDR_VOID, new XdrVoid());
}

public static SSLContext createClientSslContext(Certificate certificate) throws Exception {
Expand Down

0 comments on commit 23a712d

Please sign in to comment.