blob: 01cff7b08da914ed53267bf99899c843e1c1c620 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2019 Oracle, Inc. All Rights Reserved.
#
# FS QA Test No. 503
#
# Populate a XFS filesystem and ensure that metadump and mdrestore all work
# properly.
#
. ./common/preamble
_begin_fstest auto metadump
_register_cleanup "_cleanup" BUS
# Override the default cleanup function.
_cleanup()
{
cd /
rm -rf $tmp.* $testdir
_xfs_cleanup_verify_metadump
}
# Import common functions.
. ./common/filter
. ./common/populate
. ./common/metadump
testdir=$TEST_DIR/test-$seq
# real QA test starts here
_supported_fs xfs
_require_command "$XFS_MDRESTORE_PROG" "xfs_mdrestore"
_require_loop
_require_scratch_nocheck
_require_populate_commands
_xfs_skip_online_rebuild
_xfs_skip_offline_rebuild
_xfs_setup_verify_metadump
echo "Format and populate"
_scratch_populate_cached nofill > $seqres.full 2>&1
mkdir -p $testdir
metadump_file=$testdir/scratch.md
copy_file=$testdir/copy.img
echo "metadump and mdrestore"
_xfs_verify_metadumps
echo "metadump a and mdrestore"
_xfs_verify_metadumps '-a'
echo "metadump o and mdrestore"
_xfs_verify_metadumps '-o'
echo "metadump ao and mdrestore"
_xfs_verify_metadumps '-a -o'
# success, all done
status=0
exit
|