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

Commit

Permalink
Created a 'remove part_ file' test
Browse files Browse the repository at this point in the history
  • Loading branch information
alstar555 committed Sep 24, 2024
1 parent a1fe557 commit 68c06d8
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/build/40_pull.bats
Original file line number Diff line number Diff line change
Expand Up @@ -555,3 +555,28 @@ EOF
[[ $status -eq 1 ]]
[[ $output = *'registry-1.docker.io:443/charliecloud/metadata:doesnotexist'* ]]
}

@test 'remove part_ files' {
export CH_IMAGE_STORAGE=/var/tmp/albug

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

# list images to invoke error
set +e
out=$(ch-image list 2>&1)
retcode=$?
set -e

echo "--- return code: ${retcode}"
echo '--- output:'
echo "$out"

# 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 68c06d8

Please sign in to comment.