#! /bin/bash # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2019 Oracle, Inc. All Rights Reserved. # # FS QA Test No. 601 # # Populate a XFS filesystem and ensure that xfs_copy works properly. # . ./common/preamble _begin_fstest auto copy _register_cleanup "_cleanup" BUS # Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } # Import common functions. . ./common/filter . ./common/populate testdir=$TEST_DIR/test-$seq # real QA test starts here _supported_fs xfs _require_xfs_copy _require_scratch_nocheck _require_populate_commands _xfs_skip_online_rebuild _xfs_skip_offline_rebuild echo "Format and populate" _scratch_populate_cached nofill > $seqres.full 2>&1 mkdir -p $testdir copy_file=$testdir/copy.img echo copy $XFS_COPY_PROG $SCRATCH_DEV $copy_file >> $seqres.full _check_scratch_fs $copy_file echo recopy $XFS_COPY_PROG $copy_file $SCRATCH_DEV >> $seqres.full _scratch_mount _check_scratch_fs _scratch_unmount # success, all done status=0 exit