Instead, call _cleanup_dump explicitly from a private _cleanup.
Remove the generic cleanup bits (rm $tmp.*) from _cleanup_dump.
The only xfs/dump test that had anything other than rm $tmp.* in
_cleanup in xfs/287, but that was _scratch_unmount, which is not
needed anyway.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
nobody=4 # define this uid/gid as a number
do_quota_check=true # do quota check if quotas enabled
-# install our cleaner
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
# start inventory from a known base - move it aside for test
for dir in /var/xfsdump/inventory /var/lib/xfsdump/inventory; do
if [ -d $dir ]; then
# Cleanup created dirs and files
# Called by trap
#
-_cleanup()
+_cleanup_dump()
{
# Some tests include this before checking _supported_fs xfs
# and the sleeps & checks here get annoying
fi
cd $here
- rm -f $tmp.*
if [ -n "$DEBUGDUMP" ]; then
# save it for inspection
here=`pwd`
tmp=/tmp/$$
status=0 # success is the default!
-trap "rm -rf $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
. ./common/rc
. ./common/dump
here=`pwd`
tmp=/tmp/$$
status=0 # success is the default!
-trap "rm -rf $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=0 # success is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=0 # success is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=0 # success is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=0 # success is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=0 # success is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=0 # success is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=0 # success is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=0 # success is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=0 # success is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
_cleanup()
{
+ _cleanup_dump
cd /
rm -f $tmp.*
}
here=`pwd`
tmp=/tmp/$$
status=0 # success is the default!
-trap "rm -rf $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
. ./common/rc
. ./common/dump
here=`pwd`
tmp=/tmp/$$
status=0 # success is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
#
# Add a new file and append a subset of the fill'ed files
here=`pwd`
tmp=/tmp/$$
status=0 # success is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
#
# create a 40 MiB file with an extended attr.
here=`pwd`
tmp=/tmp/$$
status=0 # success is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
#
# create two 12 MiB files with extended attrs.
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_dump
+ cd /
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
_cleanup()
{
+ _cleanup_dump
cd /
- _scratch_unmount 2>/dev/null
rm -rf $tmp.*
}
_cleanup()
{
+ _cleanup_dump
cd /
rm -f $tmp.*
}
_cleanup()
{
+ _cleanup_dump
cd /
rm -f $tmp.*
}
_cleanup()
{
+ _cleanup_dump
cd /
rm -f $tmp.*
}