From 8d94363343e06701c8b5d6ecedf138784fc8c391 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Sat, 30 May 2020 14:09:07 -0700 Subject: [PATCH] test/int/update: simplify mem+swap checks The "unlimited" value is the same for memory and memory+swap, so let's use SYSTEM_MEM for both. In fact, it was already used in one place to check swap, probably due to a typo. This also fixes the following failure on a cgroup v1 system without mem+swap control (Ubuntu 19.04): > # not ok 78 update cgroup v1/v2 common limits > # (in test file tests/integration/update.bats, line 72) > # `SYSTEM_MEM_SWAP=$(cat "${CGROUP_MEMORY_BASE_PATH}/$MEM_SWAP")' failed Signed-off-by: Kir Kolyshkin --- tests/integration/update.bats | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/integration/update.bats b/tests/integration/update.bats index 4c1585e1d..4dd8d17ed 100644 --- a/tests/integration/update.bats +++ b/tests/integration/update.bats @@ -69,7 +69,6 @@ EOF MEM_SWAP="memory.memsw.limit_in_bytes" SD_MEM_SWAP="unsupported" SYSTEM_MEM=$(cat "${CGROUP_MEMORY_BASE_PATH}/${MEM_LIMIT}") - SYSTEM_MEM_SWAP=$(cat "${CGROUP_MEMORY_BASE_PATH}/$MEM_SWAP") ;; yes) MEM_LIMIT="memory.max" @@ -79,7 +78,6 @@ EOF MEM_SWAP="memory.swap.max" SD_MEM_SWAP="MemorySwapMax" SYSTEM_MEM="max" - SYSTEM_MEM_SWAP="max" CGROUP_MEMORY=$CGROUP_PATH ;; esac @@ -130,7 +128,7 @@ EOF # try to remove memory swap limit runc update test_update --memory-swap -1 [ "$status" -eq 0 ] - check_cgroup_value "$MEM_SWAP" $SYSTEM_MEM_SWAP + check_cgroup_value "$MEM_SWAP" $SYSTEM_MEM check_systemd_value "$SD_MEM_SWAP" $SD_UNLIMITED # update memory swap