Skip to content

Commit 64f096c

Browse files
committed
Tests: syslog send error handling test added.
1 parent 61aa3ec commit 64f096c

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

syslog.t

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ select STDOUT; $| = 1;
2626

2727
plan(skip_all => 'win32') if $^O eq 'MSWin32';
2828

29-
my $t = Test::Nginx->new()->has(qw/http limit_req/)->plan(59);
29+
my $t = Test::Nginx->new()->has(qw/http limit_req/)->plan(61);
3030

3131
$t->write_file_expand('nginx.conf', <<'EOF');
3232
@@ -231,6 +231,27 @@ like(get_syslog('/nohostname'),
231231
(.*)/x, # MSG
232232
'nohostname');
233233

234+
# send error handling
235+
236+
ok(get_syslog('/a'), 'send success');
237+
238+
close $s;
239+
240+
get_syslog('/a');
241+
get_syslog('/a');
242+
243+
$s = IO::Socket::INET->new(
244+
Proto => 'udp',
245+
LocalAddr => '127.0.0.1:' . port(8984)
246+
)
247+
or die "Can't open syslog socket: $!";
248+
249+
ok(get_syslog('/a'), 'send error - recover');
250+
251+
# broken in fa0e093b64d7
252+
253+
$t->todo_alerts() if $t->has_version('1.15.0');
254+
234255
###############################################################################
235256

236257
sub syslog_lines {

0 commit comments

Comments
 (0)