Skip to content

Commit 19614a0

Browse files
radolinbluca
authored andcommitted
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.
1 parent 2c41722 commit 19614a0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/libsystemd-network/test-dhcp-server.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ static int test_basic(bool bind_to_interface) {
6262
test_pool(&address_lo, 1, 0);
6363

6464
r = sd_dhcp_server_start(server);
65-
if (r == -EPERM)
65+
/* skip test if running in an environment with no full networking support, CONFIG_PACKET not
66+
* compiled in kernel, nor af_packet module available. */
67+
if (r == -EPERM || r == -EAFNOSUPPORT)
6668
return r;
6769
assert_se(r >= 0);
6870

0 commit comments

Comments
 (0)