From: bluhm Date: Thu, 12 Oct 2023 22:41:29 +0000 (+0000) Subject: Test retry after DNS lookup failure. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=fdc5aacd3979868848c8e039e61fb66e3c53262f;p=openbsd Test retry after DNS lookup failure. --- diff --git a/regress/usr.sbin/syslogd/args-dns-tcp-retry.pl b/regress/usr.sbin/syslogd/args-dns-tcp-retry.pl new file mode 100644 index 00000000000..232854e6c47 --- /dev/null +++ b/regress/usr.sbin/syslogd/args-dns-tcp-retry.pl @@ -0,0 +1,26 @@ +# The client writes a message to Sys::Syslog native method. +# The syslogd writes it into a file and through a pipe. +# The syslogd fails to to do DNS lookup of TCP loghost. +# Find the message in client, file, pipe, syslogd log. +# Check that syslogd log contains dns failures and retry. + +use strict; +use warnings; +use Socket; + +our %args = ( + syslogd => { + loghost => '@tcp://noexist.invalid.:514', + loggrep => { + qr/bad hostname "\@tcp:\/\/noexist.invalid.:514"/ => '>=2', + qr/Logging to FORWTCP \@tcp:\/\/noexist.invalid.:514/ => '>=4', + qr/retry loghost "\@tcp:\/\/noexist.invalid.:514" wait 1/ => 1, + get_testgrep() => 1, + }, + }, + server => { + noserver => 1, + }, +); + +1; diff --git a/regress/usr.sbin/syslogd/args-dns-tls-retry.pl b/regress/usr.sbin/syslogd/args-dns-tls-retry.pl new file mode 100644 index 00000000000..8e604abb490 --- /dev/null +++ b/regress/usr.sbin/syslogd/args-dns-tls-retry.pl @@ -0,0 +1,26 @@ +# The client writes a message to Sys::Syslog native method. +# The syslogd writes it into a file and through a pipe. +# The syslogd fails to to do DNS lookup of TLS loghost. +# Find the message in client, file, pipe, syslogd log. +# Check that syslogd log contains dns failures and retry. + +use strict; +use warnings; +use Socket; + +our %args = ( + syslogd => { + loghost => '@tls://noexist.invalid.:6514', + loggrep => { + qr/bad hostname "\@tls:\/\/noexist.invalid.:6514"/ => '>=2', + qr/Logging to FORWTLS \@tls:\/\/noexist.invalid.:6514/ => '>=4', + qr/retry loghost "\@tls:\/\/noexist.invalid.:6514" wait 1/ => 1, + get_testgrep() => 1, + }, + }, + server => { + noserver => 1, + }, +); + +1; diff --git a/regress/usr.sbin/syslogd/args-dns-udp-retry.pl b/regress/usr.sbin/syslogd/args-dns-udp-retry.pl new file mode 100644 index 00000000000..2d9119cfabf --- /dev/null +++ b/regress/usr.sbin/syslogd/args-dns-udp-retry.pl @@ -0,0 +1,26 @@ +# The client writes a message to Sys::Syslog native method. +# The syslogd writes it into a file and through a pipe. +# The syslogd fails to to do DNS lookup of UDP loghost. +# Find the message in client, file, pipe, syslogd log. +# Check that syslogd log contains dns failures and retry. + +use strict; +use warnings; +use Socket; + +our %args = ( + syslogd => { + loghost => '@udp://noexist.invalid.:514', + loggrep => { + qr/bad hostname "\@udp:\/\/noexist.invalid.:514"/ => '>=2', + qr/Logging to FORWUDP \@udp:\/\/noexist.invalid.:514/ => '>=4', + qr/retry loghost "\@udp:\/\/noexist.invalid.:514" wait 1/ => 1, + get_testgrep() => 1, + }, + }, + server => { + noserver => 1, + }, +); + +1; diff --git a/regress/usr.sbin/syslogd/args-proto-udp4-host6.pl b/regress/usr.sbin/syslogd/args-proto-udp4-host6.pl index 37f6a072b6d..7ebbb7b0d06 100644 --- a/regress/usr.sbin/syslogd/args-proto-udp4-host6.pl +++ b/regress/usr.sbin/syslogd/args-proto-udp4-host6.pl @@ -11,7 +11,7 @@ our %args = ( syslogd => { loghost => '@udp4://[::1]', loggrep => { - qr/syslogd\[\d+\]: bad hostname "\@udp4:\/\/\[::1\]"/ => 1, + qr/syslogd\[\d+\]: bad hostname "\@udp4:\/\/\[::1\]"/ => '>=1', get_testgrep() => 1, }, }, diff --git a/regress/usr.sbin/syslogd/args-proto-udp6-host4.pl b/regress/usr.sbin/syslogd/args-proto-udp6-host4.pl index aff56c9f9f6..bd2b873862d 100644 --- a/regress/usr.sbin/syslogd/args-proto-udp6-host4.pl +++ b/regress/usr.sbin/syslogd/args-proto-udp6-host4.pl @@ -11,7 +11,7 @@ our %args = ( syslogd => { loghost => '@udp6://127.0.0.1', loggrep => { - qr/syslogd\[\d+\]: bad hostname "\@udp6:\/\/127.0.0.1"/ => 1, + qr/syslogd\[\d+\]: bad hostname "\@udp6:\/\/127.0.0.1"/ => '>=1', get_testgrep() => 1, }, },