public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2/test t-mdata-strings.sh
@ 2011-10-23 15:39 zkabelac
  0 siblings, 0 replies; 5+ messages in thread
From: zkabelac @ 2011-10-23 15:39 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-10-23 15:39:08

Modified files:
	test           : t-mdata-strings.sh 

Log message:
	Expect failure with real /dev dir
	
	As udev is for now incapable to create such devices
	turn this test error into warning.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-mdata-strings.sh.diff?cvsroot=lvm2&r1=1.6&r2=1.7

--- LVM2/test/t-mdata-strings.sh	2011/01/05 00:16:20	1.6
+++ LVM2/test/t-mdata-strings.sh	2011/10/23 15:39:08	1.7
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (C) 2008 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2008-2011 Red Hat, Inc. All rights reserved.
 #
 # This copyrighted material is made available to anyone wishing to use,
 # modify, copy, or redistribute it subject to the terms and conditions
@@ -13,8 +13,9 @@
 
 . lib/test
 
-aux prepare_devs 1
+aux prepare_devs 2
 
+# for udev impossible to create
 pv_ugly="__\"!@#\$%^&*,()|@||'\\\"__pv1"
 
 # 'set up temp files, loopback devices' 
@@ -23,9 +24,11 @@
 dev1=$(dirname "$dev1")/$PREFIX$pv_ugly
 
 # 'pvcreate, vgcreate on filename with backslashed chars' 
-pvcreate "$dev1" 
-vgcreate $vg "$dev1"
-
+created=$dev1
+# when used with real udev without fallback, it will fail here
+pvcreate "$dev1" || created=$dev2
+pvs | should grep $dev1
+vgcreate $vg "$created"
 # 'no parse errors and VG really exists' 
 vgs 2>err
 not grep "Parse error" err;


^ permalink raw reply	[flat|nested] 5+ messages in thread

* LVM2/test t-mdata-strings.sh
@ 2011-10-23 21:24 zkabelac
  0 siblings, 0 replies; 5+ messages in thread
From: zkabelac @ 2011-10-23 21:24 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-10-23 21:24:27

Modified files:
	test           : t-mdata-strings.sh 

Log message:
	Test with -F flag
	
	grep need -F to check what we really want to test.
	Add better test for existing device.
	
	Currently this test DOES NOT work with real /dev handle via udev
	since our tool does not see such device listet through udev.
	
	FIXME: We might be able to see it at least through dmsetup table and
	use for lvm.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-mdata-strings.sh.diff?cvsroot=lvm2&r1=1.7&r2=1.8

--- LVM2/test/t-mdata-strings.sh	2011/10/23 15:39:08	1.7
+++ LVM2/test/t-mdata-strings.sh	2011/10/23 21:24:27	1.8
@@ -23,11 +23,14 @@
 dmsetup rename "$name" "$PREFIX$pv_ugly"
 dev1=$(dirname "$dev1")/$PREFIX$pv_ugly
 
+dmsetup table | grep -F "$pv_ugly"
+
 # 'pvcreate, vgcreate on filename with backslashed chars' 
 created=$dev1
 # when used with real udev without fallback, it will fail here
 pvcreate "$dev1" || created=$dev2
-pvs | should grep $dev1
+pvdisplay | should grep -F "$pv_ugly"
+should check pv_field "$dev1" pv_name "$dev1"
 vgcreate $vg "$created"
 # 'no parse errors and VG really exists' 
 vgs 2>err


^ permalink raw reply	[flat|nested] 5+ messages in thread

* LVM2/test t-mdata-strings.sh
@ 2009-04-03 14:23 wysochanski
  0 siblings, 0 replies; 5+ messages in thread
From: wysochanski @ 2009-04-03 14:23 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski@sourceware.org	2009-04-03 14:23:17

Modified files:
	test           : t-mdata-strings.sh 

Log message:
	Fix whitespace in t-mdata-strings.sh
	
	Author: Dave Wysochanski <dwysocha@redhat.com>

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-mdata-strings.sh.diff?cvsroot=lvm2&r1=1.4&r2=1.5

--- LVM2/test/t-mdata-strings.sh	2009/03/31 17:30:47	1.4
+++ LVM2/test/t-mdata-strings.sh	2009/04/03 14:23:17	1.5
@@ -19,7 +19,7 @@
 
 # 'set up temp files, loopback devices' 
 name=$(basename "$dev1")
-dmsetup rename "$name" "$PREFIX$pv_ugly" 
+dmsetup rename "$name" "$PREFIX$pv_ugly"
 dev1=$(dirname "$dev1")/$PREFIX$pv_ugly
 
 # 'pvcreate, vgcreate on filename with backslashed chars' 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* LVM2/test t-mdata-strings.sh
@ 2009-03-31 17:30 mbroz
  0 siblings, 0 replies; 5+ messages in thread
From: mbroz @ 2009-03-31 17:30 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2009-03-31 17:30:47

Modified files:
	test           : t-mdata-strings.sh 

Log message:
	Add some more special chars for device name test.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-mdata-strings.sh.diff?cvsroot=lvm2&r1=1.3&r2=1.4

--- LVM2/test/t-mdata-strings.sh	2008/09/30 17:47:34	1.3
+++ LVM2/test/t-mdata-strings.sh	2009/03/31 17:30:47	1.4
@@ -15,12 +15,12 @@
 
 aux prepare_devs 1
 
-pv_suffix="__\"!@#\$%^&*()'\\\"__"
+pv_ugly="__\"!@#\$%^&*,()|@||'\\\"__pv1"
 
 # 'set up temp files, loopback devices' 
 name=$(basename "$dev1")
-dmsetup rename "$name" "$name$pv_suffix" 
-dev1=$(dirname "$dev1")/$name$pv_suffix
+dmsetup rename "$name" "$PREFIX$pv_ugly" 
+dev1=$(dirname "$dev1")/$PREFIX$pv_ugly
 
 # 'pvcreate, vgcreate on filename with backslashed chars' 
 pvcreate "$dev1" 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* LVM2/test t-mdata-strings.sh
@ 2008-03-12 17:34 mbroz
  0 siblings, 0 replies; 5+ messages in thread
From: mbroz @ 2008-03-12 17:34 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2008-03-12 17:34:58

Added files:
	test           : t-mdata-strings.sh 

Log message:
	Add metadata test for escaping double quotes in device names (bz431474).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-mdata-strings.sh.diff?cvsroot=lvm2&r1=NONE&r2=1.1

/cvs/lvm2/LVM2/test/t-mdata-strings.sh,v  -->  standard output
revision 1.1
--- LVM2/test/t-mdata-strings.sh
+++ -	2008-03-12 17:34:58.833097000 +0000
@@ -0,0 +1,51 @@
+#!/bin/sh
+# Copyright (C) 2008 Red Hat, Inc. All rights reserved.
+#
+# 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
+
+test_description='Test for proper escaping of strings in metadata (bz431474)'
+privileges_required_=1
+
+. ./test-lib.sh
+
+cleanup_()
+{
+  test -n "$vg" && {
+    vgchange -an "$vg"
+    vgremove "$vg"
+  } > "$test_dir_/cleanup.log"
+  test -n "$d1" && losetup -d "$d1"
+  rm -f "$f1"
+}
+
+pv_suffix="__\"!@#\$%^&*()'\\\"__"
+
+test_expect_success \
+  'set up temp files, loopback devices' \
+  'f1=$(pwd)/1 && d1=$(loop_setup_ "$f1") &&
+  mv "$d1" "$d1$pv_suffix"                &&
+  d1=$d1$pv_suffix'
+
+test_expect_success \
+  'pvcreate, vgcreate on filename with backslashed chars' \
+  'pvcreate "$d1"                          &&
+  vg=$(this_test_)-test-vg-$$              &&
+  vgcreate $vg $d1'
+  
+test_expect_success \
+  'no parse errors and VG really exists' \
+  'vgs 2>err                                    &&
+  grep "Parse error" err;
+  status=$?; echo status=$?; test $status -ne 0 &&
+  vgs $vg'
+
+test_done
+# Local Variables:
+# indent-tabs-mode: nil
+# End:


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-10-23 21:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-23 15:39 LVM2/test t-mdata-strings.sh zkabelac
  -- strict thread matches above, loose matches on Subject: below --
2011-10-23 21:24 zkabelac
2009-04-03 14:23 wysochanski
2009-03-31 17:30 mbroz
2008-03-12 17:34 mbroz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).