aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Richardson <arichardson@FreeBSD.org>2021-04-23 10:21:28 +0000
committerAlex Richardson <arichardson@FreeBSD.org>2021-04-23 10:28:26 +0000
commit694407528fb506755f1e1f0fa2d343b7e2c3177e (patch)
tree534dea3f56e62b8b9bc9490eb200b3a8721f275a
parent3183d0b68072dda0e80bb6e03c970625f2823e97 (diff)
Correctly skip rtsock_l3 test when if_epair is not available
This logic was accidentally changed in 67f2f67fc8ce8484066e95dabac5af892888fca1 Reported By: olivier X-MFC-With: 67f2f67fc8ce8484066e95dabac5af892888fca1 Tested By: kp Reviewed By: kp, melifaro Fixes: 67f2f67fc8ce ("Update rtsock_l3 test after 2fe5a79425c7") Differential Revision: https://reviews.freebsd.org/D29944
-rw-r--r--tests/sys/net/routing/rtsock_config.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/sys/net/routing/rtsock_config.h b/tests/sys/net/routing/rtsock_config.h
index d9eccb6a19f6..ff89814a61da 100644
--- a/tests/sys/net/routing/rtsock_config.h
+++ b/tests/sys/net/routing/rtsock_config.h
@@ -129,13 +129,11 @@ config_setup(const atf_tc_t *tc, struct rtsock_config_options *co)
ATF_CHECK_ERRNO(0, true);
if (co->num_interfaces > 0) {
- if (kldload("if_epair") == -1) {
- /* Any errno other than EEXIST is fatal. */
- ATF_REQUIRE_ERRNO(EEXIST, true);
- /* Clear errno for the following tests. */
- errno = 0;
- }
+ /* Try loading if_epair and if that fails skip the test. */
+ kldload("if_epair");
ATF_REQUIRE_KERNEL_MODULE("if_epair");
+ /* Clear errno for the following tests. */
+ errno = 0;
c->ifnames = calloc(co->num_interfaces, sizeof(char *));
for (int i = 0; i < co->num_interfaces; i++)