Skip to content

Commit 149a0a1

Browse files
committed
Tests: ACME configuration parsing test.
1 parent 8d21677 commit 149a0a1

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

t/acme_http.t

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#!/usr/bin/perl
2+
3+
# (C) Aleksei Bavshin
4+
# (C) Nginx, Inc.
5+
6+
# Tests for ACME client: HTTP-01 challenge support.
7+
8+
###############################################################################
9+
10+
use warnings;
11+
use strict;
12+
13+
use Test::More;
14+
15+
use IO::Select;
16+
17+
BEGIN { use FindBin; chdir($FindBin::Bin); }
18+
19+
use lib 'lib';
20+
use Test::Nginx;
21+
22+
###############################################################################
23+
24+
select STDERR; $| = 1;
25+
select STDOUT; $| = 1;
26+
27+
my $t = Test::Nginx->new()->has(qw/http socket_ssl/)
28+
->has_daemon('openssl')->has_daemon('pebble');
29+
30+
$t->write_file_expand('nginx.conf', <<'EOF');
31+
32+
%%TEST_GLOBALS%%
33+
34+
daemon off;
35+
36+
events {
37+
}
38+
39+
http {
40+
%%TEST_GLOBALS_HTTP%%
41+
42+
server {
43+
listen 127.0.0.1:8080;
44+
server_name example.test;
45+
}
46+
47+
server {
48+
listen 127.0.0.1:8443 ssl;
49+
server_name example.test;
50+
51+
acme_certificate example.test
52+
issuer=default;
53+
54+
ssl_certificate $acme_certificate;
55+
ssl_certificate_key $acme_certificate_key;
56+
}
57+
58+
acme_issuer default {
59+
uri https://localhost:%%PORT_9000%%/dir;
60+
61+
contact mailto:[email protected];
62+
63+
resolver 127.0.0.1:%%PORT_8980_UDP%%;
64+
resolver_timeout 5s;
65+
66+
state_path %%TESTDIR%%;
67+
}
68+
}
69+
70+
EOF
71+
72+
$t->plan(1)->run();
73+
74+
###############################################################################
75+
76+
pass('no tests yet');
77+
78+
###############################################################################

0 commit comments

Comments
 (0)