mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
add dump/restore paths to xfstests/common.dump and set up path for bc
Merge of master-melb:xfs-cmds:30712a by kenmcd. add dump/restore paths to xfstests/common.dump and set up path for bc
This commit is contained in:
@@ -114,6 +114,9 @@ export AWK_PROG="`set_prog_path awk`"
|
|||||||
export SED_PROG="`set_prog_path sed`"
|
export SED_PROG="`set_prog_path sed`"
|
||||||
[ "$SED_PROG" = "" ] && _fatal "sed not found"
|
[ "$SED_PROG" = "" ] && _fatal "sed not found"
|
||||||
|
|
||||||
|
export BC_PROG="`set_prog_path bc`"
|
||||||
|
[ "$BC_PROG" = "" ] && _fatal "bc not found"
|
||||||
|
|
||||||
export PS_ALL_FLAGS="-ef"
|
export PS_ALL_FLAGS="-ef"
|
||||||
|
|
||||||
export DF_PROG="`set_prog_path df`"
|
export DF_PROG="`set_prog_path df`"
|
||||||
@@ -128,6 +131,9 @@ export XFS_GROWFS_PROG=`set_prog_path xfs_growfs`
|
|||||||
export XFS_IO_PROG="`set_prog_path xfs_io`"
|
export XFS_IO_PROG="`set_prog_path xfs_io`"
|
||||||
export XFS_PARALLEL_REPAIR_PROG="`set_prog_path xfs_prepair`"
|
export XFS_PARALLEL_REPAIR_PROG="`set_prog_path xfs_prepair`"
|
||||||
export XFS_PARALLEL_REPAIR64_PROG="`set_prog_path xfs_prepair64`"
|
export XFS_PARALLEL_REPAIR64_PROG="`set_prog_path xfs_prepair64`"
|
||||||
|
export XFSDUMP_PROG="`set_prog_path xfsdump`"
|
||||||
|
export XFSRESTORE_PROG="`set_prog_path xfsrestore`"
|
||||||
|
export XFSINVUTIL_PROG="`set_prog_path xfsinvutil`"
|
||||||
|
|
||||||
# Generate a comparable xfsprogs version number in the form of
|
# Generate a comparable xfsprogs version number in the form of
|
||||||
# major * 10000 + minor * 100 + release
|
# major * 10000 + minor * 100 + release
|
||||||
|
|||||||
+29
-20
@@ -12,14 +12,20 @@ if [ -n "$DEBUGDUMP" ]; then
|
|||||||
_dump_debug=-v4
|
_dump_debug=-v4
|
||||||
_restore_debug=-v4
|
_restore_debug=-v4
|
||||||
_invutil_debug=-d
|
_invutil_debug=-d
|
||||||
|
|
||||||
|
# Use dump/restore in qa directory (copy them here) for debugging
|
||||||
|
export PATH="$here:$PATH"
|
||||||
|
export XFSDUMP_PROG="`set_prog_path xfsdump`"
|
||||||
|
export XFSRESTORE_PROG="`set_prog_path xfsrestore`"
|
||||||
|
export XFSINVUTIL_PROG="`set_prog_path xfsinvutil`"
|
||||||
|
[ -x $here/xfsdump ] && echo "Using xfstests' xfsdump for debug"
|
||||||
|
[ -x $here/xfsrestore ] && echo "Using xfstests' xfsrestore for debug"
|
||||||
|
[ -x $here/xfsinvutil ] && echo "Using xfstests' xfsinvutil for debug"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Use dump/restore in qa directory for debugging
|
[ "$XFSDUMP_PROG" = "" ] && _fatal "xfsdump not found"
|
||||||
PATH="$here:$PATH"
|
[ "$XFSRESTORE_PROG" = "" ] && _fatal "xfsrestore not found"
|
||||||
export PATH
|
[ "$XFSINVUTIL_PROG" = "" ] && _fatal "xfsinvutil not found"
|
||||||
#which xfsdump
|
|
||||||
#which xfsrestore
|
|
||||||
#which xfsinvutil
|
|
||||||
|
|
||||||
# status returned for not run tests
|
# status returned for not run tests
|
||||||
NOTRUNSTS=2
|
NOTRUNSTS=2
|
||||||
@@ -761,6 +767,9 @@ _dump_filter_main()
|
|||||||
{
|
{
|
||||||
_filter_devchar |\
|
_filter_devchar |\
|
||||||
sed \
|
sed \
|
||||||
|
-e "s#$XFSDUMP_PROG#xfsdump#" \
|
||||||
|
-e "s#$XFSRESTORE_PROG#xfsrestore#" \
|
||||||
|
-e "s#$XFSINVUTIL_PROG#xfsinvutil#" \
|
||||||
-e "s/`hostname`/HOSTNAME/" \
|
-e "s/`hostname`/HOSTNAME/" \
|
||||||
-e "s#$SCRATCH_DEV#SCRATCH_DEV#" \
|
-e "s#$SCRATCH_DEV#SCRATCH_DEV#" \
|
||||||
-e "s#$SCRATCH_RAWDEV#SCRATCH_DEV#" \
|
-e "s#$SCRATCH_RAWDEV#SCRATCH_DEV#" \
|
||||||
@@ -906,7 +915,7 @@ _do_dump_sub()
|
|||||||
echo "Dumping to tape..."
|
echo "Dumping to tape..."
|
||||||
opts="$_dump_debug$dump_args -s $dump_sdir -f $dumptape -M $media_label -L $session_label $SCRATCH_MNT"
|
opts="$_dump_debug$dump_args -s $dump_sdir -f $dumptape -M $media_label -L $session_label $SCRATCH_MNT"
|
||||||
echo "xfsdump $opts" | _dir_filter
|
echo "xfsdump $opts" | _dir_filter
|
||||||
xfsdump $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
|
$XFSDUMP_PROG $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -919,7 +928,7 @@ _do_dump()
|
|||||||
echo "Dumping to tape..."
|
echo "Dumping to tape..."
|
||||||
opts="$_dump_debug$dump_args -f $dumptape -M $media_label -L $session_label $SCRATCH_MNT"
|
opts="$_dump_debug$dump_args -f $dumptape -M $media_label -L $session_label $SCRATCH_MNT"
|
||||||
echo "xfsdump $opts" | _dir_filter
|
echo "xfsdump $opts" | _dir_filter
|
||||||
xfsdump $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
|
$XFSDUMP_PROG $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -934,7 +943,7 @@ _do_dump_min()
|
|||||||
onemeg=1048576
|
onemeg=1048576
|
||||||
opts="$_dump_debug$dump_args -m -b $onemeg -l0 -f $dumptape -M $media_label -L $session_label $SCRATCH_MNT"
|
opts="$_dump_debug$dump_args -m -b $onemeg -l0 -f $dumptape -M $media_label -L $session_label $SCRATCH_MNT"
|
||||||
echo "xfsdump $opts" | _dir_filter
|
echo "xfsdump $opts" | _dir_filter
|
||||||
xfsdump $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
|
$XFSDUMP_PROG $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -948,7 +957,7 @@ _do_dump_file()
|
|||||||
echo "Dumping to file..."
|
echo "Dumping to file..."
|
||||||
opts="$_dump_debug$dump_args -f $dump_file -M $media_label -L $session_label $SCRATCH_MNT"
|
opts="$_dump_debug$dump_args -f $dump_file -M $media_label -L $session_label $SCRATCH_MNT"
|
||||||
echo "xfsdump $opts" | _dir_filter
|
echo "xfsdump $opts" | _dir_filter
|
||||||
xfsdump $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
|
$XFSDUMP_PROG $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -970,7 +979,7 @@ _do_dump_multi_file()
|
|||||||
echo "Dumping to files..."
|
echo "Dumping to files..."
|
||||||
opts="$_dump_debug$dump_args $multi_args -L $session_label $SCRATCH_MNT"
|
opts="$_dump_debug$dump_args $multi_args -L $session_label $SCRATCH_MNT"
|
||||||
echo "xfsdump $opts" | _dir_filter
|
echo "xfsdump $opts" | _dir_filter
|
||||||
xfsdump $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
|
$XFSDUMP_PROG $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1004,7 +1013,7 @@ _do_restore()
|
|||||||
echo "Restoring from tape..."
|
echo "Restoring from tape..."
|
||||||
opts="$_restore_debug -f $dumptape -L $session_label $restore_dir"
|
opts="$_restore_debug -f $dumptape -L $session_label $restore_dir"
|
||||||
echo "xfsrestore $opts" | _dir_filter
|
echo "xfsrestore $opts" | _dir_filter
|
||||||
xfsrestore $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
|
$XFSRESTORE_PROG $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -1019,7 +1028,7 @@ _do_restore_min()
|
|||||||
onemeg=1048576
|
onemeg=1048576
|
||||||
opts="$_restore_debug -m -b $onemeg -f $dumptape -L $session_label $restore_dir"
|
opts="$_restore_debug -m -b $onemeg -f $dumptape -L $session_label $restore_dir"
|
||||||
echo "xfsrestore $opts" | _dir_filter
|
echo "xfsrestore $opts" | _dir_filter
|
||||||
xfsrestore $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
|
$XFSRESTORE_PROG $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -1033,7 +1042,7 @@ _do_restore_file()
|
|||||||
echo "Restoring from file..."
|
echo "Restoring from file..."
|
||||||
opts="$_restore_debug -f $dump_file -L $session_label $restore_dir"
|
opts="$_restore_debug -f $dump_file -L $session_label $restore_dir"
|
||||||
echo "xfsrestore $opts" | _dir_filter
|
echo "xfsrestore $opts" | _dir_filter
|
||||||
xfsrestore $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
|
$XFSRESTORE_PROG $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -1050,7 +1059,7 @@ _do_restore_file_cum()
|
|||||||
echo "Restoring cumumlative from file..."
|
echo "Restoring cumumlative from file..."
|
||||||
opts="$_restore_debug -f $dump_file -r $restore_dir"
|
opts="$_restore_debug -f $dump_file -r $restore_dir"
|
||||||
echo "xfsrestore $opts" | _dir_filter
|
echo "xfsrestore $opts" | _dir_filter
|
||||||
xfsrestore $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
|
$XFSRESTORE_PROG $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
|
||||||
}
|
}
|
||||||
|
|
||||||
_do_restore_toc()
|
_do_restore_toc()
|
||||||
@@ -1059,7 +1068,7 @@ _do_restore_toc()
|
|||||||
opts="$_restore_debug -f $dump_file -t"
|
opts="$_restore_debug -f $dump_file -t"
|
||||||
echo "xfsrestore $opts" | _dir_filter
|
echo "xfsrestore $opts" | _dir_filter
|
||||||
cd $SCRATCH_MNT # for IRIX which needs xfs cwd
|
cd $SCRATCH_MNT # for IRIX which needs xfs cwd
|
||||||
xfsrestore $opts 2>&1 | tee -a $here/$seq.full | _dump_filter_main |\
|
$XFSRESTORE_PROG $opts 2>&1 | tee -a $here/$seq.full | _dump_filter_main |\
|
||||||
_check_quota_file |\
|
_check_quota_file |\
|
||||||
_check_quota_entries |\
|
_check_quota_entries |\
|
||||||
$AWK_PROG 'NF != 1 { print; next }
|
$AWK_PROG 'NF != 1 { print; next }
|
||||||
@@ -1090,7 +1099,7 @@ _do_restore_multi_file()
|
|||||||
echo "Restoring from file..."
|
echo "Restoring from file..."
|
||||||
opts="$_restore_debug $multi_args -L $session_label $restore_dir"
|
opts="$_restore_debug $multi_args -L $session_label $restore_dir"
|
||||||
echo "xfsrestore $opts" | _dir_filter
|
echo "xfsrestore $opts" | _dir_filter
|
||||||
xfsrestore $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
|
$XFSRESTORE_PROG $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -1106,7 +1115,7 @@ _do_dump_restore()
|
|||||||
restore_opts="$_restore_debug - $restore_dir"
|
restore_opts="$_restore_debug - $restore_dir"
|
||||||
dump_opts="$_dump_debug$dump_args -s $dump_sdir - $SCRATCH_MNT"
|
dump_opts="$_dump_debug$dump_args -s $dump_sdir - $SCRATCH_MNT"
|
||||||
echo "xfsdump $dump_opts | xfsrestore $restore_opts" | _dir_filter
|
echo "xfsdump $dump_opts | xfsrestore $restore_opts" | _dir_filter
|
||||||
xfsdump $dump_opts 2>$tmp.dump.mlog | xfsrestore $restore_opts 2>&1 | tee -a $here/$seq.full | _dump_filter
|
$XFSDUMP_PROG $dump_opts 2>$tmp.dump.mlog | $XFSRESTORE_PROG $restore_opts 2>&1 | tee -a $here/$seq.full | _dump_filter
|
||||||
_dump_filter <$tmp.dump.mlog
|
_dump_filter <$tmp.dump.mlog
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1244,7 +1253,7 @@ _diff_compare()
|
|||||||
#
|
#
|
||||||
_dump_inventory()
|
_dump_inventory()
|
||||||
{
|
{
|
||||||
xfsdump $_dump_debug -I | tee -a $here/$seq.full | _dump_filter_main
|
$XFSDUMP_PROG $_dump_debug -I | tee -a $here/$seq.full | _dump_filter_main
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -1255,7 +1264,7 @@ _do_invutil()
|
|||||||
{
|
{
|
||||||
host=`hostname`
|
host=`hostname`
|
||||||
echo "xfsinvutil $_invutil_debug -M $host:$SCRATCH_MNT \"$middate\" $*" >$here/$seq.full
|
echo "xfsinvutil $_invutil_debug -M $host:$SCRATCH_MNT \"$middate\" $*" >$here/$seq.full
|
||||||
xfsinvutil $_invutil_debug $* -M $host:$SCRATCH_MNT "$middate" \
|
$XFSINVUTIL_PROG $_invutil_debug $* -M $host:$SCRATCH_MNT "$middate" \
|
||||||
| tee -a $here/$seq.full | _invutil_filter
|
| tee -a $here/$seq.full | _invutil_filter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user