2012-03-16 17:00:05 +04:00
#!/bin/sh
2008-08-05 16:33:41 +04:00
# Copyright (C) 2007 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2011-01-05 03:16:18 +03:00
. lib/test
2008-08-05 16:33:41 +04:00
2012-03-16 17:00:05 +04:00
env printf "" || skip # skip if printf is not available
2008-08-05 16:33:41 +04:00
# create the old GFS pool labeled linear devices
create_pool_label_( )
{
2008-09-29 20:02:50 +04:00
# FIXME
# echo -e is bashism, dash builtin sh doesn't do \xNN in printf either
# printf comes from coreutils, and is probably not posix either
2012-03-16 17:00:05 +04:00
env printf "\x01\x16\x70\x06\x5f\xcf\xff\xb9\xf8\x24\x8apool1" | dd of = " $2 " bs = 5 seek = 1 conv = notrunc
2008-09-29 20:02:50 +04:00
env printf " \x04\x01\x03\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x0 $1 \x68\x01\x16\x70\x00\x00\x00\x00\x00\x06\x5f\xd0 " | dd of = $2 bs = 273 seek = 1 conv = notrunc
2012-02-24 03:58:42 +04:00
aux notify_lvmetad " $2 "
2008-08-05 16:33:41 +04:00
}
2008-09-29 20:02:50 +04:00
aux prepare_devs 2
2008-08-05 16:33:41 +04:00
2008-09-29 20:02:50 +04:00
create_pool_label_ 0 " $dev1 "
create_pool_label_ 1 " $dev2 "
2008-08-05 16:33:41 +04:00
2008-09-29 20:02:50 +04:00
# check that pvcreate fails without -ff on the pool device
not pvcreate " $dev1 "
2008-08-05 16:33:41 +04:00
2008-09-29 20:02:50 +04:00
# check that vgdisplay and pvcreate -ff works with the pool device
2008-11-10 16:44:01 +03:00
vgdisplay --config 'global { locking_type = 0 }'
2011-01-05 03:16:18 +03:00
aux disable_dev " $dev2 "
2008-11-10 16:44:01 +03:00
# FIXME! since pool1 cannot be opened, vgdisplay gives error... should we say
# "not" there instead, checking that it indeed does fail?
vgdisplay --config 'global { locking_type = 0 }' || true
2008-09-29 20:02:50 +04:00
pvcreate -ff -y " $dev1 "