From 0f999f9ae4dde6fe3640a0fe86ffdf0020ab4a01 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Sat, 24 Sep 2022 21:13:15 +0100 Subject: [PATCH] smoke test : remove temporary files afterwards --- tests/smoke/run.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/smoke/run.sh b/tests/smoke/run.sh index 29f954a..8f0bc4e 100755 --- a/tests/smoke/run.sh +++ b/tests/smoke/run.sh @@ -2,10 +2,12 @@ set -e NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-build '' -I liminix-config=./configuration.nix --arg device "import " -A outputs.squashfs -o smoke.img $* TESTS=$(cat <<"EOF" - -trap 'echo "command $(eval echo $BASH_COMMAND) failed with exit code $?"; exit $?' ERR +test -n "${TMPDIR}" dest_path=${TMPDIR}/smoke.img-$$ echo $dest_path +cleanup(){ test -n ${dest_path} && test -d ${dest_path} && chmod -R +w ${dest_path} && rm -rf ${dest_path}; } +trap cleanup EXIT +trap 'echo "command $(eval echo $BASH_COMMAND) failed with exit code $?"; exit $?' ERR unsquashfs -q -d $dest_path -excludes smoke.img /dev cd $dest_path; db=nix/store/*-s6-rc-db/compiled/