Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

Commit 68c06d8

Browse files
committed
Created a 'remove part_ file' test
1 parent a1fe557 commit 68c06d8

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/build/40_pull.bats

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,3 +555,28 @@ EOF
555555
[[ $status -eq 1 ]]
556556
[[ $output = *'registry-1.docker.io:443/charliecloud/metadata:doesnotexist'* ]]
557557
}
558+
559+
@test 'remove part_ files' {
560+
export CH_IMAGE_STORAGE=/var/tmp/albug
561+
562+
# create a part_ file
563+
touch /var/tmp/albug/dlcache/part_PROBLEM
564+
565+
# list images to invoke error
566+
set +e
567+
out=$(ch-image list 2>&1)
568+
retcode=$?
569+
set -e
570+
571+
echo "--- return code: ${retcode}"
572+
echo '--- output:'
573+
echo "$out"
574+
575+
# check if output errors
576+
if [[ $retcode -ne 0 ]]; then
577+
echo "fail: part_ file wasn't cleaned properly."
578+
# Clean up the file if the test fails
579+
rm /var/tmp/albug/dlcache/part_PROBLEM
580+
exit 1
581+
fi
582+
}

0 commit comments

Comments
 (0)