public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2/test t-pvcreate-operation-md.sh
@ 2010-08-12  4:56 snitzer
  0 siblings, 0 replies; 10+ messages in thread
From: snitzer @ 2010-08-12  4:56 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	snitzer@sourceware.org	2010-08-12 04:56:06

Modified files:
	test           : t-pvcreate-operation-md.sh 

Log message:
	fix t-pvcreate-operation-md.sh to require kernel.org Linux >= 2.6.33 for
	the final alignment_offset check.  In the future, might look to check
	for the RHEL6 kernel too.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-pvcreate-operation-md.sh.diff?cvsroot=lvm2&r1=1.8&r2=1.9

--- LVM2/test/t-pvcreate-operation-md.sh	2010/08/12 04:11:49	1.8
+++ LVM2/test/t-pvcreate-operation-md.sh	2010/08/12 04:56:05	1.9
@@ -99,14 +99,17 @@
     mddev_p=/dev/${base_mddev_p}
 
     # Checking for 'alignment_offset' in sysfs implies Linux >= 2.6.31
+    # but reliable alignment_offset support requires kernel.org Linux >= 2.6.33
     sysfs_alignment_offset=/sys/dev/block/${mddev_maj_min}/${base_mddev_p}/alignment_offset
     [ -f $sysfs_alignment_offset -a $linux_minor -ge 33 ] && \
 	alignment_offset=`cat $sysfs_alignment_offset` || \
 	alignment_offset=0
 
-    # default alignment is 1M, add alignment_offset
-    pv_align=$((1048576+$alignment_offset))B
-    pvcreate --metadatasize 128k $mddev_p
-    check_pv_field_ $mddev_p pe_start $pv_align "--units b"
-    pvremove $mddev_p
+    if [ $alignment_offset -gt 0 ]; then    
+        # default alignment is 1M, add alignment_offset
+	pv_align=$((1048576+$alignment_offset))B
+	pvcreate --metadatasize 128k $mddev_p
+	check_pv_field_ $mddev_p pe_start $pv_align "--units b"
+	pvremove $mddev_p
+    fi
 fi


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

* LVM2/test t-pvcreate-operation-md.sh
@ 2011-01-28 16:12 zkabelac
  0 siblings, 0 replies; 10+ messages in thread
From: zkabelac @ 2011-01-28 16:12 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-01-28 16:12:46

Modified files:
	test           : t-pvcreate-operation-md.sh 

Log message:
	Replacei sleep wait with udev settle
	
	Use new udev_wait command instead of unpredictable sleep waiting.
	As with more devices in the system, udev processing is slower.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-pvcreate-operation-md.sh.diff?cvsroot=lvm2&r1=1.13&r2=1.14

--- LVM2/test/t-pvcreate-operation-md.sh	2011/01/05 01:04:47	1.13
+++ LVM2/test/t-pvcreate-operation-md.sh	2011/01/28 16:12:45	1.14
@@ -34,8 +34,9 @@
 cleanup_md() {
     # sleeps offer hack to defeat: 'md: md127 still in use'
     # see: https://bugzilla.redhat.com/show_bug.cgi?id=509908#c25
-    sleep 2
+    aux udev_wait
     mdadm --stop $mddev || true
+    aux udev_wait
     if [ -b "$mddev" ]; then
         # mdadm doesn't always cleanup the device node
 	sleep 2
@@ -102,6 +103,11 @@
     base_mddev_p=`basename $mddev_p_sysfs_name`
     mddev_p=/dev/${base_mddev_p}
 
+    # in case the system is running without devtmpfs /dev
+    # wait here for created device node on tmpfs
+    aux udev_wait $mddev_p
+    test -b $mddev_p || exit 200
+
     # Checking for 'alignment_offset' in sysfs implies Linux >= 2.6.31
     # but reliable alignment_offset support requires kernel.org Linux >= 2.6.33
     sysfs_alignment_offset=/sys/dev/block/${mddev_maj_min}/${base_mddev_p}/alignment_offset


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

* LVM2/test t-pvcreate-operation-md.sh
@ 2011-01-05  1:04 mornfall
  0 siblings, 0 replies; 10+ messages in thread
From: mornfall @ 2011-01-05  1:04 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mornfall@sourceware.org	2011-01-05 01:04:47

Modified files:
	test           : t-pvcreate-operation-md.sh 

Log message:
	Fix another bug in t-pvcreate-operation-md (should pass now).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-pvcreate-operation-md.sh.diff?cvsroot=lvm2&r1=1.12&r2=1.13

--- LVM2/test/t-pvcreate-operation-md.sh	2011/01/05 00:38:41	1.12
+++ LVM2/test/t-pvcreate-operation-md.sh	2011/01/05 01:04:47	1.13
@@ -45,13 +45,13 @@
 
 cleanup_md_and_teardown() {
     cleanup_md
-    teardown
+    aux teardown
 }
 
 # create 2 disk MD raid0 array (stripe_width=128K)
 test -b "$mddev" && exit 200
 mdadm --create --metadata=1.0 $mddev --auto=md --level 0 --raid-devices=2 --chunk 64 $dev1 $dev2
-trap 'aux cleanup_md_and_teardown' EXIT # cleanup this MD device at the end of the test
+trap 'cleanup_md_and_teardown' EXIT # cleanup this MD device at the end of the test
 test -b "$mddev" || exit 200
 
 # Test alignment of PV on MD without any MD-aware or topology-aware detection


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

* LVM2/test t-pvcreate-operation-md.sh
@ 2011-01-05  0:38 mornfall
  0 siblings, 0 replies; 10+ messages in thread
From: mornfall @ 2011-01-05  0:38 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mornfall@sourceware.org	2011-01-05 00:38:41

Modified files:
	test           : t-pvcreate-operation-md.sh 

Log message:
	Fix typo in t-pvcreate-operation-md.sh.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-pvcreate-operation-md.sh.diff?cvsroot=lvm2&r1=1.11&r2=1.12

--- LVM2/test/t-pvcreate-operation-md.sh	2011/01/05 00:16:20	1.11
+++ LVM2/test/t-pvcreate-operation-md.sh	2011/01/05 00:38:41	1.12
@@ -20,7 +20,7 @@
 
 . lib/test
 
-prepare_lvmconf 'devices/filter = [ "a|/dev/md.*|", "a/dev\/mapper\/.*$/", "r/.*/" ]'
+aux lvmconf 'devices/filter = [ "a|/dev/md.*|", "a/dev\/mapper\/.*$/", "r/.*/" ]'
 aux prepare_devs 2
 
 # Have MD use a non-standard name to avoid colliding with an existing MD device


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

* LVM2/test t-pvcreate-operation-md.sh
@ 2010-08-21 15:43 snitzer
  0 siblings, 0 replies; 10+ messages in thread
From: snitzer @ 2010-08-21 15:43 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	snitzer@sourceware.org	2010-08-21 15:43:45

Modified files:
	test           : t-pvcreate-operation-md.sh 

Log message:
	Verify that pvcreate --dataalignment really does override the topology
	detected alignment.
	
	NOTE: lvm2 doesn't detect MD 1.2 metadata (now the default on RHEL6) so
	for now I'm forcing 1.0 metadata.  This was needed to be able to reuse
	the existing loop devices but recreate the md device with different
	raid0 striping.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-pvcreate-operation-md.sh.diff?cvsroot=lvm2&r1=1.9&r2=1.10

--- LVM2/test/t-pvcreate-operation-md.sh	2010/08/12 04:56:05	1.9
+++ LVM2/test/t-pvcreate-operation-md.sh	2010/08/21 15:43:45	1.10
@@ -41,13 +41,17 @@
 	sleep 2
 	rm -f $mddev
     fi
+}
+
+cleanup_md_and_teardown() {
+    cleanup_md
     teardown
 }
 
 # create 2 disk MD raid0 array (stripe_width=128K)
 test -b "$mddev" && exit 200
-mdadm --create $mddev --auto=md --level 0 --raid-devices=2 --chunk 64 $dev1 $dev2
-trap 'aux cleanup_md' EXIT # cleanup this MD device at the end of the test
+mdadm --create --metadata=1.0 $mddev --auto=md --level 0 --raid-devices=2 --chunk 64 $dev1 $dev2
+trap 'aux cleanup_md_and_teardown' EXIT # cleanup this MD device at the end of the test
 test -b "$mddev" || exit 200
 
 # Test alignment of PV on MD without any MD-aware or topology-aware detection
@@ -113,3 +117,27 @@
 	pvremove $mddev_p
     fi
 fi
+
+# Test newer topology-aware alignment detection w/ --dataalignment override
+if [ $linux_minor -ge 33 ]; then
+    cleanup_md
+    pvcreate -f $dev1
+    pvcreate -f $dev2
+
+    # create 2 disk MD raid0 array (stripe_width=2M)
+    test -b "$mddev" && exit 200
+    mdadm --create --metadata=1.0 $mddev --auto=md --level 0 --raid-devices=2 --chunk 1024 $dev1 $dev2
+    test -b "$mddev" || exit 200
+
+    # optimal_io_size=2097152, minimum_io_size=1048576
+    pv_align="2.00m"
+    pvcreate --metadatasize 128k \
+	--config 'devices { md_chunk_alignment=0 }' $mddev
+    check_pv_field_ $mddev pe_start $pv_align
+
+    # now verify pe_start alignment override using --dataalignment
+    pv_align="192.00k"
+    pvcreate --dataalignment 64k --metadatasize 128k \
+	--config 'devices { md_chunk_alignment=0 }' $mddev
+    check_pv_field_ $mddev pe_start $pv_align
+fi


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

* LVM2/test t-pvcreate-operation-md.sh
@ 2010-07-21 14:12 mornfall
  0 siblings, 0 replies; 10+ messages in thread
From: mornfall @ 2010-07-21 14:12 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mornfall@sourceware.org	2010-07-21 14:12:48

Modified files:
	test           : t-pvcreate-operation-md.sh 

Log message:
	Don't fail t-pvcreate-operation-md if mdadm is broken.

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

--- LVM2/test/t-pvcreate-operation-md.sh	2010/05/24 15:28:45	1.6
+++ LVM2/test/t-pvcreate-operation-md.sh	2010/07/21 14:12:47	1.7
@@ -35,7 +35,7 @@
     # sleeps offer hack to defeat: 'md: md127 still in use'
     # see: https://bugzilla.redhat.com/show_bug.cgi?id=509908#c25
     sleep 2
-    mdadm --stop $mddev
+    mdadm --stop $mddev || true
     if [ -b "$mddev" ]; then
         # mdadm doesn't always cleanup the device node
 	sleep 2


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

* LVM2/test t-pvcreate-operation-md.sh
@ 2010-05-24 15:28 mornfall
  0 siblings, 0 replies; 10+ messages in thread
From: mornfall @ 2010-05-24 15:28 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mornfall@sourceware.org	2010-05-24 15:28:45

Modified files:
	test           : t-pvcreate-operation-md.sh 

Log message:
	Skip t-pvcreate-operation-md if mdadm fails to create the required device.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-pvcreate-operation-md.sh.diff?cvsroot=lvm2&r1=1.5&r2=1.6

--- LVM2/test/t-pvcreate-operation-md.sh	2010/04/13 21:42:44	1.5
+++ LVM2/test/t-pvcreate-operation-md.sh	2010/05/24 15:28:45	1.6
@@ -45,9 +45,10 @@
 }
 
 # create 2 disk MD raid0 array (stripe_width=128K)
-[ -b "$mddev" ] && exit 200
+test -b "$mddev" && exit 200
 mdadm --create $mddev --auto=md --level 0 --raid-devices=2 --chunk 64 $dev1 $dev2
 trap 'aux cleanup_md' EXIT # cleanup this MD device at the end of the test
+test -b "$mddev" || exit 200
 
 # Test alignment of PV on MD without any MD-aware or topology-aware detection
 # - should treat $mddev just like any other block device


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

* LVM2/test t-pvcreate-operation-md.sh
@ 2010-04-13 21:42 wysochanski
  0 siblings, 0 replies; 10+ messages in thread
From: wysochanski @ 2010-04-13 21:42 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski@sourceware.org	2010-04-13 21:42:45

Modified files:
	test           : t-pvcreate-operation-md.sh 

Log message:
	Fix teardown in t-pvcreate-operation-md.sh nightly test.

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

--- LVM2/test/t-pvcreate-operation-md.sh	2010/01/19 15:59:34	1.4
+++ LVM2/test/t-pvcreate-operation-md.sh	2010/04/13 21:42:44	1.5
@@ -41,7 +41,7 @@
 	sleep 2
 	rm -f $mddev
     fi
-    teardown_
+    teardown
 }
 
 # create 2 disk MD raid0 array (stripe_width=128K)


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

* LVM2/test t-pvcreate-operation-md.sh
@ 2010-01-19 15:59 snitzer
  0 siblings, 0 replies; 10+ messages in thread
From: snitzer @ 2010-01-19 15:59 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	snitzer@sourceware.org	2010-01-19 15:59:34

Modified files:
	test           : t-pvcreate-operation-md.sh 

Log message:
	update test/t-pvcreate-operation-md.sh attempt loading raid0.ko if raid0
	isn't already available (in /proc/mdstat).
	
	switch to requiring 2.6.33 for the alignment_offset tests; 2.6.{31,32}
	alignment_offset values aren't reliable.  2.6.33 _should_ have mkp's
	alignment_offset fixes but so far it doesn't (as of 2.6.33-rc4).

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

--- LVM2/test/t-pvcreate-operation-md.sh	2009/09/30 16:13:53	1.3
+++ LVM2/test/t-pvcreate-operation-md.sh	2010/01/19 15:59:34	1.4
@@ -14,7 +14,9 @@
 which perl || exit 200
 which awk || exit 200
 which cut || exit 200
-test -f /proc/mdstat || exit 200
+
+test -f /proc/mdstat && grep -q raid0 /proc/mdstat || \
+modprobe raid0 || exit 200
 
 . ./test-utils.sh
 
@@ -66,7 +68,8 @@
 linux_minor=$(echo `uname -r` | cut -d'.' -f3 | cut -d'-' -f1)
 
 # Test newer topology-aware alignment detection
-if [ $linux_minor -gt 31 ]; then
+# - first added to 2.6.31 but not "reliable" until 2.6.33
+if [ $linux_minor -ge 33 ]; then
     pv_align="256.00k"
     pvcreate --metadatasize 128k \
 	--config 'devices { md_chunk_alignment=0 }' $mddev
@@ -74,7 +77,7 @@
 fi
 
 # partition MD array directly, depends on blkext in Linux >= 2.6.28
-if [ $linux_minor -gt 27 ]; then
+if [ $linux_minor -ge 28 ]; then
     # create one partition
     sfdisk $mddev <<EOF
 ,,83
@@ -95,7 +98,7 @@
 
     # Checking for 'alignment_offset' in sysfs implies Linux >= 2.6.31
     sysfs_alignment_offset=/sys/dev/block/${mddev_maj_min}/${base_mddev_p}/alignment_offset
-    [ -f $sysfs_alignment_offset ] && \
+    [ -f $sysfs_alignment_offset -a $linux_minor -ge 33 ] && \
 	alignment_offset=`cat $sysfs_alignment_offset` || \
 	alignment_offset=0
 


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

* LVM2/test t-pvcreate-operation-md.sh
@ 2009-09-13 19:28 mbroz
  0 siblings, 0 replies; 10+ messages in thread
From: mbroz @ 2009-09-13 19:28 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2009-09-13 19:28:00

Modified files:
	test           : t-pvcreate-operation-md.sh 

Log message:
	Do not run mdadm tests if MD module is not loaded.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-pvcreate-operation-md.sh.diff?cvsroot=lvm2&r1=1.1&r2=1.2

--- LVM2/test/t-pvcreate-operation-md.sh	2009/08/04 16:02:39	1.1
+++ LVM2/test/t-pvcreate-operation-md.sh	2009/09/13 19:28:00	1.2
@@ -14,6 +14,7 @@
 which perl || exit 200
 which awk || exit 200
 which cut || exit 200
+test -f /proc/mdstat || exit 200
 
 . ./test-utils.sh
 


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

end of thread, other threads:[~2011-01-28 16:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-12  4:56 LVM2/test t-pvcreate-operation-md.sh snitzer
  -- strict thread matches above, loose matches on Subject: below --
2011-01-28 16:12 zkabelac
2011-01-05  1:04 mornfall
2011-01-05  0:38 mornfall
2010-08-21 15:43 snitzer
2010-07-21 14:12 mornfall
2010-05-24 15:28 mornfall
2010-04-13 21:42 wysochanski
2010-01-19 15:59 snitzer
2009-09-13 19:28 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).