Page MenuHomeFreeBSD

Skip if_epair test if module doesn't exist
ClosedPublic

Authored by olivier on Feb 28 2020, 4:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 17, 6:14 AM
Unknown Object (File)
Sat, Dec 7, 2:34 PM
Unknown Object (File)
Nov 19 2024, 8:25 AM
Unknown Object (File)
Nov 15 2024, 8:16 AM
Unknown Object (File)
Oct 31 2024, 2:19 PM
Unknown Object (File)
Oct 31 2024, 2:19 PM
Unknown Object (File)
Oct 31 2024, 2:19 PM
Unknown Object (File)
Oct 31 2024, 2:01 PM
Subscribers

Details

Summary

When building light FreeBSD without if_epair, this regression test fail because
it can't load the module.
Uses the helper macro to skip this test if the module doesn't exist.

Test Plan
  1. mv /boot/kernel/if_epair.ko /boot/kernel/if_epair.ko.bak
  2. kyua test -k /usr/tests/sys/net/Kyuafile if_epair

if_epair:params -> skipped: module if_epair could not be resolved: No such file or directory [0.002s]

Results file id is usr_tests_sys_net.20200228-164520-615708
Results saved to /root/.kyua/store/results.usr_tests_sys_net.20200228-164520-615708.db

1/1 passed (0 failed)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This does change the behaviour of the test: if the if_epair module isn't loaded yet it doesn't load it, it skips the test.

Arguably that's better, because that's what we do for other modules (e.g. pf). On the other hand, other tests load it implicitly (e.g. the pf tests) in the process of making their test setup.
I'm torn on the best way to deal with this. Perhaps the best fix is to keep the kldload(), but to skip the test if the load fails rather than failing the test.

If we do go with this approach we should change freebsd-ci so that it loads if_epair (just as it already loads pf) for the automated tests.

In D23876#525342, @kp wrote:

This does change the behaviour of the test: if the if_epair module isn't loaded yet it doesn't load it, it skips the test.

Arguably that's better, because that's what we do for other modules (e.g. pf). On the other hand, other tests load it implicitly (e.g. the pf tests) in the process of making their test setup.
I'm torn on the best way to deal with this. Perhaps the best fix is to keep the kldload(), but to skip the test if the load fails rather than failing the test.

If we do go with this approach we should change freebsd-ci so that it loads if_epair (just as it already loads pf) for the automated tests.

And what about re-introducing the kldload("if_epair") (without testing the result code) just before the ATF_REQUIRE_KERNEL_MODULE ?

And what about re-introducing the kldload("if_epair") (without testing the result code) just before the ATF_REQUIRE_KERNEL_MODULE ?

That should work. We'd attempt to load the module and skip the test if we couldn't.

Keept the same behaviour as previously by loading the if_epair module.

This revision is now accepted and ready to land.Mar 3 2020, 8:38 AM