Debian Codegraph @

debian/tests/tools-cgroupv2

raw symbols SCIP
1 #!/bin/sh
2
3 # Author: Santiago Ruano Rincón <[email protected]>
4 # 2021-03-18
5 # License: GPLv3
6
7 # Test some of the tools included in cgroup-tools on cgroupv2 support
8
9 set -e
10
11 CGROUP2MOUNTED=$(grep cgroup2 /proc/mounts)
12 if [ "$CGROUP2MOUNTED" != 0 ]; then
13 if [ ! "$AUTOPKGTEST_REBOOT_MARK" = "cgroupv2-prepare" ]; then
14 sed -i '/GRUB_CMDLINE_LINUX_DEFAULT/ s/GRUB_CMDLINE_LINUX_DEFAULT="\(.*\)"/GRUB_CMDLINE_LINUX_DEFAULT="\1 systemd.unified_cgroup_hierarchy=true swapaccount=1"/' /etc/default/grub
15 update-grub 2>&1
16 /tmp/autopkgtest-reboot cgroupv2-prepare
17 fi
18 fi
19
20 cat /proc/mounts | grep cgroup
21
22 echo "test cgcreate"
23 cgcreate -g cpuset:test
24 echo "test lscgroup"
25 lscgroup | grep test
26 echo "test cgset"
27 cgset -r cpuset.cpus=0 test
28 echo "test cgget"
29 cgget -g cpuset:test
30 echo "test cgcreate"
31 cgexec -g cpuset:test ls -l