2017-07-02 21:38:32 +02:00
#!/usr/bin/env bash
2013-06-04 11:07:18 +02:00
# Copyright (C) 2008-2013 Red Hat, Inc. All rights reserved.
2008-03-12 17:34:58 +00: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 11:49:46 +01:00
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2008-03-12 17:34:58 +00:00
2008-09-30 17:47:34 +00:00
# 'Test for proper escaping of strings in metadata (bz431474)'
2008-03-12 17:34:58 +00:00
2015-10-27 15:10:06 +01:00
SKIP_WITH_LVMPOLLD = 1
2008-03-12 17:34:58 +00:00
2015-10-27 15:10:06 +01:00
. lib/inittest
2015-05-09 00:59:18 +01:00
2013-06-04 11:07:18 +02:00
# For udev impossible to create
test " $LVM_TEST_DEVDIR " = "/dev" && skip
2011-10-23 15:39:08 +00:00
aux prepare_devs 2
2013-06-04 11:07:18 +02:00
aux extend_filter_LVMTEST
# Setup mangling to 'none' globaly for all libdm users
export DM_DEFAULT_NAME_MANGLING_MODE = none
2008-03-12 17:34:58 +00:00
2009-03-31 17:30:47 +00:00
pv_ugly = "__\"!@#\$%^&*,()|@||'\\\"__pv1"
2008-03-12 17:34:58 +00:00
2012-03-16 13:00:05 +00:00
# 'set up temp files, loopback devices'
2008-09-30 17:47:34 +00:00
name = $( basename " $dev1 " )
2009-04-03 14:23:17 +00:00
dmsetup rename " $name " " $PREFIX $pv_ugly "
2012-03-16 13:00:05 +00:00
dev1 = $( dirname " $dev1 " ) /" $PREFIX $pv_ugly "
2008-09-30 17:47:34 +00:00
2012-03-28 11:10:08 +00:00
dm_table | grep -F " $pv_ugly "
2011-10-23 21:24:27 +00:00
2012-03-16 13:00:05 +00:00
# 'pvcreate, vgcreate on filename with backslashed chars'
created = " $dev1 "
2011-10-23 15:39:08 +00:00
# when used with real udev without fallback, it will fail here
2012-03-16 13:00:05 +00:00
pvcreate " $dev1 " || created = " $dev2 "
2015-12-10 20:47:30 +01:00
pvdisplay 2>& 1 | tee err
2013-06-04 11:07:18 +02:00
should grep -F " $pv_ugly " err
2011-10-23 21:24:27 +00:00
should check pv_field " $dev1 " pv_name " $dev1 "
2018-05-31 15:55:18 -05:00
vgcreate $SHARED $vg " $created "
2012-03-16 13:00:05 +00:00
# 'no parse errors and VG really exists'
vgs $vg 2>err
not grep "Parse error" err
2016-12-11 10:18:44 +01:00
dmsetup remove " ${ PREFIX } ${ pv_ugly } "