]> git.ipfire.org Git - thirdparty/nftables.git/commit
tests/shell: add "-S|--setup-host" option to set sysctl for rootless tests
authorThomas Haller <thaller@redhat.com>
Fri, 6 Oct 2023 09:42:20 +0000 (11:42 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 10 Oct 2023 18:18:41 +0000 (20:18 +0200)
commit2fbbe6802363e98ca4a8210503f5f986bd66bcb0
treeba67d6cd57e0c33ac33e73c46e3a1707d8c97845
parent458298a4336477d1d6c2b1fe838e0e85a7464dc1
tests/shell: add "-S|--setup-host" option to set sysctl for rootless tests

Most tests can run just fine without root. A few of them will fail if
/proc/sys/net/core/{wmem_max,rmem_max} is too small (as it is by default
on the host).

The easy workaround is to bump those limits once. This has to be
repeated after each reboot.

Doing that manually (every time) is cumbersome. Add a "--setup-host"
option for that.

Usage:

  $ sudo ./tests/shell/run-tests.sh -S
  Setting up host for running as rootless (requires root).
      echo 4096000 > /proc/sys/net/core/rmem_max (previous value 100000)
      echo 4096000 > /proc/sys/net/core/wmem_max (previous value 100000)

Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/shell/run-tests.sh