2017-07-02 22:38:32 +03:00
#!/usr/bin/env bash
2017-02-23 17:09:29 +03:00
# Copyright (C) 2017 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA2110-1301 USA
2018-05-24 17:49:48 +03:00
2017-02-23 17:09:29 +03:00
SKIP_WITH_LVMPOLLD = 1
. lib/inittest
which mkfs.ext4 || skip
aux have_raid 1 3 5 || skip
aux prepare_vg 4
2017-07-06 20:41:25 +03:00
get_devs
2017-02-23 17:09:29 +03:00
2017-07-10 11:40:09 +03:00
for d in " $dev1 " " $dev2 " " $dev3 " " $dev4 "
2017-02-23 17:09:29 +03:00
do
2017-07-10 11:40:09 +03:00
aux delay_dev " $d " 0 20 " $( get first_extent_sector " $d " ) "
2017-02-23 17:09:29 +03:00
done
#
2017-03-04 01:22:29 +03:00
# Test writemostly prohibited on resynchronizing raid1
2017-02-23 17:09:29 +03:00
#
2017-03-07 17:18:13 +03:00
# Create 4-way raid1 LV
2017-03-16 10:49:52 +03:00
lvcreate -aey --ty raid1 -m 3 -Zn -L16M -n $lv1 $vg
2023-08-17 22:50:48 +03:00
if test " ${ LVM_VALGRIND :- 0 } " -eq 0 ; then
2017-07-10 11:40:09 +03:00
not lvchange -y --writemostly " $dev1 " " $vg / $lv1 "
2017-02-23 17:09:29 +03:00
check lv_field $vg /$lv1 segtype "raid1"
check lv_field $vg /$lv1 stripes 4
check lv_attr_bit health $vg /${ lv1 } _rimage_0 "-"
2023-08-17 22:50:48 +03:00
fi
2017-07-06 20:41:25 +03:00
aux enable_dev " ${ DEVICES [@] } "
2017-02-23 17:09:29 +03:00
aux wait_for_sync $vg $lv1
2017-07-10 11:40:09 +03:00
lvchange -y --writemostly " $dev1 " " $vg / $lv1 "
2017-02-23 17:09:29 +03:00
check lv_attr_bit health $vg /${ lv1 } _rimage_0 "w"
vgremove -ff $vg