summaryrefslogtreecommitdiffstats
path: root/tests/imsm-grow-template
diff options
context:
space:
mode:
authorAdam Kwolek <adam.kwolek@intel.com>2011-03-14 15:09:29 +0100
committerNeilBrown <neilb@suse.de>2011-03-14 22:46:54 +0100
commite26c926209d84683815275bf8a3850b00731937e (patch)
tree3461455f5a95c103579a4acf7338679e7cd1c33a /tests/imsm-grow-template
parentddf: implement remove_from_super (diff)
downloadmdadm-e26c926209d84683815275bf8a3850b00731937e.tar.xz
mdadm-e26c926209d84683815275bf8a3850b00731937e.zip
imsm: FIX: existing backup file fails unit tests
During normal test execution, backup file is deleted after test execution. If test is interrupted/broken, backup file can remain for next run. When backup file exists before unit test run, suits 12 and 13 fails. To avoid this remove backup file before grow is executed. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'tests/imsm-grow-template')
-rw-r--r--tests/imsm-grow-template8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/imsm-grow-template b/tests/imsm-grow-template
index 7c212c48..d03752d4 100644
--- a/tests/imsm-grow-template
+++ b/tests/imsm-grow-template
@@ -17,8 +17,10 @@ function grow_member() {
local offset=$6
local chunk=$7
local array_size=$((comps * size))
+ local backup_imsm=/tmp/backup_imsm
- ( set -ex; mdadm --grow $member --chunk=$chunk --level=$level --backup-file=/tmp/backup_imsm )
+ rm -f $backup_imsm
+ ( set -ex; mdadm --grow $member --chunk=$chunk --level=$level --backup-file=$backup_imsm )
local status=$?
if [ $negative_test -ne 0 ]; then
if [ $status -eq 0 ]; then
@@ -71,6 +73,7 @@ done
imsm_check container $num_disks
num_disks=$((num_disks + add_to_num_disks))
+backup_imsm=/tmp/backup_imsm
# Grow each member or a container depending on the type of an operation
if [ $migration_test -ne 0 ]; then
@@ -82,7 +85,8 @@ if [ $migration_test -ne 0 ]; then
grow_member $member1 $new_num_disks $vol1_new_num_comps $vol1_new_level $vol1_comp_size $vol1_offset $vol1_new_chunk
fi
else
- ( set -x; mdadm --grow $container --raid-disks=$num_disks --backup-file=/tmp/backup_imsm )
+ rm -f $backup_imsm
+ ( set -x; mdadm --grow $container --raid-disks=$num_disks --backup-file=$backup_imsm )
grow_status=$?
if [ $negative_test -ne 0 ]; then
if [ $grow_status -eq 0 ]; then