File: image-dirs.bats

package info (click to toggle)
golang-github-containers-storage 1.59.1%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 4,184 kB
  • sloc: sh: 630; ansic: 389; makefile: 143; awk: 12
file content (39 lines) | stat: -rw-r--r-- 1,007 bytes parent folder | download | duplicates (3)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bats

load helpers

@test "image-dirs" {
	# Create a layer.
	run storage --debug=false create-layer
	[ "$status" -eq 0 ]
	[ "$output" != "" ]
	layer=$output

	# Check that the layer can be found.
	storage exists -l $layer

	# Create an image using the layer.
	run storage --debug=false create-image -m danger $layer
	[ "$status" -eq 0 ]
	[ "$output" != "" ]
	image=${output%%	*}

	# Check that the image can be found.
	storage exists -i $image

	# Check that the image's user data directory is somewhere under the root.
	run storage --debug=false get-image-dir $image
	[ "$status" -eq 0 ]
	[ "$output" != "" ]
	dir=${output%%	*}
	touch "$dir"/dirfile
	echo "$dir"/dirfile | grep -q ^"${TESTDIR}/root/"

	# Check that the image's user run data directory is somewhere under the run root.
	run storage --debug=false get-image-run-dir $image
	[ "$status" -eq 0 ]
	[ "$output" != "" ]
	rundir=${output%%	*}
	touch "$rundir"/rundirfile
	echo "$rundir"/rundirfile | grep -q ^"${TESTDIR}/runroot/"
}