Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions test/src/test/java/jenkins/agents/InboundAgentTlsTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package jenkins.agents;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.InboundAgentRule;
import org.jvnet.hudson.test.RealJenkinsRule;

public class InboundAgentTlsTest {

@Rule
public final RealJenkinsRule rjr = new RealJenkinsRule().https();

@Rule
public InboundAgentRule iar = new InboundAgentRule();

@Before
public void setUp() throws Throwable {
rjr.startJenkins();
}

@Test
public void webSocketNoCertificateCheck() throws Throwable {
var options = InboundAgentRule.Options
.newBuilder()
.webSocket()
.noCertificateCheck();
iar.createAgent(rjr, options.build());
}

@Test
public void webSocketWithCertByValue() throws Throwable {
var options = InboundAgentRule.Options
.newBuilder()
.webSocket()
.cert(rjr.getRootCAPem());
iar.createAgent(rjr, options.build());
}

@Test
public void tcpWithNoCertificateCheck() throws Throwable {
var options = InboundAgentRule.Options
.newBuilder()
.noCertificateCheck();
iar.createAgent(rjr, options.build());
}

@Test
public void tcpWithCertByValue() throws Throwable {
var options = InboundAgentRule.Options
.newBuilder()
.cert(rjr.getRootCAPem());
iar.createAgent(rjr, options.build());
}
}
Loading