Page MenuHomeFreeBSD

syslogd: Split up basic test case
ClosedPublic

Authored by jfree on Nov 17 2024, 7:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 10, 9:18 PM
Unknown Object (File)
Sat, Dec 7, 11:30 PM
Unknown Object (File)
Sat, Dec 7, 6:16 AM
Unknown Object (File)
Sat, Dec 7, 6:14 AM
Unknown Object (File)
Wed, Dec 4, 3:06 PM
Unknown Object (File)
Thu, Nov 28, 1:26 AM
Unknown Object (File)
Thu, Nov 28, 1:26 AM
Unknown Object (File)
Wed, Nov 27, 4:39 AM
Subscribers

Details

Summary
The basic test case was previously used to test if messages are
correctly logged over UNIX, INET, and INET6 transport. This single
case can be split up into three separate tests 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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 60749
Build 57633: arc lint + arc unit

Event Timeline

jfree requested review of this revision.Nov 17 2024, 7:57 PM
usr.sbin/syslogd/tests/syslogd_test.sh
158–159
185
185–188

I would suggest calling atf_skip if both inet and inet6 are not set.

zlei added inline comments.
usr.sbin/syslogd/tests/syslogd_test.sh
185–188

I would suggest calling atf_skip if both inet and inet6 are not set.

Or maybe it is better to have separate test cases, aka test_unix, test_inet and test_inet6 ?

jfree marked 3 inline comments as done.
jfree removed a subscriber: zlei.
  • Use sysctl's -n flag to print value without variable name. Silly mistake on my part.
  • Skip test if INET and INET6 are unsupported by kernel.
jfree marked an inline comment as not done.
jfree added a subscriber: zlei.

Separate the "basic" test into three separate tests:

  • unix
  • inet
  • inet6

Thanks to @zlei for the suggestion.

This revision is now accepted and ready to land.Nov 18 2024, 3:18 AM
usr.sbin/syslogd/tests/syslogd_test.sh
148

Unfortunately, the way this works is that the sysctl simply doesn't exist if the feature isn't there. So you have to write something like:

if [ "$(sysctl -n kern.features.inet)" -ne 1 ]; then
    atf_skip
fi

You might also want to make sure that atf_skip can be used in the test case head. It might be fine, but it should be double-checked if you haven't already.

jfree retitled this revision from syslogd: Detect INET/INET6 support using kern.features to syslogd: Split up basic test case.Nov 24 2024, 5:48 PM
jfree edited the summary of this revision. (Show Details)
jfree marked an inline comment as done.
  • Fix sysctl(8) usage
  • Do not use atf_skip(3) in test head - it causes failure
This revision now requires review to proceed.Nov 24 2024, 5:52 PM
This revision is now accepted and ready to land.Sun, Nov 24, 6:44 PM
This revision was automatically updated to reflect the committed changes.