diff --git a/tests/cgroup b/tests/cgroup index 656969d5..5cdbef0b 100755 --- a/tests/cgroup +++ b/tests/cgroup @@ -22,7 +22,7 @@ lxc launch "${IMAGE}" c1 echo "==> Validate default values" [ "$(lxc exec c1 -- nproc)" = "$(nproc)" ] [ "$(lxc exec c1 -- grep ^MemTotal /proc/meminfo)" = "$(grep ^MemTotal /proc/meminfo)" ] -if [ -e "/sys/fs/cgroup/memory/memory.memsw.limit_in_bytes" ] || [ -e "/sys/fs/cgroup/memory.swap.max" ]; then +if [ -e "/sys/fs/cgroup/memory/memory.memsw.limit_in_bytes" ] || [ -e "/sys/fs/cgroup/system.slice/memory.swap.max" ]; then [ "$(lxc exec c1 -- grep ^SwapTotal /proc/meminfo)" = "$(grep ^SwapTotal /proc/meminfo)" ] else [ "$(lxc exec c1 -- grep ^SwapTotal /proc/meminfo)" = "SwapTotal: 0 kB" ] @@ -110,7 +110,7 @@ echo "==> Testing memory limits" MEM_LIMIT_MIB=512 lxc config set c1 limits.memory="${MEM_LIMIT_MIB}MiB" [ "$(lxc exec c1 -- grep ^MemTotal /proc/meminfo)" = "MemTotal: $((MEM_LIMIT_MIB * 1024)) kB" ] -if [ -e "/sys/fs/cgroup/memory/memory.memsw.limit_in_bytes" ] || [ -e "/sys/fs/cgroup/memory.swap.max" ]; then +if [ -e "/sys/fs/cgroup/memory/memory.memsw.limit_in_bytes" ] || [ -e "/sys/fs/cgroup/system.slice/memory.swap.max" ]; then [ "$(lxc exec c1 -- grep ^SwapTotal /proc/meminfo)" = "SwapTotal: $((MEM_LIMIT_MIB * 1024)) kB" ] else [ "$(lxc exec c1 -- grep ^SwapTotal /proc/meminfo)" = "SwapTotal: 0 kB" ] @@ -133,7 +133,7 @@ if [ -e "/sys/fs/cgroup/memory" ]; then [ "$(lxc exec c1 -- cat /sys/fs/cgroup/memory/memory.swappiness)" = "65" ] fi -if [ -e "/sys/fs/cgroup/memory/memory.memsw.limit_in_bytes" ] || [ -e "/sys/fs/cgroup/memory.swap.max" ]; then +if [ -e "/sys/fs/cgroup/memory/memory.memsw.limit_in_bytes" ] || [ -e "/sys/fs/cgroup/system.slice/memory.swap.max" ]; then lxc config set c1 limits.memory 128MiB [ "$(lxc exec c1 -- grep ^MemTotal /proc/meminfo)" = "MemTotal: 131072 kB" ]