]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-firewall-util: allow to run test-firewall-util 39967/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 2 Dec 2025 16:35:34 +0000 (01:35 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 3 Dec 2025 23:24:28 +0000 (08:24 +0900)
Now fw_nftables_add_masquerade() should return EOPNOTSUPP or so if
unprivileged. It is not necessary to skip whole tests earlier.

src/test/test-firewall-util.c

index d7080fa34956ff75fa308bb08381cc000cc8a3ed..aea6cded5aab3a2fa22da44a29c4246bde1945b1 100644 (file)
@@ -1,8 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <stdlib.h>
-#include <unistd.h>
-
 #include "sd-netlink.h"
 
 #include "firewall-util.h"
@@ -79,9 +76,6 @@ TEST(v4) {
 static int intro(void) {
         int r;
 
-        if (getuid() != 0)
-                return log_tests_skipped("not root");
-
         ASSERT_OK_ERRNO(setenv("SYSTEMD_FIREWALL_UTIL_NFT_TABLE_NAME", "io.systemd-test.nat", /* overwrite = */ true));
         ASSERT_OK_ERRNO(setenv("SYSTEMD_FIREWALL_UTIL_DNAT_MAP_NAME", "test_map_port_ipport", /* overwrite = */ true));