master - tests: add ""
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ff5217f85079fa...
Commit: ff5217f85079fa8cc969e0a81a66f1e1bd6490b5
Parent: 36bcbeadd08adf83740e123a475b4a30f4d4c456
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Mar 16 14:57:14 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Mar 16 15:06:05 2015 +0100
tests: add ""
Add missing "" around 'devs' (since they could
theoritically constain spaces in its name - not
likely supported with udev these day but anyway....)
---
test/shell/pvremove-warnings.sh | 4 +-
test/shell/select-tools.sh | 92 +++++++++++++++++++-------------------
test/shell/system_id.sh | 6 +-
3 files changed, 51 insertions(+), 51 deletions(-)
diff --git a/test/shell/pvremove-warnings.sh b/test/shell/pvremove-warnings.sh
index 865a31e..c561483 100644
--- a/test/shell/pvremove-warnings.sh
+++ b/test/shell/pvremove-warnings.sh
@@ -16,6 +16,6 @@ pvremove "$dev1" "$dev2" 2>&1 | tee pvremove.txt
not grep "No physical" pvremove.txt
pvcreate "$dev1" "$dev2"
-vgcreate bla $dev1 $dev2
-pvremove -ff -y $dev1 $dev2 2>&1 | tee pvremove.txt
+vgcreate bla "$dev1" "$dev2"
+pvremove -ff -y "$dev1" "$dev2" 2>&1 | tee pvremove.txt
not grep "device missing" pvremove.txt
diff --git a/test/shell/select-tools.sh b/test/shell/select-tools.sh
index 1738a45..d04ed0a 100644
--- a/test/shell/select-tools.sh
+++ b/test/shell/select-tools.sh
@@ -28,7 +28,7 @@ lvcreate -l1 -n "lv3" $vg2 "$dev3"
# vg2/lv4 mapped onto dev3
lvcreate -l1 -n "lv4" $vg2 "$dev3" "$dev4"
-# vg2/lv1 mapped onto $dev4 (same LV name as vg1/lv1)
+# vg2/lv1 mapped onto "$dev4" (same LV name as vg1/lv1)
lvcreate -l1 -n "lv1" $vg2 "$dev4"
###########################################
@@ -63,7 +63,7 @@ check vg_field $vg2 vg_tags 105
vgchange --deltag 105
# select contains PVS field
-vgchange --addtag 106 -S "pv_name=$dev1"
+vgchange --addtag 106 -S "pv_name="$dev1""
check vg_field $vg1 vg_tags 106
not check vg_field $vg2 vg_tags 106
vgchange --deltag 106
@@ -141,7 +141,7 @@ not check lv_field $vg2/lv1 lv_tags 204
lvchange --deltag 204 $vg1 $vg2
# select contains PVS field - COMBINATION NOT ALLOWED!
-lvchange --addtag 205 -S "pv_name=$dev1" 2>err
+lvchange --addtag 205 -S pv_name="$dev1" 2>err
grep "Can't report LV and PV fields at the same time" err
grep "Selection failed for LV" err
not check lv_field $vg1/lv1 lv_tags 205
@@ -198,70 +198,70 @@ lvchange --deltag 210 --deltag tag $vg1 $vg2
# select contains VGS field
pvchange --addtag 301 -S "vg_name=$vg1"
-check pv_field $dev1 pv_tags 301
-check pv_field $dev2 pv_tags 301
-not check pv_field $dev3 pv_tags 301
-not check pv_field $dev4 pv_tags 301
+check pv_field "$dev1" pv_tags 301
+check pv_field "$dev2" pv_tags 301
+not check pv_field "$dev3" pv_tags 301
+not check pv_field "$dev4" pv_tags 301
pvchange -a --deltag 301
# select contains LVS field
pvchange --addtag 302 -S "lv_name=lv2"
-check pv_field $dev1 pv_tags 302
-check pv_field $dev2 pv_tags 302
-not check pv_field $dev3 pv_tags 302
-not check pv_field $dev4 pv_tags 302
+check pv_field "$dev1" pv_tags 302
+check pv_field "$dev2" pv_tags 302
+not check pv_field "$dev3" pv_tags 302
+not check pv_field "$dev4" pv_tags 302
pvchange -a --deltag 302
# select contains SEGS field
pvchange --addtag 303 -S "seg_start=8m"
-check pv_field $dev1 pv_tags 303
-not check pv_field $dev2 pv_tags 303
-not check pv_field $dev3 pv_tags 303
-not check pv_field $dev4 pv_tags 303
+check pv_field "$dev1" pv_tags 303
+not check pv_field "$dev2" pv_tags 303
+not check pv_field "$dev3" pv_tags 303
+not check pv_field "$dev4" pv_tags 303
pvchange -a --deltag 303
# select contains PVS field
-pvchange --addtag 304 -S "pv_name=$dev1"
-check pv_field $dev1 pv_tags 304
-not check pv_field $dev2 pv_tags 304
-not check pv_field $dev3 pv_tags 304
-not check pv_field $dev4 pv_tags 304
+pvchange --addtag 304 -S pv_name="$dev1"
+check pv_field "$dev1" pv_tags 304
+not check pv_field "$dev2" pv_tags 304
+not check pv_field "$dev3" pv_tags 304
+not check pv_field "$dev4" pv_tags 304
pvchange -a --deltag 304
# select contains PVSEGS field
pvchange --addtag 305 -S "pvseg_size=2"
-not check pv_field $dev1 pv_tags 305
-check pv_field $dev2 pv_tags 305
-not check pv_field $dev3 pv_tags 305
-not check pv_field $dev4 pv_tags 305
+not check pv_field "$dev1" pv_tags 305
+check pv_field "$dev2" pv_tags 305
+not check pv_field "$dev3" pv_tags 305
+not check pv_field "$dev4" pv_tags 305
pvchange -a --deltag 305
# if PV name or tag is supplied together with the
# selection, the result is an intersection of both
-pvchange --addtag 306 -S "pv_name=$dev1" $dev2
-not check pv_field $dev1 pv_tags 306
-not check pv_field $dev2 pv_tags 306
-not check pv_field $dev3 pv_tags 306
-not check pv_field $dev4 pv_tags 306
+pvchange --addtag 306 -S pv_name="$dev1" "$dev2"
+not check pv_field "$dev1" pv_tags 306
+not check pv_field "$dev2" pv_tags 306
+not check pv_field "$dev3" pv_tags 306
+not check pv_field "$dev4" pv_tags 306
pvchange -a --deltag 306
-pvchange --addtag 307 -S "pv_name=$dev1" $dev1
-check pv_field $dev1 pv_tags 307
-not check pv_field $dev2 pv_tags 307
-not check pv_field $dev3 pv_tags 307
-not check pv_field $dev4 pv_tags 307
+pvchange --addtag 307 -S pv_name="$dev1" "$dev1"
+check pv_field "$dev1" pv_tags 307
+not check pv_field "$dev2" pv_tags 307
+not check pv_field "$dev3" pv_tags 307
+not check pv_field "$dev4" pv_tags 307
pvchange -a --deltag 307
-pvchange --addtag "tag" $dev1
-pvchange --addtag 308 -S "pv_name=$dev2" @tag
-not check pv_field $dev1 pv_tags "308,tag"
-not check pv_field $dev2 pv_tags "308,tag"
-not check pv_field $dev3 pv_tags "308,tag"
-not check pv_field $dev4 pv_tags "308,tag"
-pvchange --deltag 308 $dev1
-pvchange --addtag 309 -S "pv_name=$dev1" @tag
-check pv_field $dev1 pv_tags "309,tag"
-not check pv_field $dev2 pv_tags "309,tag"
-not check pv_field $dev3 pv_tags "309,tag"
-not check pv_field $dev4 pv_tags "309,tag"
+pvchange --addtag "tag" "$dev1"
+pvchange --addtag 308 -S pv_name="$dev2" @tag
+not check pv_field "$dev1" pv_tags "308,tag"
+not check pv_field "$dev2" pv_tags "308,tag"
+not check pv_field "$dev3" pv_tags "308,tag"
+not check pv_field "$dev4" pv_tags "308,tag"
+pvchange --deltag 308 "$dev1"
+pvchange --addtag 309 -S pv_name="$dev1" @tag
+check pv_field "$dev1" pv_tags "309,tag"
+not check pv_field "$dev2" pv_tags "309,tag"
+not check pv_field "$dev3" pv_tags "309,tag"
+not check pv_field "$dev4" pv_tags "309,tag"
pvchange -a --deltag 309 --deltag tag
#########################
diff --git a/test/shell/system_id.sh b/test/shell/system_id.sh
index 6aa367b..d866675 100644
--- a/test/shell/system_id.sh
+++ b/test/shell/system_id.sh
@@ -394,17 +394,17 @@ vgcreate $vg1 "$dev1"
# normal pvs sees the vg and pv
pvs >err
grep $vg1 err
-grep $dev1 err
+grep "$dev1" err
# change the local system_id, making the vg foreign
echo "$SID2" > $SIDFILE
# normal pvs does not see the vg or pv
pvs >err
not grep $vg1 err
-not grep $dev1 err
+not grep "$dev1" err
# pvs --foreign does see the vg and pv
pvs --foreign >err
grep $vg1 err
-grep $dev1 err
+grep "$dev1" err
# change the local system_id back so the vg can be removed
echo "$SID1" > $SIDFILE
vgremove $vg1
8 years
master - tests: fix select report
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=36bcbeadd08adf...
Commit: 36bcbeadd08adf83740e123a475b4a30f4d4c456
Parent: 0e1d1aaca833813fb6cadd16c704c83bb8e94f09
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Mar 16 14:55:58 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Mar 16 15:02:39 2015 +0100
tests: fix select report
Simplify the function usage and clean up parameter parsing.
There were 2 significant changes made in the test itself
(they passed before because of incorrect shell string handling)
-pvs_sel 'tags="pv_tag1"' "$dev1 $dev2"
+sel pv 'tags="pv_tag1"' "$dev1" "$dev6"
-lvs_sel '(lv_name=vol1 || lv_name=vol2) || vg_tags=vg_tag1' "vol1 vol2
abc orig snap"
+sel lv '(lv_name=vol1 || lv_name=vol2) || vg_tags=vg_tag1' vol1 vol2
orig snap xyz
---
test/shell/select-report.sh | 166 ++++++++++++++++++++-----------------------
1 files changed, 76 insertions(+), 90 deletions(-)
diff --git a/test/shell/select-report.sh b/test/shell/select-report.sh
index 70e5366..f56aa21 100644
--- a/test/shell/select-report.sh
+++ b/test/shell/select-report.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2014 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2014-2015 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
@@ -38,22 +38,24 @@ lvcreate -L4m -s "$vg3/orig" -n "snap"
OUT_LOG_FILE="out"
ERR_LOG_FILE="err"
-function result()
-{
+sel() {
local items_found
- test -f $OUT_LOG_FILE || {
+ ${1}s --noheadings -o ${1}_name --select "$2" 2>"$ERR_LOG_FILE" | tee "$OUT_LOG_FILE"
+ shift 2
+
+ test -f "$OUT_LOG_FILE" || {
echo " >>> Missing log file to check!"
return 1
}
# there shouldn't be any selection syntax error
- grep "Selection syntax error at" $ERR_LOG_FILE > /dev/null && {
+ grep "Selection syntax error at" "$ERR_LOG_FILE" >/dev/null && {
echo " >>> Selection syntax error hit!"
return 1
}
- items_found=$(wc -l $OUT_LOG_FILE | cut -f 1 -d " ")
+ items_found=$(wc -l "$OUT_LOG_FILE" | cut -f 1 -d ' ')
# the number of lines on output must match
test $items_found -eq $# || {
@@ -65,87 +67,71 @@ function result()
# the names selected must be correct
# each pv, vg and lv name is unique so just check
# the presence of the names given as arg
- for name in $1; do
- grep $name $OUT_LOG_FILE > /dev/null || {
+ for name in "$@" ; do
+ grep "$name" "$OUT_LOG_FILE" >/dev/null || {
echo " >>> $name not found in the output log"
return 1
}
done
- rm -f $OUT_LOG_FILE
- rm -f $ERR_LOG_FILE
-}
-
-function pvs_sel()
-{
- pvs 1>$OUT_LOG_FILE 2>$ERR_LOG_FILE --noheadings -o pv_name --select "$1" && result $2
-}
-
-function vgs_sel()
-{
- vgs &>$OUT_LOG_FILE 2>$ERR_LOG_FILE --noheadings -o vg_name --select "$1" && result $2
-}
-
-function lvs_sel()
-{
- lvs &>$OUT_LOG_FILE 2>$ERR_LOG_FILE --noheadings -o lv_name --select "$1" && result $2
+ rm -f "$OUT_LOG_FILE" "$ERR_LOG_FILE"
}
##########################
# STRING FIELD SELECTION #
##########################
#$LVS 'lv_name="vol1"' && result vol1
-lvs_sel 'lv_name="vol1"' "vol1"
+sel lv 'lv_name="vol1"' vol1
#$LVS 'lv_name!="vol1"' && result vol2 abc xyz
-lvs_sel 'lv_name!="vol1"' "vol2 abc xyz orig snap"
+sel lv 'lv_name!="vol1"' vol2 abc xyz orig snap
# check string values are accepted without quotes too
-lvs_sel 'lv_name=vol1' "vol1"
+sel lv 'lv_name=vol1' vol1
# check single quotes are also accepted instead of double quotes
-lvs_sel "lv_name='vol1'" "vol1"
+sel lv "lv_name='vol1'" vol1
###############################
# STRING LIST FIELD SELECTION #
###############################
-pvs_sel 'tags=["pv_tag1"]' ""
+sel pv 'tags=["pv_tag1"]'
# for one item, no need to use []
-pvs_sel 'tags="pv_tag1"' "$dev1 $dev2"
+sel pv 'tags="pv_tag1"' "$dev1" "$dev6"
# no match
-pvs_sel 'tags=["pv_tag1" && "pv_tag2"]'
-pvs_sel 'tags=["pv_tag1" && "pv_tag2" && "pv_tag3"]' "$dev1"
+sel pv 'tags=["pv_tag1" && "pv_tag2"]'
+sel pv 'tags=["pv_tag1" && "pv_tag2" && "pv_tag3"]' "$dev1"
# check the order has no effect on selection result
-pvs_sel 'tags=["pv_tag3" && "pv_tag2" && "pv_tag1"]' "$dev1"
-pvs_sel 'tags=["pv_tag4" || "pv_tag3"]' "$dev1 $dev6"
-pvs_sel 'tags!=["pv_tag1"]' "$dev1 $dev2 $dev3 $dev4 $dev5 $dev6"
+sel pv 'tags=["pv_tag3" && "pv_tag2" && "pv_tag1"]' "$dev1"
+sel pv 'tags=["pv_tag4" || "pv_tag3"]' "$dev1" "$dev6"
+sel pv 'tags!=["pv_tag1"]' "$dev1" "$dev2" "$dev3" "$dev4" "$dev5" "$dev6"
# check mixture of && and || - this is not allowed
-not pvs_sel 'tags=["pv_tag1" && "pv_tag2" || "pv_tag3"]'
+not sel pv 'tags=["pv_tag1" && "pv_tag2" || "pv_tag3"]'
##########################
# NUMBER FIELD SELECTION #
##########################
-vgs_sel 'pv_count=3' "$vg1"
-vgs_sel 'pv_count!=3' "$vg3 $vg2"
-vgs_sel 'pv_count<2' "$vg3"
-vgs_sel 'pv_count<=2' "$vg3 $vg2"
-vgs_sel 'pv_count>2' "$vg1"
-vgs_sel 'pv_count>=2' "$vg1 $vg2"
+sel vg 'pv_count=3' $vg1
+sel vg 'pv_count!=3' $vg3 $vg2
+sel vg 'pv_count<2' $vg3
+sel vg 'pv_count<=2' $vg3 $vg2
+sel vg 'pv_count>2' $vg1
+sel vg 'pv_count>=2' $vg1 $vg2
########################
# SIZE FIELD SELECTION #
########################
# check size units are accepted as well as floating point numbers for sizes
-lvs_sel 'size=8388608b' "vol1"
-lvs_sel 'size=8192k' "vol1"
-lvs_sel 'size=8m' "vol1"
-lvs_sel 'size=8.00m' "vol1"
-lvs_sel 'size=0.0078125g' "vol1"
-lvs_sel 'size=0.00000762939453125t' "vol1"
-lvs_sel 'size=0.000000007450580596923828125p' "vol1"
-lvs_sel 'size=0.0000000000072759576141834259033203125e' "vol1"
-
-lvs_sel 'size>8m' "abc"
-lvs_sel 'size>=8m' "abc vol1"
-lvs_sel 'size<8m' "vol2 xyz orig snap"
-lvs_sel 'size<=8m' "vol2 xyz vol1 orig snap"
+sel lv 'size=8388608b' vol1
+sel lv 'size=8192k' vol1
+sel lv 'size=8m' vol1
+sel lv 'size=8.00m' vol1
+sel lv 'size=0.0078125g' vol1
+sel lv 'size=0.00000762939453125t' vol1
+sel lv 'size=0.000000007450580596923828125p' vol1
+sel lv 'size=0.0000000000072759576141834259033203125e' vol1
+
+sel lv 'size>8m' abc
+sel lv 'size>=8m' abc vol1
+sel lv 'size<8m' vol2 xyz orig snap
+sel lv 'size<=8m' vol2 xyz vol1 orig snap
###########################
# PERCENT FIELD SELECTION #
@@ -153,69 +139,69 @@ lvs_sel 'size<=8m' "vol2 xyz vol1 orig snap"
if aux target_at_least dm-snapshot 1 10 0; then
# Test zero percent only if snapshot can be zero.
# Before 1.10.0, the snap percent included metadata size.
- lvs_sel 'snap_percent=0' "snap"
+ sel lv 'snap_percent=0' snap
fi
-dd if=/dev/zero of=$DM_DEV_DIR/$vg3/snap bs=1M count=1
-lvs_sel 'snap_percent<50' "snap"
-lvs_sel 'snap_percent>50'
-dd if=/dev/zero of=$DM_DEV_DIR/$vg3/snap bs=1M count=4
-lvs_sel 'snap_percent=100' "snap"
+dd if=/dev/zero of="$DM_DEV_DIR/$vg3/snap" bs=1M count=1
+sel lv 'snap_percent<50' snap
+sel lv 'snap_percent>50'
+dd if=/dev/zero of="$DM_DEV_DIR/$vg3/snap" bs=1M count=4
+sel lv 'snap_percent=100' snap
# % char is accepted as suffix for percent values
-lvs_sel 'snap_percent=100%' "snap"
+sel lv 'snap_percent=100%' snap
# percent values over 100% are not accepted
-not lvs_sel 'snap_percent=101%'
+not sel lv 'snap_percent=101%'
#########################
# REGEX FIELD SELECTION #
#########################
-lvs_sel 'lv_name=~"^vol[12]"' "vol1 vol2"
-lvs_sel 'lv_name!~"^vol[12]"' "abc xyz orig snap"
+sel lv 'lv_name=~"^vol[12]"' vol1 vol2
+sel lv 'lv_name!~"^vol[12]"' abc xyz orig snap
# check regex is accepted without quotes too
-lvs_sel 'lv_name=~^vol[12]' "vol1 vol2"
+sel lv 'lv_name=~^vol[12]' vol1 vol2
###########
# GENERIC #
###########
# check prefix works for selection too
-lvs_sel 'lv_name="vol1"' "vol1"
-lvs_sel 'name="vol1"' "vol1"
+sel lv 'lv_name="vol1"' vol1
+sel lv 'name="vol1"' vol1
# check reserved values are accepted for certain fields as well as usual values
-vgs_sel 'vg_mda_copies=unmanaged' "$vg2 $vg3"
-vgs_sel 'vg_mda_copies=2' "$vg1"
+sel vg 'vg_mda_copies=unmanaged' $vg2 $vg3
+sel vg 'vg_mda_copies=2' $vg1
# also, we must match only vg1, not including vg2 and vg3
# when comparing ranges - unamanged is mapped onto 2^64 - 1 internally,
# so we need to skip this internal value if it matches with selection criteria!
-vgs_sel 'vg_mda_copies>=2' "$vg1"
-not vgs_sel 'vg_mda_copies=18446744073709551615'
+sel vg 'vg_mda_copies>=2' $vg1
+not sel vg 'vg_mda_copies=18446744073709551615'
-lvs_sel 'lv_read_ahead=auto' "vol1 vol2 orig snap"
-lvs_sel 'lv_read_ahead=256k' "abc xyz"
+sel lv 'lv_read_ahead=auto' vol1 vol2 orig snap
+sel lv 'lv_read_ahead=256k' abc xyz
-lvs_sel 'lv_minor=-1' "vol1 vol2 abc orig snap"
-lvs_sel 'lv_minor=undefined' "vol1 vol2 abc orig snap"
-lvs_sel 'lv_minor=undef' "vol1 vol2 abc orig snap"
-lvs_sel 'lv_minor=unknown' "vol1 vol2 abc orig snap"
-lvs_sel 'lv_minor=254' "xyz"
+sel lv 'lv_minor=-1' vol1 vol2 abc orig snap
+sel lv 'lv_minor=undefined' vol1 vol2 abc orig snap
+sel lv 'lv_minor=undef' vol1 vol2 abc orig snap
+sel lv 'lv_minor=unknown' vol1 vol2 abc orig snap
+sel lv 'lv_minor=254' xyz
# if size unit not spefied, the 'm' (MiB) unit is used by default
-lvs_sel 'lv_size=8' "vol1"
+sel lv 'lv_size=8' vol1
# no need to use quotes for the whole selection string if it does not clash with shell
-lvs_sel name=vol1 vol1
+sel lv name=vol1 vol1
##########################################
# FORMING MORE COMPLEX SELECTION CLAUSES #
##########################################
# AND clause
-lvs_sel 'lv_tags=lv_tag1 && lv_size=4m' "vol2"
+sel lv 'lv_tags=lv_tag1 && lv_size=4m' vol2
# OR clause
-lvs_sel 'lv_name=vol1 || lv_name=vol2' "vol1 vol2"
+sel lv 'lv_name=vol1 || lv_name=vol2' vol1 vol2
# grouping by using ( )
-lvs_sel '(lv_name=vol1 || lv_name=vol2) || vg_tags=vg_tag1' "vol1 vol2 abc orig snap"
-lvs_sel '(lv_name=vol1 && lv_size=100m) || vg_tags=vg_tag1' "xyz orig snap"
-lvs_sel '(lv_name=vol1 || lv_name=vol2) && vg_tags=vg_tag1'
-lvs_sel '(lv_name=vol1 || lv_name=vol2) && lv_size < 8m' "vol2"
-lvs_sel '(lv_name=vol1 && lv_size=8m) && vg_tags=vg_tag2' "vol1"
+sel lv '(lv_name=vol1 || lv_name=vol2) || vg_tags=vg_tag1' vol1 vol2 orig snap xyz
+sel lv '(lv_name=vol1 && lv_size=100m) || vg_tags=vg_tag1' xyz orig snap
+sel lv '(lv_name=vol1 || lv_name=vol2) && vg_tags=vg_tag1'
+sel lv '(lv_name=vol1 || lv_name=vol2) && lv_size < 8m' vol2
+sel lv '(lv_name=vol1 && lv_size=8m) && vg_tags=vg_tag2' vol1
# negation of clause grouped by ( )
-lvs_sel '!(lv_name=vol1 || lv_name=vol2)' "abc xyz orig snap"
+sel lv '!(lv_name=vol1 || lv_name=vol2)' abc xyz orig snap
8 years
master - tests: check for dmeventd first
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0e1d1aaca83381...
Commit: 0e1d1aaca833813fb6cadd16c704c83bb8e94f09
Parent: e6a69af2d751c83e6c1e82005607448630ae7047
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Mar 16 12:26:00 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Mar 16 12:26:00 2015 +0100
tests: check for dmeventd first
Check there is no dmeventd before creating vg.
---
test/shell/lvconvert-repair-transient-dmeventd.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvconvert-repair-transient-dmeventd.sh b/test/shell/lvconvert-repair-transient-dmeventd.sh
index 5347d88..4f6171d 100644
--- a/test/shell/lvconvert-repair-transient-dmeventd.sh
+++ b/test/shell/lvconvert-repair-transient-dmeventd.sh
@@ -11,9 +11,9 @@
. lib/inittest
+aux prepare_dmeventd
aux mirror_recovery_works || skip
aux prepare_vg 5
-aux prepare_dmeventd
lvcreate -aey --type mirror -m 3 --ignoremonitoring -L 1 -n 4way $vg
lvchange --monitor y $vg/4way
8 years
master - tests: drop unused ""
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e6a69af2d751c8...
Commit: e6a69af2d751c83e6c1e82005607448630ae7047
Parent: 05f23e77634b2ed3d7861511c07ed73a3bb6d096
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 13 11:39:55 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 13 12:12:54 2015 +0100
tests: drop unused ""
---
test/shell/pv-range-overflow.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/shell/pv-range-overflow.sh b/test/shell/pv-range-overflow.sh
index 4caee02..f6b9622 100644
--- a/test/shell/pv-range-overflow.sh
+++ b/test/shell/pv-range-overflow.sh
@@ -15,7 +15,7 @@
aux prepare_vg 2
-lvcreate -L4 -n"$lv" $vg
+lvcreate -L4 -n $lv $vg
# Test for the bogus diagnostic reported in BZ 284771
# http://bugzilla.redhat.com/284771.
8 years
master - systemd: blk-availability.service: add After=iscsi-shutdown.service
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=05f23e77634b2e...
Commit: 05f23e77634b2ed3d7861511c07ed73a3bb6d096
Parent: c6d96efc38b2d1af9e81d96f27f17eea90fe7623
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Mar 13 12:05:47 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Mar 13 12:08:20 2015 +0100
systemd: blk-availability.service: add After=iscsi-shutdown.service
The iscsi-shutdown.service is the one responsible for logging out
iscsi sessions so blk-availability.service (running the blkdeactivate
script) should be run before that on shutdown (so we need to use
After=iscsi-shutdown.service because "After" relates to starting
the service and the opposite order is automatically applied on
stopping the service at shutdown).
---
WHATS_NEW | 1 +
.../blk_availability_systemd_red_hat.service.in | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index b4fd415..97b562d 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.118 -
=================================
+ Add After=iscsi-shutdown.service to blk-availability.service systemd unit.
Disallow vgconvert from changing metadata format when lvmetad is used.
Don't do a full read of VG when creating a new VG with an existing name.
Reduce number of VG metadata parsing when looking for vgname on a PV.
diff --git a/scripts/blk_availability_systemd_red_hat.service.in b/scripts/blk_availability_systemd_red_hat.service.in
index 9c1cb78..3506738 100644
--- a/scripts/blk_availability_systemd_red_hat.service.in
+++ b/scripts/blk_availability_systemd_red_hat.service.in
@@ -1,6 +1,6 @@
[Unit]
Description=Availability of block devices
-After=lvm2-activation.service lvm2-lvmetad.service iscsi.service iscsid.service fcoe.service
+After=lvm2-activation.service lvm2-lvmetad.service iscsi-shutdown.service iscsi.service iscsid.service fcoe.service
DefaultDependencies=no
Conflicts=shutdown.target
8 years
master - tests: few more warnings for gcc only
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c6d96efc38b2d1...
Commit: c6d96efc38b2d1af9e81d96f27f17eea90fe7623
Parent: eded54df7ba781afa9da14dd1a79b132aba255eb
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 12 00:12:15 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 12 00:12:15 2015 +0100
tests: few more warnings for gcc only
g++ doesn't like them.
---
make.tmpl.in | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/make.tmpl.in b/make.tmpl.in
index 3a8597a..322e33b 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -148,7 +148,6 @@ WFLAGS +=\
-Wfloat-equal\
-Wformat-security\
-Winline\
- -Wmissing-declarations\
-Wmissing-format-attribute\
-Wmissing-include-dirs\
-Wmissing-noreturn\
@@ -156,14 +155,15 @@ WFLAGS +=\
-Wredundant-decls\
-Wshadow\
-Wundef\
- -Wuninitialized\
-Wwrite-strings
WCFLAGS +=\
+ -Wmissing-declarations\
-Wmissing-prototypes\
-Wnested-externs\
-Wold-style-definition\
- -Wstrict-prototypes
+ -Wstrict-prototypes\
+ -Wuninitialized
ifeq ("@HAVE_WJUMP@", "yes")
WCFLAGS += -Wjump-misses-init
8 years
master - tests: avoid loop on older system
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=eded54df7ba781...
Commit: eded54df7ba781afa9da14dd1a79b132aba255eb
Parent: 26f5ec0e98ff067d7198a41908f35a62dda8f88b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 12 00:07:45 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 12 00:07:45 2015 +0100
tests: avoid loop on older system
Cleanup overload of 'push'.
Don't busy-loop when reading is finished.
---
test/lib/brick-shelltest.h | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/test/lib/brick-shelltest.h b/test/lib/brick-shelltest.h
index 9bdc94b..60aab20 100644
--- a/test/lib/brick-shelltest.h
+++ b/test/lib/brick-shelltest.h
@@ -463,6 +463,19 @@ struct Source {
char buf[ 128 * 1024 ];
if ( (sz = read(fd, buf, sizeof(buf) - 1)) > 0 )
sink->push( std::string( buf, sz ) );
+
+ /*
+ * On RHEL5 box this code busy-loops here, while
+ * parent process no longer writes anything.
+ *
+ * Unclear why 'select()' is anouncing available
+ * data, while we read 0 bytes with errno == 0.
+ *
+ * Temporarily resolved with usleep() instead of loop.
+ */
+ if (!sz && (!errno || errno == EINTR))
+ usleep(50000);
+
if ( sz < 0 && errno != EAGAIN )
throw syserr( "reading pipe" );
}
@@ -625,11 +638,11 @@ struct IO : Sink {
return *new (this) IO( io );
}
- void clear(int push = 1) {
+ void clear( int to_push = 1 ) {
for ( Sinks::iterator i = sinks.begin(); i != sinks.end(); ++i )
delete *i;
sinks.clear();
- if (push)
+ if ( to_push )
sinks.push_back( _observer = new Observer );
}
8 years
master - tests: update runner
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=26f5ec0e98ff06...
Commit: 26f5ec0e98ff067d7198a41908f35a62dda8f88b
Parent: 1ad9677cb363f0f38b07a7d82add0f4479c08411
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 11 21:13:41 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 11 21:17:23 2015 +0100
tests: update runner
Avoid busy-looping on CPU while reading socket pipe
and always call read only when select tells there is
something for read.
Change the batch output to old nicer output.
---
test/lib/brick-shelltest.h | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/test/lib/brick-shelltest.h b/test/lib/brick-shelltest.h
index 7c49fa3..9bdc94b 100644
--- a/test/lib/brick-shelltest.h
+++ b/test/lib/brick-shelltest.h
@@ -461,7 +461,7 @@ struct Source {
virtual void sync( Sink *sink ) {
ssize_t sz;
char buf[ 128 * 1024 ];
- while ( (sz = read(fd, buf, sizeof(buf) - 1)) > 0 )
+ if ( (sz = read(fd, buf, sizeof(buf) - 1)) > 0 )
sink->push( std::string( buf, sz ) );
if ( sz < 0 && errno != EAGAIN )
throw syserr( "reading pipe" );
@@ -720,10 +720,12 @@ struct TestCase {
exit(201);
}
+#if 0
if (fcntl( fds[0], F_SETFL, O_NONBLOCK ) == -1) {
perror("fcntl on socket");
exit(202);
}
+#endif
io.sources.push_back( new Source( fds[0] ) );
child.fd = fds[1];
@@ -747,7 +749,7 @@ struct TestCase {
return false;
}
- /* kill off tests after a minute of silence */
+ /* kill off tests after a timeout silence */
if ( !options.interactive )
if ( end - silent_start > options.timeout ) {
kill( pid, SIGINT );
@@ -777,11 +779,10 @@ struct TestCase {
last_update = end;
}
}
-
- if ( select( nfds, &set, NULL, NULL, &wait ) > 0 )
+ if ( select( nfds, &set, NULL, NULL, &wait ) > 0 ) {
silent_start = end; /* something happened */
-
- io.sync( false );
+ io.sync( false );
+ }
return true;
}
@@ -890,9 +891,10 @@ struct TestCase {
if ( options.batch ) {
int spaces = std::max( 64 - int(pretty().length()), 0 );
- progress( Last ) << " " << std::string( spaces, '.' ) << " " << r << std::endl;
+ progress( Last ) << " " << std::string( spaces, '.' ) << " " << r;
if ( r == Journal::PASSED )
- progress( First ) << " " << rusage() << std::endl;
+ progress( First ) << " " << rusage();
+ progress( Last ) << std::endl;
} else
progress( Last ) << tag( r ) << pretty() << std::endl;
8 years
master - tests: update makefile
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1ad9677cb363f0...
Commit: 1ad9677cb363f0f38b07a7d82add0f4479c08411
Parent: bbe4f7e4c58a660694e5fdee0a981d67000a09de
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 11 21:11:09 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 11 21:17:23 2015 +0100
tests: update makefile
Respect $LVM_TEST_RESULT dir
Share same target for clean: & distclean:
Cleanup path-common
---
test/Makefile.in | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/test/Makefile.in b/test/Makefile.in
index 9e8e484..93ab24c 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -102,28 +102,28 @@ help:
check: .tests-stamp
VERBOSE=$(VERBOSE) ./lib/runner \
- --testdir . --outdir results \
+ --testdir . --outdir $(LVM_TEST_RESULTS) \
--flavours ndev-vanilla,ndev-cluster,ndev-lvmetad --only $(T) --skip $(S)
check_system: .tests-stamp
VERBOSE=$(VERBOSE) ./lib/runner \
- --testdir . --outdir results \
+ --testdir . --outdir $(LVM_TEST_RESULTS) \
--flavours udev-vanilla,udev-cluster,udev-lvmetad --only $(T) --skip $(S)
check_cluster: .tests-stamp
VERBOSE=$(VERBOSE) ./lib/runner \
- --testdir . --outdir results \
+ --testdir . --outdir $(LVM_TEST_RESULTS) \
--flavours ndev-cluster --only $(T) --skip $(S)
check_local: .tests-stamp
VERBOSE=$(VERBOSE) ./lib/runner \
- --testdir . --outdir results \
+ --testdir . --outdir $(LVM_TEST_RESULTS) \
--flavours ndev-vanilla --only $(T) --skip $(S)
ifeq ("@BUILD_LVMETAD@", "yes")
check_lvmetad: .tests-stamp
VERBOSE=$(VERBOSE) ./lib/runner \
- --testdir . --outdir results \
+ --testdir . --outdir $(LVM_TEST_RESULTS) \
--flavours ndev-lvmetad --only $(T) --skip $(S)
endif
@@ -237,13 +237,16 @@ LIB = $(LIB_SHARED) $(LIB_LOCAL) $(LIB_EXEC) $(LIB_FLAVOURS)
ln -fs $(abs_top_srcdir)/conf/thin-performance.profile lib/thin-performance.profile
touch $@
-clean:
+cleantest:
test "$(srcdir)" = . || $(RM) $(RUN_BASE)
$(RM) -r $(LVM_TEST_RESULTS)
+clean: cleantest
+distclean: cleantest
+
CLEAN_TARGETS += .lib-dir-stamp .tests-stamp $(LIB) $(addprefix lib/,$(CMDS)) \
lib/clvmd lib/dmeventd lib/dmsetup lib/lvmetad lib/fsadm lib/vgimportclone \
- lib/thin-performance.profile
+ lib/thin-performance.profile lib/paths-common
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
8 years
master - tests: drop unneeded comment
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=bbe4f7e4c58a66...
Commit: bbe4f7e4c58a660694e5fdee0a981d67000a09de
Parent: 243a135fe9091a3d306ee09b397779e503bb6adf
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 11 15:42:44 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 11 21:17:23 2015 +0100
tests: drop unneeded comment
---
test/shell/lvconvert-mirror-updown.sh | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/test/shell/lvconvert-mirror-updown.sh b/test/shell/lvconvert-mirror-updown.sh
index 67862ac..ddd34c7 100644
--- a/test/shell/lvconvert-mirror-updown.sh
+++ b/test/shell/lvconvert-mirror-updown.sh
@@ -28,9 +28,7 @@ lvconvert -m+1 -b $vg/$lv1 "$dev3"
#lvconvert $vg/$lv1
lvs -a $vg
-#
-# It fails so use 'should' and -vvvv for now
-#
+
lvconvert -m-1 $vg/$lv1 "$dev2"
vgremove -f $vg
8 years