File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
test/src/test/java/jenkins/agents Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ package jenkins .agents ;
2+
3+ import org .junit .Before ;
4+ import org .junit .Rule ;
5+ import org .junit .Test ;
6+ import org .jvnet .hudson .test .InboundAgentRule ;
7+ import org .jvnet .hudson .test .RealJenkinsRule ;
8+
9+ public class TLSCustomCertificateTest {
10+
11+ @ Rule
12+ public final RealJenkinsRule rjr = new RealJenkinsRule ().https ();
13+
14+ @ Rule
15+ public InboundAgentRule iar = new InboundAgentRule ();
16+
17+ @ Before
18+ public void setUp () throws Throwable {
19+ rjr .startJenkins ();
20+ }
21+
22+ @ Test
23+ public void test_noCertificateCheck_worksInWebSocketAgent () throws Throwable {
24+ // TODO need to configure `-noCertificateCheck` option
25+ var options = InboundAgentRule .Options
26+ .newBuilder ()
27+ .webSocket ();
28+
29+ iar .createAgent (rjr , options .build ());
30+ // try to run a build to ensure agent is connected.
31+ }
32+
33+ @ Test
34+ public void test_cert_worksInWebSocketAgent () throws Throwable {
35+ // TODO need to configure `-cert` option with passing the rootCA as a string variable
36+ var options = InboundAgentRule .Options
37+ .newBuilder ()
38+ .webSocket ();
39+
40+ iar .createAgent (rjr , options .build ());
41+ // try to run a build to ensure agent is connected.
42+ }
43+ }
You can’t perform that action at this time.
0 commit comments