Skip to content

Commit

Permalink
cleanup, debug, and disable parallel in blobcache tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ed Santiago <[email protected]>
  • Loading branch information
edsantiago committed Jun 27, 2024
1 parent a0602b6 commit 06653d5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
18 changes: 12 additions & 6 deletions tests/blobcache.bats
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

load helpers

# The 'rm cachefile' in the "blobs must be reused" test
# causes flakes when parallelizing
function setup_file() {
export BATS_NO_PARALLELIZE_WITHIN_FILE=true
}

@test "blobcache-pull" {
blobcachedir=${TEST_SCRATCH_DIR}/cache
mkdir -p ${blobcachedir}
Expand Down Expand Up @@ -74,14 +80,14 @@ function _check_matches() {

# Clear local image and c/image's blob-info-cache
run_buildah rmi --all -f
cachedir=/var/lib
if is_rootless;
then
run rm $HOME/.local/share/containers/cache/blob-info-cache-v1.sqlite
assert "$status" -eq 0 "status of `run rm $HOME/.local/share/containers/cache/blob-info-cache-v1.sqlite` must be 0"
else
run rm /var/lib/containers/cache/blob-info-cache-v1.sqlite
assert "$status" -eq 0 "status of `run rm /var/lib/containers/cache/blob-info-cache-v1.sqlite` must be 0"
fi
cachedir=$HOME/.local/share
fi
cachefile=$cachedir/containers/cache/blob-info-cache-v1.sqlite
run rm $cachefile
assert "$status" -eq 0 "status of `run rm $cachefile` must be 0"

# In first push blob must be skipped after vendoring https://github.com/containers/image/pull/1645
run_buildah pull dir:${outputdir}
Expand Down
1 change: 1 addition & 0 deletions tests/mkcw.bats
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function mkcw_check_image() {

# Decrypt, mount, and take a look around.
uuid=$(cryptsetup luksUUID "$mountpoint"/disk.img)
echo "# uuid=$uuid" >&3
cryptsetup luksOpen --key-file "$TEST_SCRATCH_DIR"/key "$mountpoint"/disk.img "$uuid"
mkdir -p "$TEST_SCRATCH_DIR"/mount
mount /dev/mapper/"$uuid" "$TEST_SCRATCH_DIR"/mount
Expand Down

0 comments on commit 06653d5

Please sign in to comment.