public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: zkabelac@sourceware.org
To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org
Subject: LVM2/test t-mirror-vgreduce-removemissing.sh
Date: Thu, 03 Mar 2011 15:46:00 -0000	[thread overview]
Message-ID: <20110303154606.2587.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-03-03 15:46:05

Modified files:
	test           : t-mirror-vgreduce-removemissing.sh 

Log message:
	Avoid using pipes on lv commands
	
	Failure on pipe kills lv command and produces memory stacktrace.
	Add 'true' for empty grep/sed to avoid generating stacktrace.
	
	This should help with long time (7min) for this test on Lenny testing maching
	(mimage was filler with stacktrace and each word was used as LV name).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-mirror-vgreduce-removemissing.sh.diff?cvsroot=lvm2&r1=1.10&r2=1.11

--- LVM2/test/t-mirror-vgreduce-removemissing.sh	2011/01/05 00:16:20	1.10
+++ LVM2/test/t-mirror-vgreduce-removemissing.sh	2011/03/03 15:46:05	1.11
@@ -24,8 +24,8 @@
 	echo $pvs | sed 's/ /\n/g' | sort | uniq > out1
 
 	lvs -a -o+devices $lv
-	lvs -a -odevices --noheadings $lv | \
-	sed 's/([^)]*)//g; s/[ ,]/\n/g' | sort | uniq > out2
+	lvs -a -odevices --noheadings $lv > lvs_log
+	sed 's/([^)]*)//g; s/[ ,]/\n/g' lvs_log | sort | uniq > out2 || true
 
 	diff --ignore-blank-lines out1 out2
 }
@@ -41,14 +41,15 @@
 	echo "Check if mirror images of $lv are on PVs $pvs"
 	rm -f out1 out2
 	echo $pvs | sed 's/ /\n/g' | sort | uniq > out1
-
-	mimages=$(lvs --noheadings -a -o lv_name $vg | grep "${lv}_mimage_" | \
-		sed 's/\[//g; s/\]//g')
+	lvs --noheadings -a -o lv_name $vg > lvs_log
+	mimages=$(grep "${lv}_mimage_" lvs_log | \
+		sed 's/\[//g; s/\]//g' || true)
+	
 	for i in $mimages; do
 		echo "Checking $vg/$i"
 		lvs -a -o+devices $vg/$i
-		lvs -a -odevices --noheadings $vg/$i | \
-			sed 's/([^)]*)//g; s/ //g; s/,/ /g' | sort | uniq >> out2
+		lvs -a -odevices --noheadings $vg/$i > lvs_log
+		sed 's/([^)]*)//g; s/ //g; s/,/ /g' lvs_log | sort | uniq >> out2 || true
 	done
 
 	diff --ignore-blank-lines out1 out2


             reply	other threads:[~2011-03-03 15:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-03 15:46 zkabelac [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-03-31  3:56 jbrassow
2010-03-25 12:16 agk
2010-03-25 11:42 agk
2008-09-19 16:10 mbroz
2008-01-17 18:29 wysochanski

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=20110303154606.2587.qmail@sourceware.org \
    --to=zkabelac@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).