tests/checkpoint: add simple c/r test for cgroupns

Same test as the first one, just with cgroupns enabled.

Since in case of cgroupv2 `runc spec` enables cgroupns,
this case was already tested by the first checkpoint test,
so skip it.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin 2020-04-20 17:56:08 -07:00
parent cdce577dcf
commit 00a2844ab4
1 changed files with 15 additions and 1 deletions

View File

@ -43,7 +43,7 @@ function check_pipes() {
[[ "${output}" == *"ponG Ping"* ]] [[ "${output}" == *"ponG Ping"* ]]
} }
@test "checkpoint and restore" { function simple_cr() {
runc run -d --console-socket $CONSOLE_SOCKET test_busybox runc run -d --console-socket $CONSOLE_SOCKET test_busybox
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
@ -69,6 +69,20 @@ function check_pipes() {
done done
} }
@test "checkpoint and restore " {
simple_cr
}
@test "checkpoint and restore (cgroupns)" {
# cgroupv2 already enables cgroupns so this case was tested above already
requires cgroups_v1
# enable CGROUPNS
sed -i 's|\("namespaces": \[\)|\1\n\t\t\t{"type": "cgroup"},|' config.json
simple_cr
}
@test "checkpoint --pre-dump and restore" { @test "checkpoint --pre-dump and restore" {
setup_pipes setup_pipes