From c29dbae5b2497ea7f17b832fe9860ef365a041ae Mon Sep 17 00:00:00 2001 From: Penny Zheng Date: Wed, 15 Apr 2020 11:09:29 +0800 Subject: [PATCH] tests: deleting when tests failed We only dumped test results for debugging, when tests failed. we should also delete them for avoiding leaving stale test results under /tmp. Fixes: #442 Signed-off-by: Penny Zheng --- tests/test_images.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_images.sh b/tests/test_images.sh index 8ccd24ba2c..a3a7757bbb 100755 --- a/tests/test_images.sh +++ b/tests/test_images.sh @@ -177,6 +177,7 @@ exit_handler() if [ -d "${tmp_rootfs}" ]; then info "rootfs:" sudo -E ls -l "${tmp_rootfs}" >&2 + sudo -E rm -rf "${tmp_rootfs}" else info "no rootfs created" # If no rootfs are created, no need to dump other info @@ -186,6 +187,7 @@ exit_handler() if [ -d "${images_dir}" ]; then info "images:" sudo -E ls -l "${images_dir}" >&2 + sudo -E rm -rf "${images_dir}" else info "no images created" # If no images are created, no need to dump other info