summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Schmidt <list.btrfs@jan-o-sch.net>2013-02-14 11:02:09 +0100
committerJan Schmidt <janosch@webgods.de>2013-02-25 10:25:07 +0100
commitc0904742dc1e338b1942a61e6e3d86ead90f3452 (patch)
treeb0eb6108ef07aa7083ba8f1307968161b2b30de2
parent678074a115ffc22c14054a4d2029a15f85b720b0 (diff)
downloadfar-progs-c0904742dc1e338b1942a61e6e3d86ead90f3452.tar.gz
far-progs: remove temp files on interrupt unless -k
-rwxr-xr-xtest.pl21
1 files changed, 12 insertions, 9 deletions
diff --git a/test.pl b/test.pl
index 412f656..5b78e58 100755
--- a/test.pl
+++ b/test.pl
@@ -247,7 +247,19 @@ if ($src_type eq "zfs") {
die;
}
+sub cleanup_temp {
+ if (!$keep_temp) {
+ ignore_local("umount", $dst_mnt);
+ ignore_remote("umount", $src_mnt);
+ ignore_local("rm", "-rf", $p_fardir);
+ if ($remote_host) {
+ ignore_remote("rm", "-rf", $p_fardir);
+ }
+ }
+}
+
sub cleanup {
+ cleanup_temp();
if ($ssh_chld) {
kill "TERM", $ssh_chld;
unlink $ssh_socket;
@@ -430,15 +442,6 @@ if (@failed_tests) {
print "\nAll tests ok\n";
}
-if (!$keep_temp) {
- do_local("umount", $dst_mnt);
- do_remote("umount", $src_mnt);
- do_local("rm", "-rf", $p_fardir);
- if ($remote_host) {
- do_remote("rm", "-rf", $p_fardir);
- }
-}
-
exit($ex_ret);
END {