mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
7e98d41a6e
Refactor every test in the entire test suite to use the new boilerplate functions. This also migrates all the test group information into the test files. This patch has been autogenerated via the command: ./tools/convert-group btrfs ceph cifs ext4 f2fs generic nfs ocfs2 overlay perf shared udf xfs Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Allison Henderson <allison.henderson@oracle.com> Reviewed-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
61 lines
1.4 KiB
Bash
Executable File
61 lines
1.4 KiB
Bash
Executable File
#! /bin/bash
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
# Copyright (c) 2019 Oracle. All Rights Reserved.
|
|
#
|
|
# FS QA Test 198
|
|
#
|
|
# Test stale and alien non-btrfs device in the fs devices list.
|
|
# Bug fixed in:
|
|
# btrfs: remove identified alien device in open_fs_devices
|
|
#
|
|
. ./common/preamble
|
|
_begin_fstest quick volume
|
|
|
|
# Import common functions.
|
|
. ./common/filter
|
|
. ./common/filter.btrfs
|
|
|
|
# real QA test starts here
|
|
_supported_fs btrfs
|
|
_require_command "$WIPEFS_PROG" wipefs
|
|
_require_scratch
|
|
_require_scratch_dev_pool 4
|
|
|
|
workout()
|
|
{
|
|
raid=$1
|
|
device_nr=$2
|
|
|
|
echo $raid
|
|
_scratch_dev_pool_get $device_nr
|
|
|
|
_scratch_pool_mkfs "-d$raid -m$raid" >> $seqres.full 2>&1 || \
|
|
_fail "mkfs failed"
|
|
|
|
# Make device_1 a free btrfs device for the raid created above by
|
|
# clearing its superblock
|
|
|
|
# don't test with the first device as auto fs check (_check_scratch_fs)
|
|
# picks the first device
|
|
device_1=$(echo $SCRATCH_DEV_POOL | awk '{print $2}')
|
|
$WIPEFS_PROG -a $device_1 >> $seqres.full 2>&1
|
|
|
|
device_2=$(echo $SCRATCH_DEV_POOL | awk '{print $1}')
|
|
_mount -o degraded $device_2 $SCRATCH_MNT
|
|
# Check if missing device is reported as in the 196.out
|
|
$BTRFS_UTIL_PROG filesystem show -m $SCRATCH_MNT | \
|
|
_filter_btrfs_filesystem_show
|
|
|
|
_scratch_unmount
|
|
_scratch_dev_pool_put
|
|
}
|
|
|
|
workout "raid1" "2"
|
|
workout "raid5" "3"
|
|
workout "raid6" "4"
|
|
workout "raid10" "4"
|
|
|
|
# success, all done
|
|
status=0
|
|
exit
|