History log of /src/usr.sbin/syslogd/tests/syslogd_test.sh (Results 1 – 25 of 36)
Revision Date Author Comments
# 14dce731 22-Jan-2026 Mark Johnston <markj@FreeBSD.org>

syslogd/tests: Fix flakiness in forwarding tests

syslogd_start() waits for the local log socket to appear before
returning, to ensure that the daemon is ready to handle log messages.
Some tests star

syslogd/tests: Fix flakiness in forwarding tests

syslogd_start() waits for the local log socket to appear before
returning, to ensure that the daemon is ready to handle log messages.
Some tests start two daemons, so by default the socket already exists
when the second daemon is started, so syslogd_start() returns early.
The test subsequently sends a message to this second daemon, which
sometimes isn't ready.

Define a separate log socket for the second daemon. Add a check to
syslogd_start() to help catch this type of bug.

Reviewed by: jlduran
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D54800

show more ...


# 92d25147 22-Jan-2026 Mark Johnston <markj@FreeBSD.org>

syslogd/tests: Improve loopback interface initialization

- In syslogd_start(), assign the lo0 address in the specified jail.
- Use the correct netmask.

Reviewed by: jlduran
MFC after: 2 weeks
Diffe

syslogd/tests: Improve loopback interface initialization

- In syslogd_start(), assign the lo0 address in the specified jail.
- Use the correct netmask.

Reviewed by: jlduran
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D54799

show more ...


# 560c2293 22-Jan-2026 Mark Johnston <markj@FreeBSD.org>

syslogd/tests: Address races

I occasionally see failures in the syslogd test suite. The problem is
that the tests are racy: they send a message using logger(1), then
immediately check whether the m

syslogd/tests: Address races

I occasionally see failures in the syslogd test suite. The problem is
that the tests are racy: they send a message using logger(1), then
immediately check whether the message was logged to a log file. If the
syslogd instance under test doesn't get a chance to run before the
second step, the test fails.

This change reworks things to avoid the race while minimizing the amount
of time sleeping.
1) Each test uses a single logfile, so have them use a new common
variable, SYSLOGD_LOGFILE, instead of something test-specific.
2) In syslogd_start(), if the configuration references SYSLOGD_LOGFILE,
wait for it to be created by syslogd before returning.
3) Add a helper syslogd_check_log(), to check for a given log entry in
the last line of SYSLOGD_LOGFILE, instead of using atf_check
directly.
4) In syslogd_check_log(), poll the logfile until the desired log entry
appears, or the test times out.

With this change, I was able to run the tests 1000 times in a loop with
4-way parallelism without seeing any test failures. Without the change
I usually get a failure within 10 loops.

Reviewed by: jlduran
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D54779

show more ...


# ffdbc1bc 22-Jan-2026 Mark Johnston <markj@FreeBSD.org>

syslogd/tests: Use a helper function to log from within a jail

This is just for consistency with all other logger(1) invocations, which
happen from the syslogd_log() function.

No functional change

syslogd/tests: Use a helper function to log from within a jail

This is just for consistency with all other logger(1) invocations, which
happen from the syslogd_log() function.

No functional change intended.

Reviewed by: jlduran
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D54778

show more ...


# 60ae4e52 22-Dec-2025 Jake Freeland <jfree@FreeBSD.org>

syslogd: Terminate pipe processes gracefully

Pipe actions spawn a process based on the command provided in the
syslogd configuration file. When a HUP signal is received, enter
the process into the d

syslogd: Terminate pipe processes gracefully

Pipe actions spawn a process based on the command provided in the
syslogd configuration file. When a HUP signal is received, enter
the process into the deadq instead of immediately killing it.
This matches the behavior of syslogd prior to it being Capsicumized.

Fixes: d2d180fb7736

show more ...


# 8d9c25c4 12-Feb-2025 Jose Luis Duran <jlduran@FreeBSD.org>

syslogd: Fix tests when if_epair is not loaded

Take a cue from vnet.subr and abstract module loading, jail creation and
cleanup.

Note that the way jails are created differs slightly from vnet.subr,

syslogd: Fix tests when if_epair is not loaded

Take a cue from vnet.subr and abstract module loading, jail creation and
cleanup.

Note that the way jails are created differs slightly from vnet.subr, to
maintain the current style of the tests.

Reported by: Jenkins
Reviewed by: markj
Approved by: emaste (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D48949

show more ...


# ae4f708f 14-Jan-2025 Mark Johnston <markj@FreeBSD.org>

syslogd: Ensure that forwarded messages are sent from port 514

Prior to commit 4ecbee2760f7, syslogd used its listening socket(s) to
forward messages to remote hosts, when so configured. As a conse

syslogd: Ensure that forwarded messages are sent from port 514

Prior to commit 4ecbee2760f7, syslogd used its listening socket(s) to
forward messages to remote hosts, when so configured. As a consequence,
they are sent from the address+port to which those sockets are bound,
typically 0.0.0.0:514.

When in capability mode, sendto() is not permitted, so we instead
pre-create sockets and connect them to the forwarding addresses, letting
the kernel pick an ephemeral source port. However, this doesn't match
syslogd's previous behaviour, breaking some setups.

So, restore the old behaviour by binding forwarding sockets to the
addresses on which syslogd is listening. Since we cannot use the same
sockets for receiving messages and also for forwarding them, use
SO_REUSEPORT to enable duplicate bindings to port 514, relying on the
existing behaviour that the first socket bound to that port is the one
that actually receives messages.

Add some regression tests to cover this and related functionality of
syslogd's -a option.

Reviewed by: jfree
Reported by: Michael Butler <imb@protected-networks.net>
Fixes: 4ecbee2760f7 ("syslogd: Open forwarding socket descriptors")
Differential Revision: https://reviews.freebsd.org/D48222

show more ...


# 66a022a3 23-Dec-2024 Michal Scigocki <michal.os@hotmail.com>

syslogd: Add syslog basic message format tests

RFC 3164 and RFC 5424 syslog message format tests and minor refactor of
existing tests to reuse components in new tests.

Reviewed by: markj
MFC after:

syslogd: Add syslog basic message format tests

RFC 3164 and RFC 5424 syslog message format tests and minor refactor of
existing tests to reuse components in new tests.

Reviewed by: markj
MFC after: 3 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/1536

show more ...


# b872bb72 27-Nov-2024 Jake Freeland <jfree@FreeBSD.org>

syslogd: Split up basic test case

The basic case previously tested if messages are correctly logged over
UNIX, INET, and INET6 transport. This single case can be split up into
three separate cases t

syslogd: Split up basic test case

The basic case previously tested if messages are correctly logged over
UNIX, INET, and INET6 transport. This single case can be split up into
three separate cases to decrease code complexity and offer more granular
results.

Both INET and INET6 cases will be skipped if the kernel does not
support the corresponding transport.

Reviewed by: zlei, markj
Differential Revision: https://reviews.freebsd.org/D47650

show more ...


# 8b63477e 27-Nov-2024 Jake Freeland <jfree@FreeBSD.org>

syslogd: Add host forwarding test

Test communication between hosts by setting up two syslogd instances,
each binded to their own addresses, and sending a message from one to
the other. The tests pas

syslogd: Add host forwarding test

Test communication between hosts by setting up two syslogd instances,
each binded to their own addresses, and sending a message from one to
the other. The tests passes if the message was delivered and logged
successfully.

This required some tweaking to the syslogd start and stop routines so
they could handle launching multiple syslogd instances with different
runtime files.

Run the tests in jails with an isolated VNET so they don't fail due to
an address bind collision in the host's VNET.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D47649

show more ...


# 5d045d55 19-Sep-2024 Mark Johnston <markj@FreeBSD.org>

syslogd: Ignore getaddrinfo() errors if -ss is specified

This can arise if the jail doesn't have networking configured, and if
-ss is specified, syslogd won't listen on port 514 anyway.

Add a regre

syslogd: Ignore getaddrinfo() errors if -ss is specified

This can arise if the jail doesn't have networking configured, and if
-ss is specified, syslogd won't listen on port 514 anyway.

Add a regression test case for this as well.

PR: 238006
MFC after: 1 month

show more ...


# fcace290 22-Jun-2023 Jake Freeland <jfree@FreeBSD.org>

syslogd: Add some basic regression tests

Reviewed by: markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41403


# 14dce731 22-Jan-2026 Mark Johnston <markj@FreeBSD.org>

syslogd/tests: Fix flakiness in forwarding tests

syslogd_start() waits for the local log socket to appear before
returning, to ensure that the daemon is ready to handle log messages.
Some tests star

syslogd/tests: Fix flakiness in forwarding tests

syslogd_start() waits for the local log socket to appear before
returning, to ensure that the daemon is ready to handle log messages.
Some tests start two daemons, so by default the socket already exists
when the second daemon is started, so syslogd_start() returns early.
The test subsequently sends a message to this second daemon, which
sometimes isn't ready.

Define a separate log socket for the second daemon. Add a check to
syslogd_start() to help catch this type of bug.

Reviewed by: jlduran
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D54800

show more ...


# 92d25147 22-Jan-2026 Mark Johnston <markj@FreeBSD.org>

syslogd/tests: Improve loopback interface initialization

- In syslogd_start(), assign the lo0 address in the specified jail.
- Use the correct netmask.

Reviewed by: jlduran
MFC after: 2 weeks
Diffe

syslogd/tests: Improve loopback interface initialization

- In syslogd_start(), assign the lo0 address in the specified jail.
- Use the correct netmask.

Reviewed by: jlduran
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D54799

show more ...


# 560c2293 22-Jan-2026 Mark Johnston <markj@FreeBSD.org>

syslogd/tests: Address races

I occasionally see failures in the syslogd test suite. The problem is
that the tests are racy: they send a message using logger(1), then
immediately check whether the m

syslogd/tests: Address races

I occasionally see failures in the syslogd test suite. The problem is
that the tests are racy: they send a message using logger(1), then
immediately check whether the message was logged to a log file. If the
syslogd instance under test doesn't get a chance to run before the
second step, the test fails.

This change reworks things to avoid the race while minimizing the amount
of time sleeping.
1) Each test uses a single logfile, so have them use a new common
variable, SYSLOGD_LOGFILE, instead of something test-specific.
2) In syslogd_start(), if the configuration references SYSLOGD_LOGFILE,
wait for it to be created by syslogd before returning.
3) Add a helper syslogd_check_log(), to check for a given log entry in
the last line of SYSLOGD_LOGFILE, instead of using atf_check
directly.
4) In syslogd_check_log(), poll the logfile until the desired log entry
appears, or the test times out.

With this change, I was able to run the tests 1000 times in a loop with
4-way parallelism without seeing any test failures. Without the change
I usually get a failure within 10 loops.

Reviewed by: jlduran
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D54779

show more ...


# ffdbc1bc 22-Jan-2026 Mark Johnston <markj@FreeBSD.org>

syslogd/tests: Use a helper function to log from within a jail

This is just for consistency with all other logger(1) invocations, which
happen from the syslogd_log() function.

No functional change

syslogd/tests: Use a helper function to log from within a jail

This is just for consistency with all other logger(1) invocations, which
happen from the syslogd_log() function.

No functional change intended.

Reviewed by: jlduran
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D54778

show more ...


# 60ae4e52 22-Dec-2025 Jake Freeland <jfree@FreeBSD.org>

syslogd: Terminate pipe processes gracefully

Pipe actions spawn a process based on the command provided in the
syslogd configuration file. When a HUP signal is received, enter
the process into the d

syslogd: Terminate pipe processes gracefully

Pipe actions spawn a process based on the command provided in the
syslogd configuration file. When a HUP signal is received, enter
the process into the deadq instead of immediately killing it.
This matches the behavior of syslogd prior to it being Capsicumized.

Fixes: d2d180fb7736

show more ...


# 8d9c25c4 12-Feb-2025 Jose Luis Duran <jlduran@FreeBSD.org>

syslogd: Fix tests when if_epair is not loaded

Take a cue from vnet.subr and abstract module loading, jail creation and
cleanup.

Note that the way jails are created differs slightly from vnet.subr,

syslogd: Fix tests when if_epair is not loaded

Take a cue from vnet.subr and abstract module loading, jail creation and
cleanup.

Note that the way jails are created differs slightly from vnet.subr, to
maintain the current style of the tests.

Reported by: Jenkins
Reviewed by: markj
Approved by: emaste (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D48949

show more ...


# ae4f708f 14-Jan-2025 Mark Johnston <markj@FreeBSD.org>

syslogd: Ensure that forwarded messages are sent from port 514

Prior to commit 4ecbee2760f7, syslogd used its listening socket(s) to
forward messages to remote hosts, when so configured. As a conse

syslogd: Ensure that forwarded messages are sent from port 514

Prior to commit 4ecbee2760f7, syslogd used its listening socket(s) to
forward messages to remote hosts, when so configured. As a consequence,
they are sent from the address+port to which those sockets are bound,
typically 0.0.0.0:514.

When in capability mode, sendto() is not permitted, so we instead
pre-create sockets and connect them to the forwarding addresses, letting
the kernel pick an ephemeral source port. However, this doesn't match
syslogd's previous behaviour, breaking some setups.

So, restore the old behaviour by binding forwarding sockets to the
addresses on which syslogd is listening. Since we cannot use the same
sockets for receiving messages and also for forwarding them, use
SO_REUSEPORT to enable duplicate bindings to port 514, relying on the
existing behaviour that the first socket bound to that port is the one
that actually receives messages.

Add some regression tests to cover this and related functionality of
syslogd's -a option.

Reviewed by: jfree
Reported by: Michael Butler <imb@protected-networks.net>
Fixes: 4ecbee2760f7 ("syslogd: Open forwarding socket descriptors")
Differential Revision: https://reviews.freebsd.org/D48222

show more ...


# 66a022a3 23-Dec-2024 Michal Scigocki <michal.os@hotmail.com>

syslogd: Add syslog basic message format tests

RFC 3164 and RFC 5424 syslog message format tests and minor refactor of
existing tests to reuse components in new tests.

Reviewed by: markj
MFC after:

syslogd: Add syslog basic message format tests

RFC 3164 and RFC 5424 syslog message format tests and minor refactor of
existing tests to reuse components in new tests.

Reviewed by: markj
MFC after: 3 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/1536

show more ...


# b872bb72 27-Nov-2024 Jake Freeland <jfree@FreeBSD.org>

syslogd: Split up basic test case

The basic case previously tested if messages are correctly logged over
UNIX, INET, and INET6 transport. This single case can be split up into
three separate cases t

syslogd: Split up basic test case

The basic case previously tested if messages are correctly logged over
UNIX, INET, and INET6 transport. This single case can be split up into
three separate cases to decrease code complexity and offer more granular
results.

Both INET and INET6 cases will be skipped if the kernel does not
support the corresponding transport.

Reviewed by: zlei, markj
Differential Revision: https://reviews.freebsd.org/D47650

show more ...


# 8b63477e 27-Nov-2024 Jake Freeland <jfree@FreeBSD.org>

syslogd: Add host forwarding test

Test communication between hosts by setting up two syslogd instances,
each binded to their own addresses, and sending a message from one to
the other. The tests pas

syslogd: Add host forwarding test

Test communication between hosts by setting up two syslogd instances,
each binded to their own addresses, and sending a message from one to
the other. The tests passes if the message was delivered and logged
successfully.

This required some tweaking to the syslogd start and stop routines so
they could handle launching multiple syslogd instances with different
runtime files.

Run the tests in jails with an isolated VNET so they don't fail due to
an address bind collision in the host's VNET.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D47649

show more ...


# 5d045d55 19-Sep-2024 Mark Johnston <markj@FreeBSD.org>

syslogd: Ignore getaddrinfo() errors if -ss is specified

This can arise if the jail doesn't have networking configured, and if
-ss is specified, syslogd won't listen on port 514 anyway.

Add a regre

syslogd: Ignore getaddrinfo() errors if -ss is specified

This can arise if the jail doesn't have networking configured, and if
-ss is specified, syslogd won't listen on port 514 anyway.

Add a regression test case for this as well.

PR: 238006
MFC after: 1 month

show more ...


# fcace290 22-Jun-2023 Jake Freeland <jfree@FreeBSD.org>

syslogd: Add some basic regression tests

Reviewed by: markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41403


# 14dce731 22-Jan-2026 Mark Johnston <markj@FreeBSD.org>

syslogd/tests: Fix flakiness in forwarding tests

syslogd_start() waits for the local log socket to appear before
returning, to ensure that the daemon is ready to handle log messages.
Some tests star

syslogd/tests: Fix flakiness in forwarding tests

syslogd_start() waits for the local log socket to appear before
returning, to ensure that the daemon is ready to handle log messages.
Some tests start two daemons, so by default the socket already exists
when the second daemon is started, so syslogd_start() returns early.
The test subsequently sends a message to this second daemon, which
sometimes isn't ready.

Define a separate log socket for the second daemon. Add a check to
syslogd_start() to help catch this type of bug.

Reviewed by: jlduran
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D54800

show more ...


12