2017-07-02 22:38:32 +03:00
#!/usr/bin/env bash
2012-03-16 17:00:05 +04:00
# Copyright (C) 2008-2011 Red Hat, Inc. All rights reserved.
2007-09-18 18:02:22 +04:00
#
# 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,
2016-01-21 13:49:46 +03:00
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2007-09-18 18:00:42 +04:00
2008-10-06 20:47:07 +04:00
# 'Ensure that pvmove diagnoses PE-range values 2^32 and larger.'
2007-09-18 18:00:42 +04:00
2018-05-24 17:49:48 +03:00
2016-02-23 01:13:42 +03:00
2014-06-06 19:40:04 +04:00
. lib/inittest
2007-09-18 18:00:42 +04:00
2008-10-06 20:47:07 +04:00
aux prepare_vg 2
2007-09-18 18:00:42 +04:00
2015-03-13 13:39:55 +03:00
lvcreate -L4 -n $lv $vg
2007-09-18 18:00:42 +04:00
# Test for the bogus diagnostic reported in BZ 284771
2008-04-04 15:59:31 +04:00
# http://bugzilla.redhat.com/284771.
2008-10-06 20:47:07 +04:00
# 'run pvmove with an unrecognized LV name to show bad diagnostic'
2012-03-16 17:00:05 +04:00
not pvmove -v -nbogus " $dev1 " " $dev2 " 2> err
grep "Logical volume bogus not found." err
2007-09-18 18:00:42 +04:00
# With lvm-2.02.28 and earlier, on a system with 64-bit "long int",
# the PE range parsing code would accept values up to 2^64-1, but would
2008-10-06 20:47:07 +04:00
# silently truncate them to int32_t. I.e., $dev1:$(echo 2^32|bc) would be
# treated just like $dev1:0.
# 'run the offending pvmove command'
2012-03-16 17:00:05 +04:00
not pvmove -v -n$lv " $dev1 " :4294967296 " $dev2 "
2007-09-18 18:00:42 +04:00
2016-12-11 12:18:44 +03:00
vgremove -ff $vg