diff --git a/func/core/pkg_coreutils/12-cat.sh b/func/core/pkg_coreutils/12-cat.sh index c4c5929..816c901 100755 --- a/func/core/pkg_coreutils/12-cat.sh +++ b/func/core/pkg_coreutils/12-cat.sh @@ -1,5 +1,6 @@ #!/bin/bash r_log "coreutils" "Testing cat" +trap "/bin/rm /var/tmp/cattest" EXIT cat > /var/tmp/cattest < ${HASHFILE} @@ -22,5 +23,3 @@ r_checkExitStatus $? r_log "coreutils" "Test sha512sum" /usr/bin/sha512sum ${HASHFILE} | grep -q e50554c29a5cb7bd04279d3c0918e486024c79c4b305a2e360a97d4021dacf56ce0d17fa6e6a0e81ad03d5fb74fbe2d50cce6081c2c277f22b958cdae978a2f5 r_checkExitStatus $? - -/bin/rm ${HASHFILE} diff --git a/func/core/pkg_coreutils/21-touch-ls.sh b/func/core/pkg_coreutils/21-touch-ls.sh index 53f6a95..d3a5519 100755 --- a/func/core/pkg_coreutils/21-touch-ls.sh +++ b/func/core/pkg_coreutils/21-touch-ls.sh @@ -1,5 +1,6 @@ #!/bin/bash r_log "coreutils" "Testing touch and ls" +trap '/bin/rm /tmp/touch-?' EXIT r_log "coreutils" "Touch files with specific dates" touch -t 199104230420 /tmp/touch-1 @@ -10,5 +11,3 @@ r_log "coreutils" "Verify that the oldest file is last" ls -lt /tmp/touch-? | tail -n 1 | grep -q 'touch-1' r_checkExitStatus $? - -/bin/rm /tmp/touch-? diff --git a/func/core/pkg_coreutils/22-uniq.sh b/func/core/pkg_coreutils/22-uniq.sh index 042554d..70af6a9 100755 --- a/func/core/pkg_coreutils/22-uniq.sh +++ b/func/core/pkg_coreutils/22-uniq.sh @@ -1,5 +1,6 @@ #!/bin/bash r_log "coreutils" "Ensure uniq works as expected" +trap '/bin/rm /var/tmp/uniq' EXIT cat > /var/tmp/uniq < /var/tmp/wc < /etc/cron.hourly/rocky.sh < /dev/null && { r_log "findutils" "Why did this get a 0 exit?"; exit "$FAIL"; } ret_val=$? -if [ "$ret_val" -ne 0 ]; then - r_checkExitStatus $? -fi - -rm -rf "$TMPDIR" +r_checkExitStatus $ret_val