Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
Made corrections to test
Browse files Browse the repository at this point in the history
  • Loading branch information
alstar555 committed Sep 25, 2024
1 parent 1ffa087 commit 2bd7186
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions test/build/40_pull.bats
Original file line number Diff line number Diff line change
Expand Up @@ -557,11 +557,15 @@ EOF
}

@test 'remove part_ files' {
export CH_IMAGE_STORAGE=/var/tmp/albug
export CH_IMAGE_STORAGE=/var/tmp/tmpdir
ch-image pull alpine

# create directory
mkdir -p /var/tmp/tmpdir/dlcache

# create a part_ file
touch /var/tmp/tmpdir/dlcache/part_PROBLEM

# create a part_ file
touch /var/tmp/albug/dlcache/part_PROBLEM

# list images to invoke error
set +e
out=$(ch-image list 2>&1)
Expand All @@ -571,12 +575,13 @@ EOF
echo "--- return code: ${retcode}"
echo '--- output:'
echo "$out"


# clean up the directory
rm -rf /var/tmp/tmpdir

# check if output errors
if [[ $retcode -ne 0 ]]; then
echo "fail: part_ file wasn't cleaned properly."
# Clean up the file if the test fails
rm /var/tmp/albug/dlcache/part_PROBLEM
exit 1
fi
}

0 comments on commit 2bd7186

Please sign in to comment.