From: Peter Rajnoha Date: Fri, 6 Jun 2014 12:03:06 +0000 (UTC) Subject: dev-prajnoha-report-select - tests: add get_devs function Message-ID: <20140606120306.3178C612AF@fedorahosted.org> List-Id: To: lvm-devel@redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9196942312cadea3cd4bf850442d556b07ad88d4 Commit: 9196942312cadea3cd4bf850442d556b07ad88d4 Parent: 223bdc5eb2fe69c43e0138bf097c33f1fa83d536 Author: Zdenek Kabelac AuthorDate: Wed Jun 4 13:55:13 2014 +0200 Committer: Zdenek Kabelac CommitterDate: Thu Jun 5 17:49:34 2014 +0200 tests: add get_devs function Instead of rereading device list via cat - keep the list in bash array. (Also solves problem with spaces in device path) Move usage of "$path" out of lvm shell usage, since we don't support such thing there... --- test/lib/utils.sh | 8 ++++++++ test/shell/listings.sh | 31 +++++++++++++++---------------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/test/lib/utils.sh b/test/lib/utils.sh index b2e82aa..f28b37b 100644 --- a/test/lib/utils.sh +++ b/test/lib/utils.sh @@ -186,6 +186,14 @@ kernel_at_least() { test "$minor2" -ge "$3" 2>/dev/null || return 1 } +get_devs() { + local IFS=$IFS_NL + DEVICES=( $(out -pvdisplay --maps $(cat DEVICES) >out2 +pvdisplay "${DEVICES[@]}" >out +pvdisplay --maps "${DEVICES[@]}" >out2 not diff out out2 aux disable_dev "$dev1" @@ -108,8 +110,6 @@ invalid lvscan $vg if aux have_readline; then cat <