mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-18 10:04:20 +03:00
tests: replace legacy code
Use $(..) instead of legacy `..`.
This commit is contained in:
parent
d606891e4a
commit
38917ee51c
@ -33,7 +33,7 @@ dmsetup remove GL_DEV || true
|
|||||||
rm -f "$GL_FILE"
|
rm -f "$GL_FILE"
|
||||||
dd if=/dev/zero of="$GL_FILE" bs=$((1024*1024)) count=1024 2> /dev/null
|
dd if=/dev/zero of="$GL_FILE" bs=$((1024*1024)) count=1024 2> /dev/null
|
||||||
GL_LOOP=$(losetup -f "$GL_FILE" --show)
|
GL_LOOP=$(losetup -f "$GL_FILE" --show)
|
||||||
echo "0 `blockdev --getsize $GL_LOOP` linear $GL_LOOP 0" | dmsetup create GL_DEV
|
echo "0 $(blockdev --getsize $GL_LOOP linear $GL_LOOP 0)" | dmsetup create GL_DEV
|
||||||
|
|
||||||
aux prepare_sanlock
|
aux prepare_sanlock
|
||||||
aux prepare_lvmlockd
|
aux prepare_lvmlockd
|
||||||
|
@ -17,7 +17,7 @@ SKIP_WITH_LVMPOLLD=1
|
|||||||
|
|
||||||
flatten() {
|
flatten() {
|
||||||
cat > flatten.config
|
cat > flatten.config
|
||||||
for s in `egrep '^[a-z]+ {$' flatten.config | sed -e s,{$,,`; do
|
for s in $(grep -E '^[a-z]+ {$' flatten.config | sed -e 's,{$,,'); do
|
||||||
sed -e "/^$s/,/^}/p;d" flatten.config | sed -e '1d;$d' | sed -e "s,^[ \t]*,$s/,";
|
sed -e "/^$s/,/^}/p;d" flatten.config | sed -e '1d;$d' | sed -e "s,^[ \t]*,$s/,";
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ function check_sub_lvs
|
|||||||
local lv=$2
|
local lv=$2
|
||||||
local end=$3
|
local end=$3
|
||||||
|
|
||||||
for s in `seq 0 $end`
|
for s in $(seq 0 "$end")
|
||||||
do
|
do
|
||||||
check lv_exists $vg ${lv}_rmeta_$s
|
check lv_exists $vg ${lv}_rmeta_$s
|
||||||
check lv_exists $vg ${lv}_rimage_$s
|
check lv_exists $vg ${lv}_rimage_$s
|
||||||
@ -39,7 +39,7 @@ function check_no_sub_lvs
|
|||||||
local start=$3
|
local start=$3
|
||||||
local end=$4
|
local end=$4
|
||||||
|
|
||||||
for s in `seq $start $end`
|
for s in $(seq "$start" "$end")
|
||||||
do
|
do
|
||||||
check lv_not_exists $vg ${lv}_rmeta_$s
|
check lv_not_exists $vg ${lv}_rmeta_$s
|
||||||
check lv_not_exists $vg ${lv}_rimage_$s
|
check lv_not_exists $vg ${lv}_rimage_$s
|
||||||
|
@ -23,7 +23,7 @@ get_image_pvs() {
|
|||||||
local d
|
local d
|
||||||
local images
|
local images
|
||||||
|
|
||||||
images=`dmsetup ls | grep ${1}-${2}_.image_.* | cut -f1 | sed -e s:-:/:`
|
images=$(dmsetup ls | grep "${1}-${2}_.image_.*" | cut -f1 | sed -e s:-:/:)
|
||||||
lvs --noheadings -a -o devices "$images" | sed s/\(.\)//
|
lvs --noheadings -a -o devices "$images" | sed s/\(.\)//
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ lvconvert --splitmirrors 1 --trackchanges $vg/$lv1
|
|||||||
check lv_exists $vg $lv1
|
check lv_exists $vg $lv1
|
||||||
check linear $vg ${lv1}_rimage_2
|
check linear $vg ${lv1}_rimage_2
|
||||||
fsck.ext4 -fn "$DM_DEV_DIR/mapper/$vg-${lv1}_rimage_2"
|
fsck.ext4 -fn "$DM_DEV_DIR/mapper/$vg-${lv1}_rimage_2"
|
||||||
dd of="$DM_DEV_DIR/$vg/$lv1" if=/dev/zero bs=512 oflag=direct count=`blockdev --getsz "$DM_DEV_DIR/$vg/$lv1"`
|
dd of="$DM_DEV_DIR/$vg/$lv1" if=/dev/zero bs=512 oflag=direct count="$(blockdev --getsz "$DM_DEV_DIR/$vg/$lv1")"
|
||||||
not fsck.ext4 -fn "$DM_DEV_DIR/$vg/$lv1"
|
not fsck.ext4 -fn "$DM_DEV_DIR/$vg/$lv1"
|
||||||
fsck.ext4 -fn "$DM_DEV_DIR/mapper/$vg-${lv1}_rimage_2"
|
fsck.ext4 -fn "$DM_DEV_DIR/mapper/$vg-${lv1}_rimage_2"
|
||||||
# FIXME: needed on tiny loop but not on real block backend ?
|
# FIXME: needed on tiny loop but not on real block backend ?
|
||||||
|
@ -19,7 +19,7 @@ get_image_pvs() {
|
|||||||
local d
|
local d
|
||||||
local images
|
local images
|
||||||
|
|
||||||
images=`dmsetup ls | grep ${1}-${2}_.image_.* | cut -f1 | sed -e s:-:/:`
|
images=$(dmsetup ls | grep "${1}-${2}_.image_.*" | cut -f1 | sed -e s:-:/:)
|
||||||
lvs --noheadings -a -o devices $images | sed s/\(.\)//
|
lvs --noheadings -a -o devices $images | sed s/\(.\)//
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ get_image_pvs() {
|
|||||||
local d
|
local d
|
||||||
local images
|
local images
|
||||||
|
|
||||||
images=`dmsetup ls | grep ${1}-${2}_.image_.* | cut -f1 | sed -e s:-:/:`
|
images=$(dmsetup ls | grep "${1}-${2}_.image_.*" | cut -f1 | sed -e s:-:/:)
|
||||||
lvs --noheadings -a -o devices $images | sed s/\(.\)//
|
lvs --noheadings -a -o devices $images | sed s/\(.\)//
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user