summaryrefslogtreecommitdiff
path: root/regress/usr.sbin
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2023-10-12 22:41:30 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2023-10-12 22:41:30 +0000
commit14561c5258123ae4edc19ae22f4660f4a15d9ce2 (patch)
treed0223deb18b6b87e385fd9644b29f73f3d7de6e3 /regress/usr.sbin
parentbdd74850b80622b9db6d02cf3b67f95bbc1ecb58 (diff)
Test retry after DNS lookup failure.
Diffstat (limited to 'regress/usr.sbin')
-rw-r--r--regress/usr.sbin/syslogd/args-dns-tcp-retry.pl26
-rw-r--r--regress/usr.sbin/syslogd/args-dns-tls-retry.pl26
-rw-r--r--regress/usr.sbin/syslogd/args-dns-udp-retry.pl26
-rw-r--r--regress/usr.sbin/syslogd/args-proto-udp4-host6.pl2
-rw-r--r--regress/usr.sbin/syslogd/args-proto-udp6-host4.pl2
5 files changed, 80 insertions, 2 deletions
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,
},
},