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)
Tue, Nov 5, 3:09 AM
Unknown Object (File)
Tue, Nov 5, 3:04 AM
Unknown Object (File)
Tue, Nov 5, 3:04 AM
Unknown Object (File)
Tue, Nov 5, 3:04 AM
Unknown Object (File)
Tue, Nov 5, 2:44 AM
Unknown Object (File)
Sep 23 2024, 4:52 AM
Unknown Object (File)
Sep 18 2024, 10:26 AM
Unknown Object (File)
Sep 18 2024, 4:05 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