summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 16:28:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 16:28:49 +0000
commit3639cda7289cb00a5de837f84dc1b54243bd72e8 (patch)
tree2bb2220e791c493e0f4163ff8a819876bc211e41 /tests
parentReleasing progress-linux version 1.52.0+ds1-1~progress7.99u1. (diff)
downloadgolang-github-containers-storage-3639cda7289cb00a5de837f84dc1b54243bd72e8.tar.xz
golang-github-containers-storage-3639cda7289cb00a5de837f84dc1b54243bd72e8.zip
Merging upstream version 1.53.0+ds1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/image-dirs.bats39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/image-dirs.bats b/tests/image-dirs.bats
new file mode 100644
index 0000000..64f799e
--- /dev/null
+++ b/tests/image-dirs.bats
@@ -0,0 +1,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/"
+}