public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: mbroz@sourceware.org
To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org
Subject: LVM2/test t-topology-support.sh
Date: Thu, 09 Jun 2011 14:26:00 -0000	[thread overview]
Message-ID: <20110609142648.3300.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2011-06-09 14:26:47

Modified files:
	test           : t-topology-support.sh 

Log message:
	Fix topology test.
	
	Kernel version is misparsed in Fedora rawhide, just test sysfs file.
	
	SCSI_DEBUG_DEV is no longer exported, use provided file instead.

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

--- LVM2/test/t-topology-support.sh	2011/01/05 00:16:20	1.6
+++ LVM2/test/t-topology-support.sh	2011/06/09 14:26:47	1.7
@@ -10,22 +10,16 @@
 
 which mkfs.ext3 || exit 200
 
-# Get linux minor version
-linux_minor=$(echo `uname -r` | cut -d'.' -f3 | cut -d'-' -f1)
-
-test $linux_minor -ge 31 || exit 200
-
 . lib/test
 
 check_logical_block_size()
 {
-    local DEV_=$1
-    local LOGICAL_BS=$2
+    local DEV_=$(cat SCSI_DEBUG_DEV)
     # Verify logical_block_size - requires Linux >= 2.6.31
     SYSFS_LOGICAL_BLOCK_SIZE=`echo /sys/block/$(basename $DEV_)/queue/logical_block_size`
     if [ -f "$SYSFS_LOGICAL_BLOCK_SIZE" ] ; then
 	ACTUAL_LOGICAL_BLOCK_SIZE=`cat $SYSFS_LOGICAL_BLOCK_SIZE`
-	test $ACTUAL_LOGICAL_BLOCK_SIZE = $LOGICAL_BS
+	test $ACTUAL_LOGICAL_BLOCK_SIZE = $1
     fi
 }
 
@@ -60,13 +54,21 @@
 PER_DEV_SIZE=34
 DEV_SIZE=$(($NUM_DEVS*$PER_DEV_SIZE))
 
+# Test that kernel supports topology
+aux prepare_scsi_debug_dev $DEV_SIZE
+if [ ! -e /sys/block/$(basename $(cat SCSI_DEBUG_DEV))/alignment_offset ] ; then
+	aux cleanup_scsi_debug_dev
+	exit 200
+fi
+aux cleanup_scsi_debug_dev
+
 # ---------------------------------------------
 # Create "desktop-class" 4K drive
 # (logical_block_size=512, physical_block_size=4096, alignment_offset=0):
 LOGICAL_BLOCK_SIZE=512
 aux prepare_scsi_debug_dev $DEV_SIZE \
     sector_size=$LOGICAL_BLOCK_SIZE physblk_exp=3
-check_logical_block_size $SCSI_DEBUG_DEV $LOGICAL_BLOCK_SIZE
+check_logical_block_size $LOGICAL_BLOCK_SIZE
 
 aux prepare_pvs $NUM_DEVS $PER_DEV_SIZE
 vgcreate -c n $vg $(cat DEVICES)
@@ -81,7 +83,7 @@
 LOGICAL_BLOCK_SIZE=512
 aux prepare_scsi_debug_dev $DEV_SIZE \
     sector_size=$LOGICAL_BLOCK_SIZE physblk_exp=3 lowest_aligned=7
-check_logical_block_size $SCSI_DEBUG_DEV $LOGICAL_BLOCK_SIZE
+check_logical_block_size $LOGICAL_BLOCK_SIZE
 
 aux prepare_pvs $NUM_DEVS $PER_DEV_SIZE
 vgcreate -c n $vg $(cat DEVICES)
@@ -96,7 +98,7 @@
 LOGICAL_BLOCK_SIZE=4096
 aux prepare_scsi_debug_dev $DEV_SIZE \
     sector_size=$LOGICAL_BLOCK_SIZE
-check_logical_block_size $SCSI_DEBUG_DEV $LOGICAL_BLOCK_SIZE
+check_logical_block_size $LOGICAL_BLOCK_SIZE
 
 aux prepare_pvs $NUM_DEVS $PER_DEV_SIZE
 vgcreate -c n $vg $(cat DEVICES)


             reply	other threads:[~2011-06-09 14:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09 14:26 mbroz [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-05-24 19:27 mbroz
2010-01-19 17:06 snitzer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110609142648.3300.qmail@sourceware.org \
    --to=mbroz@sourceware.org \
    --cc=lvm-devel@redhat.com \
    --cc=lvm2-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).