From 2bd71864bd5655853c48f4259fc883c2467d9f2e Mon Sep 17 00:00:00 2001 From: Angelica Date: Wed, 25 Sep 2024 14:50:15 -0400 Subject: [PATCH] Made corrections to test --- test/build/40_pull.bats | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) 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 }