[parted-devel] [PATCH] tests: t9030 wait for partition removal
Brian C. Lane
bcl at redhat.com
Fri Oct 21 20:46:53 UTC 2011
From: "Brian C. Lane" <bcl at redhat.com>
The removal of the partition may take enough time that the next
mkpart will fail. Wait for it to be removed.
Remove scsi_debug size and set the end of the partition to 8000s so
that it will fit inside the default scsi_debug size of 8M. This
prevents failures on machines with limited memory.
* tests/t9030-align-check.sh: wait for partition removal and use
smaller disk.
---
tests/t9030-align-check.sh | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/tests/t9030-align-check.sh b/tests/t9030-align-check.sh
index bc8ae09..805fa40 100644
--- a/tests/t9030-align-check.sh
+++ b/tests/t9030-align-check.sh
@@ -25,7 +25,7 @@ grep '^#define USE_BLKID 1' "$CONFIG_HEADER" > /dev/null ||
skip_ 'this system lacks a new-enough libblkid'
# create memory-backed device
-scsi_debug_setup_ dev_size_mb=550 physblk_exp=3 lowest_aligned=7 > dev-name ||
+scsi_debug_setup_ physblk_exp=3 lowest_aligned=7 > dev-name ||
skip_ 'failed to create scsi_debug device'
scsi_dev=$(cat dev-name)
p1=${scsi_dev}1
@@ -34,7 +34,7 @@ parted -s $scsi_dev mklabel gpt || fail=1
i=60
while :; do
- parted -s $scsi_dev mkpart p1 ext2 ${i}s 80000s || fail=1
+ parted -s $scsi_dev mkpart p1 ext2 ${i}s 8000s || fail=1
wait_for_dev_to_appear_ $p1 || fail=1
parted -s $scsi_dev align-check min 1 > out 2>&1
result=$?
@@ -46,6 +46,14 @@ while :; do
parted -s $scsi_dev rm 1
i=$(expr $i + 1)
test $i = 70 && break
+
+ # Wait until partition is gone
+ t=10
+ while [ -e $p1 ]; do
+ sleep 1
+ t=$(expr $t - 1)
+ test $t = 0 && break
+ done
done
Exit $fail
--
1.7.6.4
More information about the parted-devel
mailing list