Page MenuHomeFreeBSD

cap_net tests: Skip tests if there is no connectivity
ClosedPublic

Authored by markj on Mar 24 2023, 12:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 22, 3:15 PM
Unknown Object (File)
Wed, May 22, 4:15 AM
Unknown Object (File)
Wed, May 22, 3:50 AM
Unknown Object (File)
Wed, May 22, 2:58 AM
Unknown Object (File)
Sat, May 18, 10:26 AM
Unknown Object (File)
Mar 22 2024, 6:43 PM
Unknown Object (File)
Mar 8 2024, 7:48 AM
Unknown Object (File)
Feb 12 2024, 2:58 PM
Subscribers

Details

Summary

When testing cap_connect() and name/addr lookup functions, skip tests if
we fail and the error is not ENOTCAPABLE. This makes the tests amenable
to running in CI without Internet connectivity.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

lib/libcasper/services/cap_net/tests/net_test.c
144–145

Can't we switch the order like in previous?

205–209

ditto

238–239

ditto

lib/libcasper/services/cap_net/tests/net_test.c
144–145

I should probably reorder the previous function instead. I did it that way initially but in some of the tests we expect the non-casper version to fail. So the pattern is:

  1. check the casper version, return ENOTCAPABLE if present
  2. try the system version, skip the test if it fails
  3. return success

I'll change the other functions so that this is consistent.

Reorganize getnameinfo() checks to use the same logic as other DNS
lookups.

This revision is now accepted and ready to land.Apr 27 2023, 7:52 AM