diff --git a/tests/integration/helpers.bash b/tests/integration/helpers.bash index 05d94f7fa84..b102d3f3d92 100644 --- a/tests/integration/helpers.bash +++ b/tests/integration/helpers.bash @@ -455,6 +455,13 @@ function requires() { skip_me=1 fi ;; + more_than_8_core) + local cpus + cpus=$(grep -c '^processor' /proc/cpuinfo) + if [ "$cpus" -le 8 ]; then + skip_me=1 + fi + ;; *) fail "BUG: Invalid requires $var." ;; diff --git a/tests/integration/update.bats b/tests/integration/update.bats index 01c6915291a..b7a44cb72ce 100644 --- a/tests/integration/update.bats +++ b/tests/integration/update.bats @@ -559,6 +559,33 @@ EOF check_systemd_value "AllowedMemoryNodes" 1 } +@test "update cpuset cpus range via v2 unified map" { + # This test assumes systemd >= v244 + [ $EUID -ne 0 ] && requires rootless_cgroup + requires systemd cgroups_v2 more_than_8_core cgroups_cpuset + + update_config ' .linux.resources.unified |= { + "cpuset.cpus": "0-5", + }' + runc run -d --console-socket "$CONSOLE_SOCKET" test_update + [ "$status" -eq 0 ] + + # check that the initial value was properly set + check_systemd_value "AllowedCPUs" "0-5" + + runc update -r - test_update <