2008-03-12 20:34:58 +03:00
#!/bin/sh
2013-06-04 13:07:18 +04:00
# Copyright (C) 2008-2013 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
2014-06-06 19:40:04 +04:00
. lib/inittest
2008-03-12 20:34:58 +03:00
2015-05-09 02:59:18 +03:00
test -e LOCAL_LVMPOLLD && skip
2013-06-04 13:07:18 +04:00
# For udev impossible to create
test " $LVM_TEST_DEVDIR " = "/dev" && skip
2011-10-23 19:39:08 +04:00
aux prepare_devs 2
2013-06-04 13:07:18 +04:00
aux extend_filter_LVMTEST
# Setup mangling to 'none' globaly for all libdm users
export DM_DEFAULT_NAME_MANGLING_MODE = none
2008-03-12 20:34:58 +03:00
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 "
2013-06-04 13:07:18 +04:00
pvdisplay 2>& 1 | tee >err
should grep -F " $pv_ugly " err
2011-10-24 01:24:27 +04:00
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