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)
Fri, Dec 13, 6:00 PM
Unknown Object (File)
Nov 22 2024, 1:05 PM
Unknown Object (File)
Nov 20 2024, 8:34 AM
Unknown Object (File)
Nov 18 2024, 11:42 AM
Unknown Object (File)
Nov 18 2024, 9:39 AM
Unknown Object (File)
Nov 14 2024, 9:55 AM
Unknown Object (File)
Nov 14 2024, 4:34 AM
Unknown Object (File)
Nov 14 2024, 2:22 AM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 50570
Build 47461: arc lint + arc unit

Event Timeline

lib/libcasper/services/cap_net/tests/net_test.c
142–143

Can't we switch the order like in previous?

203–207

ditto

236–237

ditto

lib/libcasper/services/cap_net/tests/net_test.c
142–143

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