From b8b46419ce87a65262c137ff8d119a7d63401ae7 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Mon, 30 Mar 2020 14:00:35 -0700 Subject: [PATCH] tests/integration: rm kmem from upgrade tests ... and add kmem-tcp to cgroups kmem test. First, we already have a separate kmem test in cgroups.bats. Second, making kmem a requirement leads to skipping all the other test cases in the update.bats test. Third, kmem limit is being removed from the kernel, so it makes sense to handle it separately. Signed-off-by: Kir Kolyshkin --- tests/integration/cgroups.bats | 13 ++++++++---- tests/integration/update.bats | 39 ++++++---------------------------- 2 files changed, 15 insertions(+), 37 deletions(-) diff --git a/tests/integration/cgroups.bats b/tests/integration/cgroups.bats index f925a0f82..6abb2ed6b 100644 --- a/tests/integration/cgroups.bats +++ b/tests/integration/cgroups.bats @@ -14,7 +14,7 @@ function setup() { setup_busybox } -@test "runc update --kernel-memory (initialized)" { +@test "runc update --kernel-memory{,-tcp} (initialized)" { [[ "$ROOTLESS" -ne 0 ]] && requires rootless_cgroup requires cgroups_kmem @@ -23,7 +23,8 @@ function setup() { # Set some initial known values DATA=$(cat <<-EOF "memory": { - "kernel": 16777216 + "kernel": 16777216, + "kernelTCP": 11534336 }, EOF ) @@ -35,13 +36,17 @@ EOF [ "$status" -eq 0 ] check_cgroup_value "memory.kmem.limit_in_bytes" 16777216 + check_cgroup_value "memory.kmem.tcp.limit_in_bytes" 11534336 # update kernel memory limit runc update test_cgroups_kmem --kernel-memory 50331648 [ "$status" -eq 0 ] - - # check the value check_cgroup_value "memory.kmem.limit_in_bytes" 50331648 + + # update kernel memory tcp limit + runc update test_cgroups_kmem --kernel-memory-tcp 41943040 + [ "$status" -eq 0 ] + check_cgroup_value "memory.kmem.tcp.limit_in_bytes" 41943040 } @test "runc update --kernel-memory (uninitialized)" { diff --git a/tests/integration/update.bats b/tests/integration/update.bats index 32c333597..492d1810d 100644 --- a/tests/integration/update.bats +++ b/tests/integration/update.bats @@ -19,9 +19,7 @@ function setup() { DATA=$(cat <