xref: /dflybsd-src/contrib/lvm2/dist/test/t-pv-range-overflow.sh (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
1*86d7f5d3SJohn Marino#!/bin/sh
2*86d7f5d3SJohn Marino# Copyright (C) 2008 Red Hat, Inc. All rights reserved.
3*86d7f5d3SJohn Marino#
4*86d7f5d3SJohn Marino# This copyrighted material is made available to anyone wishing to use,
5*86d7f5d3SJohn Marino# modify, copy, or redistribute it subject to the terms and conditions
6*86d7f5d3SJohn Marino# of the GNU General Public License v.2.
7*86d7f5d3SJohn Marino#
8*86d7f5d3SJohn Marino# You should have received a copy of the GNU General Public License
9*86d7f5d3SJohn Marino# along with this program; if not, write to the Free Software Foundation,
10*86d7f5d3SJohn Marino# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
11*86d7f5d3SJohn Marino
12*86d7f5d3SJohn Marino# 'Ensure that pvmove diagnoses PE-range values 2^32 and larger.'
13*86d7f5d3SJohn Marino
14*86d7f5d3SJohn Marino. ./test-utils.sh
15*86d7f5d3SJohn Marino
16*86d7f5d3SJohn Marinoaux prepare_vg 2
17*86d7f5d3SJohn Marino
18*86d7f5d3SJohn Marinolvcreate -L4 -n"$lv" $vg
19*86d7f5d3SJohn Marino
20*86d7f5d3SJohn Marino# Test for the bogus diagnostic reported in BZ 284771
21*86d7f5d3SJohn Marino# http://bugzilla.redhat.com/284771.
22*86d7f5d3SJohn Marino# 'run pvmove with an unrecognized LV name to show bad diagnostic'
23*86d7f5d3SJohn Marinonot pvmove -v -nbogus $dev1 $dev2 2> err
24*86d7f5d3SJohn Marinogrep "  Logical volume bogus not found." err
25*86d7f5d3SJohn Marino
26*86d7f5d3SJohn Marino# With lvm-2.02.28 and earlier, on a system with 64-bit "long int",
27*86d7f5d3SJohn Marino# the PE range parsing code would accept values up to 2^64-1, but would
28*86d7f5d3SJohn Marino# silently truncate them to int32_t.  I.e., $dev1:$(echo 2^32|bc) would be
29*86d7f5d3SJohn Marino# treated just like $dev1:0.
30*86d7f5d3SJohn Marino# 'run the offending pvmove command'
31*86d7f5d3SJohn Marinonot pvmove -v -n$lv $dev1:4294967296 $dev2
32*86d7f5d3SJohn Marino
33