2008-03-12 20:34:58 +03:00
#!/bin/sh
2011-10-23 19:39:08 +04:00
# Copyright (C) 2008-2011 Red Hat, Inc. All rights reserved.
2008-03-12 20:34:58 +03: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,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2008-09-30 21:47:34 +04:00
# 'Test for proper escaping of strings in metadata (bz431474)'
2008-03-12 20:34:58 +03:00
2011-01-05 03:16:18 +03:00
. lib/test
2008-03-12 20:34:58 +03:00
2011-10-23 19:39:08 +04:00
aux prepare_devs 2
2012-10-12 19:59:11 +04:00
aux lvmconf 'devices/global_filter = [ "a|.*LVMTEST.*dev/mapper/.*pv[0-9_]*$|", "r|.*|" ]'
2008-03-12 20:34:58 +03:00
2011-10-23 19:39:08 +04:00
# for udev impossible to create
2009-03-31 21:30:47 +04:00
pv_ugly = "__\"!@#\$%^&*,()|@||'\\\"__pv1"
2008-03-12 20:34:58 +03:00
2012-03-16 17:00:05 +04:00
# 'set up temp files, loopback devices'
2008-09-30 21:47:34 +04:00
name = $( basename " $dev1 " )
2009-04-03 18:23:17 +04:00
dmsetup rename " $name " " $PREFIX $pv_ugly "
2012-03-16 17:00:05 +04:00
dev1 = $( dirname " $dev1 " ) /" $PREFIX $pv_ugly "
2008-09-30 21:47:34 +04:00
2012-03-28 15:10:08 +04:00
dm_table | grep -F " $pv_ugly "
2011-10-24 01:24:27 +04:00
2012-03-16 17:00:05 +04:00
# 'pvcreate, vgcreate on filename with backslashed chars'
created = " $dev1 "
2011-10-23 19:39:08 +04:00
# when used with real udev without fallback, it will fail here
2012-03-16 17:00:05 +04:00
pvcreate " $dev1 " || created = " $dev2 "
2011-10-24 01:24:27 +04:00
pvdisplay | should grep -F " $pv_ugly "
should check pv_field " $dev1 " pv_name " $dev1 "
2011-10-23 19:39:08 +04:00
vgcreate $vg " $created "
2012-03-16 17:00:05 +04:00
# 'no parse errors and VG really exists'
vgs $vg 2>err
not grep "Parse error" err