2017-07-02 22:38:32 +03:00
#!/usr/bin/env bash
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,
2016-01-21 13:49:46 +03:00
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2008-03-12 20:34:58 +03:00
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
2015-10-27 17:10:06 +03:00
SKIP_WITH_LVMPOLLD = 1
2008-03-12 20:34:58 +03:00
2015-10-27 17:10:06 +03:00
. lib/inittest
2015-05-09 02:59:18 +03:00
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
2024-08-30 13:10:35 +03:00
# Setup mangling to 'none' globally for all libdm users
2013-06-04 13:07:18 +04:00
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 "
2015-12-10 22:47:30 +03:00
pvdisplay 2>& 1 | tee err
2013-06-04 13:07:18 +04:00
should grep -F " $pv_ugly " err
2011-10-24 01:24:27 +04:00
should check pv_field " $dev1 " pv_name " $dev1 "
2018-05-31 23:55:18 +03:00
vgcreate $SHARED $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
2016-12-11 12:18:44 +03:00
dmsetup remove " ${ PREFIX } ${ pv_ugly } "