]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
fmf: Don't fail if we can't modify sysctl values
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 13 Feb 2025 13:41:21 +0000 (14:41 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 13 Feb 2025 20:35:56 +0000 (20:35 +0000)
If the script is running unprivileged we might not be able to modify
these so let's skip in that case.

test/fmf/integration-tests/test.sh

index c5ba7507de894ce49867e4cfaa03f8aab9e19b14..c7aeb069989a5b45faab1b751900349748c7da5f 100755 (executable)
@@ -13,9 +13,9 @@ lsmem
 
 echo "Clock source: $(cat /sys/devices/system/clocksource/clocksource0/current_clocksource)"
 
-# Bump inotify limits so nspawn containers don't run out of inotify file descriptors.
-sysctl fs.inotify.max_user_watches=65536
-sysctl fs.inotify.max_user_instances=1024
+# Bump inotify limits if we can so nspawn containers don't run out of inotify file descriptors.
+sysctl fs.inotify.max_user_watches=65536 || true
+sysctl fs.inotify.max_user_instances=1024 || true
 
 # Allow running the integration tests downstream in dist-git with something like
 # the following snippet which makes the dist-git sources available in $TMT_SOURCE_DIR: