From 191f3cf52a0ada3aba9ac340cbab464fb05efe89 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 15 Apr 2015 15:07:49 +0200 Subject: [PATCH] tests: shell-fu Preserve quotes for devs and use shell arrays to pass things around. --- test/shell/pvmove-abort-all.sh | 25 +++++++++++++------------ test/shell/pvmove-abort.sh | 16 ++++++++-------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/test/shell/pvmove-abort-all.sh b/test/shell/pvmove-abort-all.sh index e6e65e5ce..0398c75d4 100644 --- a/test/shell/pvmove-abort-all.sh +++ b/test/shell/pvmove-abort-all.sh @@ -37,24 +37,25 @@ lvcreate -an -Zn -l30 -n $lv2 $vg "$dev2" lvcreate -an -Zn -l30 -n $lv1 $vg1 "$dev4" lvextend -l+30 -n $vg1/$lv1 "$dev5" -cmd1="pvmove -i1 $backgroundarg \"$dev1\" \"$dev3\" $mode" -cmd2="pvmove -i1 $backgroundarg \"$dev2\" \"$dev3\" $mode" -cmd3="pvmove -i1 $backgroundarg -n $vg1/$lv1 \"$dev4\" \"$dev6\" $mode" +cmd1=(pvmove -i1 $backgroundarg $mode "$dev1" "$dev3") +cmd2=(pvmove -i1 $backgroundarg $mode "$dev2" "$dev3") +cmd3=(pvmove -i1 $backgroundarg $mode -n $vg1/$lv1 "$dev4" "$dev6") if test -z "$backgroundarg" ; then - $cmd1 & + "${cmd1[@]}" & aux wait_pvmove_lv_ready "$vg-pvmove0" - $cmd2 & + "${cmd2[@]}" & aux wait_pvmove_lv_ready "$vg-pvmove1" - $cmd3 & + "${cmd3[@]}" & aux wait_pvmove_lv_ready "$vg1-pvmove0" + lvs -a $vg $vg1 else - $cmd1 - aux add_to_kill_list "$cmd1" -P 1 - $cmd2 - aux add_to_kill_list "$cmd2" -P 1 - $cmd3 - aux add_to_kill_list "$cmd3" -P 1 + "${cmd1[@]}" + aux add_to_kill_list ${cmd1[*]} -P 1 + "${cmd2[@]}" + aux add_to_kill_list ${cmd2[*]} -P 1 + "${cmd3[@]}" + aux add_to_kill_list ${cmd3[*]} -P 1 fi # test removal of all pvmove LVs diff --git a/test/shell/pvmove-abort.sh b/test/shell/pvmove-abort.sh index 2c32f32ab..3417e7782 100644 --- a/test/shell/pvmove-abort.sh +++ b/test/shell/pvmove-abort.sh @@ -31,19 +31,19 @@ do lvcreate -an -Zn -l30 -n $lv1 $vg "$dev1" lvcreate -an -Zn -l30 -n $lv2 $vg "$dev2" -cmd1="pvmove -i1 $backgroundarg \"$dev1\" \"$dev3\" $mode" -cmd2="pvmove -i1 $backgroundarg \"$dev2\" \"$dev3\" $mode" +cmd1=(pvmove -i1 $backgroundarg $mode "$dev1" "$dev3") +cmd2=(pvmove -i1 $backgroundarg $mode "$dev2" "$dev3") if test -z "$backgroundarg" ; then - $cmd1 & + "${cmd1[@]}" & aux wait_pvmove_lv_ready "$vg-pvmove0" - $cmd2 & + "${cmd2[@]}" & aux wait_pvmove_lv_ready "$vg-pvmove1" else - $cmd1 - aux add_to_kill_list "$cmd1" -P 1 - $cmd2 - aux add_to_kill_list "$cmd2" -P 1 + "${cmd1[@]}" + aux add_to_kill_list ${cmd1[*]} -P 1 + "${cmd2[@]}" + aux add_to_kill_list ${cmd2[*]} -P 1 fi # remove specific device