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

tests: shellcheck liter

This commit is contained in:
Zdenek Kabelac 2018-03-23 17:02:44 +01:00
parent 410c992744
commit 397b7891ff
3 changed files with 9 additions and 9 deletions

View File

@ -885,7 +885,7 @@ prepare_devs() {
# dmsetup table $name
#done
printf "%s\n" "${DEVICES[@]}" > DEVICES
printf "%s\\n" "${DEVICES[@]}" > DEVICES
# ( IFS=$'\n'; echo "${DEVICES[*]}" ) >DEVICES
echo "ok"
@ -1109,7 +1109,7 @@ prepare_vg() {
extend_filter() {
local filter=$(grep ^devices/global_filter CONFIG_VALUES | tail -n 1)
for rx in "$@"; do
filter=$(echo "$filter" | sed -e "s:\[:[ \"$rx\", :")
filter=$(echo "$filter" | sed -e "s:\\[:[ \"$rx\", :")
done
lvmconf "$filter"
}
@ -1121,7 +1121,7 @@ extend_filter_LVMTEST() {
hide_dev() {
local filter=$(grep ^devices/global_filter CONFIG_VALUES | tail -n 1)
for dev in "$@"; do
filter=$(echo "$filter" | sed -e "s:\[:[ \"r|$dev|\", :")
filter=$(echo "$filter" | sed -e "s:\\[:[ \"r|$dev|\", :")
done
lvmconf "$filter"
}
@ -1223,7 +1223,7 @@ EOF
# append all parameters (avoid adding empty \n)
local v
test $# -gt 0 && printf "%s\n" "$@" >> "$config_values"
test $# -gt 0 && printf "%s\\n" "$@" >> "$config_values"
declare -A CONF 2>/dev/null || {
# Associative arrays is not available
@ -1249,7 +1249,7 @@ EOF
done < "$config_values"
# sort by section and iterate through them
printf "%s\n" "${!CONF[@]}" | sort | while read -r v ; do
printf "%s\\n" "${!CONF[@]}" | sort | while read -r v ; do
sec=${v%%/*} # split on section'/'param_name
test "$sec" = "$last_sec" || {
test -z "$last_sec" || echo "}"

View File

@ -65,8 +65,8 @@ lv_on_diff_() {
local diff_e
# Find diff between 2 shell arrays, print them as stdin files
printf "%s\n" "${expect[@]}" | sort | uniq >_lv_on_diff1
printf "%s\n" "${xdevs[@]}" >_lv_on_diff2
printf "%s\\n" "${expect[@]}" | sort | uniq >_lv_on_diff1
printf "%s\\n" "${xdevs[@]}" >_lv_on_diff2
diff_e=$(diff _lv_on_diff1 _lv_on_diff2) ||
die "LV $2/$3 $(lv_err_list_ "^>" "${diff_e}" found)$(lv_err_list_ "^<" "${diff_e}" "not found")."
}

View File

@ -126,8 +126,8 @@ fi
echo "$TESTNAME" >TESTNAME
# Require 50M of free space in testdir
test $(df -k -P . | awk '/\// {print $4}') -gt 51200 ||
skip "Testing requires more then 50M of free space in directory $TESTDIR!\n$(df -H | sed -e 's,^,## DF: ,')"
test "$(df -k -P . | awk '/\// {print $4}')" -gt 51200 || \
skip "Testing requires more then 50M of free space in directory $TESTDIR!\\n$(df -H | sed -e 's,^,## DF: ,')"
echo "Kernel is $(uname -a)"
# Report SELinux mode