File: tutorial.bats

package info (click to toggle)
golang-github-containers-buildah 1.39.3%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,724 kB
  • sloc: sh: 2,398; makefile: 236; perl: 187; asm: 16; awk: 12; ansic: 1
file content (25 lines) | stat: -rw-r--r-- 672 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env bats

load helpers

@test "tutorial-cgroups" {
	# confidence check for the sake of packages that consume our library
	skip_if_no_runtime
	skip_if_cgroupsv1
	skip_if_rootless_environment
	skip_if_chroot

	_prefetch quay.io/libpod/alpine
	run ${TUTORIAL_BINARY}
	buildoutput="$output"
	# shouldn't have the "root" scope in our cgroups
	echo "build output:"
	echo "${output}"
	! grep -q init.scope <<< "$buildoutput"
	run sed -e '0,/^CUT START/d' -e '/^CUT END/,//d' <<< "$buildoutput"
	# should've found a /sys/fs/cgroup with stuff in it
	echo "contents of /sys/fs/cgroup:"
	echo "${output}"
	echo "number of lines: ${#lines[@]}"
	test "${#lines[@]}" -gt 2
}