aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/syslogd/tests/syslogd_basic_format_test.sh
Commit message (Collapse)AuthorAgeFilesLines
* syslogd/tests: Address racesMark Johnston2026-01-221-17/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* syslogd: Add rfc3164-strict format optionMichal Scigocki2024-12-231-0/+20
| | | | | | | | | | | | | | | The syslogd bsd/rfc3164 message format does not strictly conform to the format recommended in RFC 3164 when syslog messages are forwarded from remote hosts. The new rfc3164-strict format generates messages that conform with the RFC 3164 recommended format. The existing format is maintained for backwards compatibility. PR: 220246 Reviewed by: markj MFC after: 3 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/1536
* syslogd: Add syslog forwarded message format testsMichal Scigocki2024-12-231-1/+0
| | | | | | Reviewed by: markj MFC after: 3 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/1536
* syslogd: Add syslog basic message format testsMichal Scigocki2024-12-231-0/+111
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