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
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
2008-09-30 21:47:34 +04:00
# 'set up temp files, loopback devices'
name = $( basename " $dev1 " )
2009-04-03 18:23:17 +04:00
dmsetup rename " $name " " $PREFIX $pv_ugly "
2009-03-31 21:30:47 +04:00
dev1 = $( dirname " $dev1 " ) /$PREFIX $pv_ugly
2008-09-30 21:47:34 +04:00
# 'pvcreate, vgcreate on filename with backslashed chars'
2011-10-23 19:39:08 +04:00
created = $dev1
# when used with real udev without fallback, it will fail here
pvcreate " $dev1 " || created = $dev2
pvs | should grep $dev1
vgcreate $vg " $created "
2008-09-30 21:47:34 +04:00
# 'no parse errors and VG really exists'
vgs 2>err
not grep "Parse error" err;
vgs $vg