mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 01:59:07 +00:00
test: add a case for cgroupv2
Signed-off-by: David Scott <dave@recoil.org>
This commit is contained in:
parent
9d16e2a2b9
commit
10599f776a
14
test/cases/040_packages/003_cgroupv2/check.sh
Executable file
14
test/cases/040_packages/003_cgroupv2/check.sh
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
function failed {
|
||||||
|
printf "cgroup not detected, suite FAILED\n" >&1
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
DEVICE=/dev/sdb
|
||||||
|
|
||||||
|
mount | grep cgroup2 || failed
|
||||||
|
|
||||||
|
printf "cgroup2 detected, suite PASSED\n" >&1
|
24
test/cases/040_packages/003_cgroupv2/test.sh
Normal file
24
test/cases/040_packages/003_cgroupv2/test.sh
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# SUMMARY: Run containerd test
|
||||||
|
# LABELS:
|
||||||
|
# REPEAT:
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Source libraries. Uncomment if needed/defined
|
||||||
|
#. "${RT_LIB}"
|
||||||
|
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
|
||||||
|
|
||||||
|
NAME=cgroupv2
|
||||||
|
|
||||||
|
clean_up() {
|
||||||
|
rm -rf ${NAME}-*
|
||||||
|
}
|
||||||
|
trap clean_up EXIT
|
||||||
|
|
||||||
|
# Test code goes here
|
||||||
|
linuxkit build -format kernel+initrd -name "${NAME}" test.yml
|
||||||
|
RESULT="$(linuxkit run -mem 3072 ${NAME})"
|
||||||
|
echo "${RESULT}" | grep -q "suite PASSED"
|
||||||
|
|
||||||
|
exit 0
|
19
test/cases/040_packages/003_cgroupv2/test.yml
Normal file
19
test/cases/040_packages/003_cgroupv2/test.yml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
kernel:
|
||||||
|
image: linuxkit/kernel:5.10.47
|
||||||
|
cmdline: "linuxkit.unified_cgroup_hierarchy=1 console=ttyS0 console=ttyAMA0"
|
||||||
|
init:
|
||||||
|
- linuxkit/init:43c52456571369d62882605e4d510f0df3ed93de
|
||||||
|
- linuxkit/runc:5f9941eed05f58293f928c9f2f0b6a3f9f6f55c1
|
||||||
|
onboot:
|
||||||
|
- name: test
|
||||||
|
image: alpine:3.13
|
||||||
|
binds:
|
||||||
|
- /check.sh:/check.sh
|
||||||
|
- /run:/run
|
||||||
|
command: ["sh", "./check.sh"]
|
||||||
|
- name: poweroff
|
||||||
|
image: linuxkit/poweroff:afe4b3ab865afe1e3ed5c88e58f57808f4f5119f
|
||||||
|
command: ["/bin/sh", "/poweroff.sh", "10"]
|
||||||
|
files:
|
||||||
|
- path: check.sh
|
||||||
|
source: ./check.sh
|
Loading…
Reference in New Issue
Block a user