diff --git a/test/build/40_pull.bats b/test/build/40_pull.bats index 230a40fd2..6acf18f4b 100644 --- a/test/build/40_pull.bats +++ b/test/build/40_pull.bats @@ -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) @@ -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 }