]> sourceware.org Git - lvm2.git/commitdiff
tests: correct checked target name
authorZdenek Kabelac <zkabelac@redhat.com>
Tue, 11 Jun 2019 14:40:44 +0000 (16:40 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Tue, 11 Jun 2019 14:43:14 +0000 (16:43 +0200)
So when the target name happened to be a suffix of another one,
the grep was filtering incorrect line
(i.e. dm-cache && dm-writecache) - so do a line head matching.

test/lib/aux.sh

index b178ab75ba2225266f720bddcfed1314ee19bccf..040c8f28745f07415389a4f2cc407970d5f6f1a7 100644 (file)
@@ -1421,7 +1421,7 @@ target_at_least() {
        fi
 
        local version
-       version=$(dmsetup targets 2>/dev/null | grep "${1##dm-} " 2>/dev/null)
+       version=$(dmsetup targets 2>/dev/null | grep "^${1##dm-} " 2>/dev/null)
        version=${version##* v}
 
        version_at_least "$version" "${@:2}" || {
This page took 0.039426 seconds and 5 git commands to generate.