libsystemd-network: skip dhcp server test in case of EAFNOSUPPORT

We want to eanble running tests as part of the build, but
our builds run in VMs with networking disabled.
This commit is contained in:
Radoslav Kolev 2024-05-14 10:25:49 +03:00 committed by Luca Boccassi
parent 2c41722995
commit 19614a08d1

View file

@ -62,7 +62,9 @@ static int test_basic(bool bind_to_interface) {
test_pool(&address_lo, 1, 0);
r = sd_dhcp_server_start(server);
if (r == -EPERM)
/* skip test if running in an environment with no full networking support, CONFIG_PACKET not
* compiled in kernel, nor af_packet module available. */
if (r == -EPERM || r == -EAFNOSUPPORT)
return r;
assert_se(r >= 0);