File: integration-evacuate-cgroup2.sh

package info (click to toggle)
rootlesskit 2.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 636 kB
  • sloc: sh: 433; makefile: 25
file content (12 lines) | stat: -rwxr-xr-x 472 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash
source $(realpath $(dirname $0))/common.inc.sh

# Test requires systemd, so skipped on CI.
# Should work on both unified mode and "hybrid" mode.

# NOTE: extra sed is for eliminating tty escape sequence
group="$(systemd-run --user -t -q -- $ROOTLESSKIT --cgroupns --pidns --evacuate-cgroup2=evac grep -oP '0::\K.*' /proc/self/cgroup | sed 's/[^[:print:]]//g')"
if [ "$group" != "/evac" ]; then
  ERROR "expected group \"/evac\", got \"${group}\"."
  exit 1
fi