summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-05-05 07:54:47 +0200
committerJim Meyering <meyering@redhat.com>2009-05-05 08:52:09 +0200
commit8d00fb26f1bd5847f8e1318fdb99c8ef256dbece (patch)
tree67069b024bc0de020503cf6a0e1e515fc757eb38 /tests
parent1d02be3b9ddac1fa51e91bc46bc736603bd615d7 (diff)
downloadcoreutils-8d00fb26f1bd5847f8e1318fdb99c8ef256dbece.tar.xz
tests: rm/one-file-system: umount more reliably
* tests/rm/one-file-system: Run umount via trap, so it runs also upon irregular termination.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/rm/one-file-system9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/rm/one-file-system b/tests/rm/one-file-system
index 2de7678dd..c8e11eb54 100755
--- a/tests/rm/one-file-system
+++ b/tests/rm/one-file-system
@@ -1,7 +1,7 @@
#!/bin/sh
# Demonstrate rm's new --one-file-system option.
-# Copyright (C) 2006-2008 Free Software Foundation, Inc.
+# Copyright (C) 2006-2009 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -25,7 +25,11 @@ fi
require_root_
# If used, these must *follow* test-lib.sh.
-cleanup_() { rm -rf "$other_partition_tmpdir"; }
+cleanup_()
+{
+ umount "$other_partition_tmpdir"
+ rm -rf "$other_partition_tmpdir"
+}
. "$abs_srcdir/other-fs-tmpdir"
t=$other_partition_tmpdir
@@ -41,7 +45,6 @@ fail=0
rm --one-file-system -rf a 2> out && fail=1
test -d $t/y || fail=1
-umount $t
compare out exp || fail=1