]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: make sure ping works for unprivileged users
authorFrantisek Sumsal <frantisek@sumsal.cz>
Mon, 12 Jun 2023 12:13:25 +0000 (14:13 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 13 Jun 2023 08:15:27 +0000 (10:15 +0200)
test/units/testsuite-02.sh

index f0e0f091fd61fa352288956fe99ab0adcac0f6a5..4c4479287ffb44592afdd4e07706243452e6fc19 100755 (executable)
@@ -22,9 +22,14 @@ NPROC=$(nproc)
 MAX_QUEUE_SIZE=${NPROC:-2}
 mapfile -t TEST_LIST < <(find /usr/lib/systemd/tests/unit-tests/ -maxdepth 1 -type f -name "${TESTS_GLOB}")
 
-# reset state
+# Reset state
 rm -fv /failed-tests /skipped-tests /skipped
 
+if ! systemd-detect-virt -qc; then
+    # Make sure ping works for unprivileged users (for test-bpf-firewall)
+    sysctl net.ipv4.ping_group_range="0 2147483647"
+fi
+
 # Check & report test results
 # Arguments:
 #   $1: test path