mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
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 <kolyshkin@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user