1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

test: shellcheck: use quotation marks

This commit is contained in:
Zdenek Kabelac 2024-11-14 17:49:36 +01:00
parent 4c31e6d56a
commit ca5d258376
6 changed files with 35 additions and 35 deletions

View File

@ -1089,9 +1089,9 @@ prepare_devs() {
# then allocate a dedicated backing device for PV; otherwise, rollback # then allocate a dedicated backing device for PV; otherwise, rollback
# to use single backing device for device-mapper. # to use single backing device for device-mapper.
if [ -n "$LVM_TEST_BACKING_DEVICE" ] && [ "$n" -le ${#BACKING_DEVICE_ARRAY[@]} ]; then if [ -n "$LVM_TEST_BACKING_DEVICE" ] && [ "$n" -le ${#BACKING_DEVICE_ARRAY[@]} ]; then
table[i]="0 $size linear "${BACKING_DEVICE_ARRAY[i]}" $(( header_shift * 2048 ))" table[i]="0 $size linear ${BACKING_DEVICE_ARRAY[i]} $(( header_shift * 2048 ))"
else else
table[i]="0 $size linear "$BACKING_DEV" $(( i * size + ( header_shift * 2048 ) ))" table[i]="0 $size linear $BACKING_DEV $(( i * size + ( header_shift * 2048 ) ))"
fi fi
concise[i]="$name,TEST-$name,,,${table[i]}" concise[i]="$name,TEST-$name,,,${table[i]}"
echo "${table[i]}" > "$name.table" echo "${table[i]}" > "$name.table"

View File

@ -196,10 +196,10 @@ vgcreate $vg2 "$dev2"
vgcreate $vg3 "$dev3" vgcreate $vg3 "$dev3"
vgcreate $vg4 "$dev4" vgcreate $vg4 "$dev4"
cp "$DF" "$ORIG" cp "$DF" "$ORIG"
OPVID1=$(echo $(pvs --noheading -o uuid "$dev1") ) OPVID1="$(echo $(pvs --noheading -o uuid "$dev1") )"
OPVID2=$(echo $(pvs --noheading -o uuid "$dev2") ) OPVID2="$(echo $(pvs --noheading -o uuid "$dev2") )"
OPVID3=$(echo $(pvs --noheading -o uuid "$dev3") ) OPVID3="$(echo $(pvs --noheading -o uuid "$dev3") )"
OPVID4=$(echo $(pvs --noheading -o uuid "$dev4") ) OPVID4="$(echo $(pvs --noheading -o uuid "$dev4") )"
PVID1=${OPVID1//-/} PVID1=${OPVID1//-/}
PVID2=${OPVID2//-/} PVID2=${OPVID2//-/}
PVID3=${OPVID3//-/} PVID3=${OPVID3//-/}
@ -345,10 +345,10 @@ vgcreate $vg2 "$dev2"
vgcreate $vg3 "$dev3" vgcreate $vg3 "$dev3"
vgcreate $vg4 "$dev4" vgcreate $vg4 "$dev4"
cp "$DF" "$ORIG" cp "$DF" "$ORIG"
OPVID1=$(echo $(pvs --noheading -o uuid "$dev1") ) OPVID1="$(echo $(pvs --noheading -o uuid "$dev1") )"
OPVID2=$(echo $(pvs --noheading -o uuid "$dev2") ) OPVID2="$(echo $(pvs --noheading -o uuid "$dev2") )"
OPVID3=$(echo $(pvs --noheading -o uuid "$dev3") ) OPVID3="$(echo $(pvs --noheading -o uuid "$dev3") )"
OPVID4=$(echo $(pvs --noheading -o uuid "$dev4") ) OPVID4="$(echo $(pvs --noheading -o uuid "$dev4") )"
PVID1=${OPVID1//-/} PVID1=${OPVID1//-/}
PVID2=${OPVID2//-/} PVID2=${OPVID2//-/}
PVID3=${OPVID3//-/} PVID3=${OPVID3//-/}
@ -472,8 +472,8 @@ touch "$DF"
vgcreate $vg1 "$dev1" vgcreate $vg1 "$dev1"
vgcreate $vg4 "$dev4" vgcreate $vg4 "$dev4"
cp "$DF" "$ORIG" cp "$DF" "$ORIG"
OPVID1=$(echo $(pvs --noheading -o uuid "$dev1") ) OPVID1="$(echo $(pvs --noheading -o uuid "$dev1") )"
OPVID4=$(echo $(pvs --noheading -o uuid "$dev4") ) OPVID4="$(echo $(pvs --noheading -o uuid "$dev4") )"
PVID1=${OPVID1//-/} PVID1=${OPVID1//-/}
PVID4=${OPVID4//-/} PVID4=${OPVID4//-/}
@ -551,7 +551,7 @@ rm "$DF"
touch "$DF" touch "$DF"
vgcreate $vg2 "$dev2" vgcreate $vg2 "$dev2"
cp "$DF" "$ORIG" cp "$DF" "$ORIG"
OPVID2=$(echo $(pvs --noheading -o uuid "$dev2") ) OPVID2="$(echo $(pvs --noheading -o uuid "$dev2") )"
PVID2=${OPVID2//-/} PVID2=${OPVID2//-/}
grep "$PVID2" "$DF" |tee out grep "$PVID2" "$DF" |tee out
@ -601,10 +601,10 @@ grep "$SERIAL1" "$DF"
grep "$SERIAL2" "$DF" grep "$SERIAL2" "$DF"
grep "$SERIAL3" "$DF" grep "$SERIAL3" "$DF"
grep "$SERIAL4" "$DF" grep "$SERIAL4" "$DF"
OPVID1=$(echo $(pvs --noheading -o uuid "$dev1") ) OPVID1="$(echo $(pvs --noheading -o uuid "$dev1") )"
OPVID2=$(echo $(pvs --noheading -o uuid "$dev2") ) OPVID2="$(echo $(pvs --noheading -o uuid "$dev2") )"
OPVID3=$(echo $(pvs --noheading -o uuid "$dev3") ) OPVID3="$(echo $(pvs --noheading -o uuid "$dev3") )"
OPVID4=$(echo $(pvs --noheading -o uuid "$dev4") ) OPVID4="$(echo $(pvs --noheading -o uuid "$dev4") )"
PVID1=${OPVID1//-/} PVID1=${OPVID1//-/}
PVID2=${OPVID2//-/} PVID2=${OPVID2//-/}
PVID3=${OPVID3//-/} PVID3=${OPVID3//-/}
@ -665,10 +665,10 @@ vgcreate $vg2 "$dev2"
vgcreate $vg3 "$dev3" vgcreate $vg3 "$dev3"
vgcreate $vg4 "$dev4" vgcreate $vg4 "$dev4"
cp "$DF" "$ORIG" cp "$DF" "$ORIG"
OPVID1=$(echo $(pvs --noheading -o uuid "$dev1") ) OPVID1="$(echo $(pvs --noheading -o uuid "$dev1") )"
OPVID2=$(echo $(pvs --noheading -o uuid "$dev2") ) OPVID2="$(echo $(pvs --noheading -o uuid "$dev2") )"
OPVID3=$(echo $(pvs --noheading -o uuid "$dev3") ) OPVID3="$(echo $(pvs --noheading -o uuid "$dev3") )"
OPVID4=$(echo $(pvs --noheading -o uuid "$dev4") ) OPVID4="$(echo $(pvs --noheading -o uuid "$dev4") )"
PVID1=${OPVID1//-/} PVID1=${OPVID1//-/}
PVID2=${OPVID2//-/} PVID2=${OPVID2//-/}
PVID3=${OPVID3//-/} PVID3=${OPVID3//-/}
@ -730,9 +730,9 @@ vgcreate $vg1 "$dev1"
vgcreate $vg2 "$dev2" vgcreate $vg2 "$dev2"
vgcreate $vg3 "$dev3" vgcreate $vg3 "$dev3"
cp "$DF" "$ORIG" cp "$DF" "$ORIG"
OPVID1=$(echo $(pvs --noheading -o uuid "$dev1") ) OPVID1="$(echo $(pvs --noheading -o uuid "$dev1") )"
OPVID2=$(echo $(pvs --noheading -o uuid "$dev2") ) OPVID2="$(echo $(pvs --noheading -o uuid "$dev2") )"
OPVID3=$(echo $(pvs --noheading -o uuid "$dev3") ) OPVID3="$(echo $(pvs --noheading -o uuid "$dev3") )"
PVID1=${OPVID1//-/} PVID1=${OPVID1//-/}
PVID2=${OPVID2//-/} PVID2=${OPVID2//-/}
PVID3=${OPVID3//-/} PVID3=${OPVID3//-/}
@ -830,10 +830,10 @@ grep "$dev4" out
grep "$dev2" out grep "$dev2" out
grep "$dev3" out grep "$dev3" out
OPVID1=$(echo $(pvs --noheading -o uuid "$dev1") ) OPVID1="$(echo $(pvs --noheading -o uuid "$dev1") )"
OPVID2=$(echo $(pvs --noheading -o uuid "$dev2") ) OPVID2="$(echo $(pvs --noheading -o uuid "$dev2") )"
OPVID3=$(echo $(pvs --noheading -o uuid "$dev3") ) OPVID3="$(echo $(pvs --noheading -o uuid "$dev3") )"
OPVID4=$(echo $(pvs --noheading -o uuid "$dev4") ) OPVID4="$(echo $(pvs --noheading -o uuid "$dev4") )"
PVID1=${OPVID1//-/} PVID1=${OPVID1//-/}
PVID2=${OPVID2//-/} PVID2=${OPVID2//-/}
PVID3=${OPVID3//-/} PVID3=${OPVID3//-/}
@ -867,8 +867,8 @@ lvmdevices --adddev "$dev3"
cat "$DF" cat "$DF"
cp "$DF" "$ORIG" cp "$DF" "$ORIG"
OPVID1=$(echo $(pvs --noheading -o uuid "$dev1") ) OPVID1="$(echo $(pvs --noheading -o uuid "$dev1") )"
OPVID2=$(echo $(pvs --noheading -o uuid "$dev2") ) OPVID2="$(echo $(pvs --noheading -o uuid "$dev2") )"
PVID1=${OPVID1//-/} PVID1=${OPVID1//-/}
PVID2=${OPVID2//-/} PVID2=${OPVID2//-/}

View File

@ -81,7 +81,7 @@ for i in {1..10}; do
# wait here for a while until dmeventd dies.... # wait here for a while until dmeventd dies....
# surprisingly it's not instant and we can actually # surprisingly it's not instant and we can actually
# obtain list of monitored devices... # obtain list of monitored devices...
test -z $(ps -p "$pid" -o comm=) && break test -z "$(ps -p "$pid" -o comm=)" && break
sleep .1 sleep .1
done done
rm LOCAL_DMEVENTD debug.log* rm LOCAL_DMEVENTD debug.log*

View File

@ -47,7 +47,7 @@ not vgremove --config 'global { wait_for_locks = 0 }' $vg
test -f "$TESTDIR/var/lock/lvm/P_global" # still running test -f "$TESTDIR/var/lock/lvm/P_global" # still running
# First kill 'sleep' process forked from flock # First kill 'sleep' process forked from flock
# Not using 'flock -F' since this flag is newer # Not using 'flock -F' since this flag is newer
kill $(ps -o pid --no-headers --ppid "$flock_pid") || true kill "$(ps -o pid --no-headers --ppid "$flock_pid")" || true
kill "$flock_pid" || true kill "$flock_pid" || true
vgremove -ff $vg vgremove -ff $vg

View File

@ -105,7 +105,7 @@ function _check_size
local data_stripes=$3 local data_stripes=$3
# Compare size of LV with calculated one # Compare size of LV with calculated one
[ $(blockdev --getsz /dev/$vg/$lv) -eq $(_get_size $vg $lv $data_stripes) ] && echo 0 || echo 1 [ "$(blockdev --getsz /dev/$vg/$lv)" -eq "$(_get_size $vg $lv $data_stripes)" ] && echo 0 || echo 1
} }
function _total_stripes function _total_stripes

View File

@ -388,8 +388,8 @@ wait_md_create "$mddev"
vgcreate $vg9 "$mddev" vgcreate $vg9 "$mddev"
lvmdevices --adddev "$mddev" || true lvmdevices --adddev "$mddev" || true
PVIDMD=$(pvs "$mddev" --noheading -o uuid | tr -d - | awk '{print $1}') PVIDMD="$(pvs "$mddev" --noheading -o uuid | tr -d - | awk '{print $1}')"
BDEVMD=$(basename "$mddev") BDEVMD="$(basename "$mddev")"
lvcreate -l1 -an -n $lv1 $vg9 lvcreate -l1 -an -n $lv1 $vg9
lvcreate -l1 -an -n $lv2 $vg9 lvcreate -l1 -an -n $lv2 $vg9