]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
libsystemd-network: skip dhcp server test in case of EAFNOSUPPORT
authorRadoslav Kolev <radoslav.kolev@suse.com>
Tue, 14 May 2024 07:25:49 +0000 (10:25 +0300)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 14 May 2024 13:00:29 +0000 (15:00 +0200)
We want to eanble running tests as part of the build, but
our builds run in VMs with networking disabled.

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

index a52f788968d9e9b1f5b1ace86e72f968825d41ae..ecd030e239cc71c3a35253b8ce597f491ed16a61 100644 (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);