summaryrefslogtreecommitdiff
path: root/tests/t9040-many-partitions.sh
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-05-06 18:37:21 +0200
committerJim Meyering <meyering@redhat.com>2010-05-06 18:37:21 +0200
commiteedc6d77dc4b3488decd4dce9cb8cafaa95755ce (patch)
treea9322d64cb43e61aedbdd3c64405112683b0bd15 /tests/t9040-many-partitions.sh
parent48da38ed7c0b8dd38c2458445e51dbb74bd183f2 (diff)
downloadparted-eedc6d77dc4b3488decd4dce9cb8cafaa95755ce.tar.gz
tests: make the new many-partitions test fail if it takes "too long"
* tests/t9040-many-partitions.sh: Fail if creating 60 partitions takes more than a minute.
Diffstat (limited to 'tests/t9040-many-partitions.sh')
-rw-r--r--tests/t9040-many-partitions.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/t9040-many-partitions.sh b/tests/t9040-many-partitions.sh
index 0afc315..c41ecfc 100644
--- a/tests/t9040-many-partitions.sh
+++ b/tests/t9040-many-partitions.sh
@@ -69,8 +69,13 @@ while :; do
i=$((i+1))
done
t_final=$(date +%s.%N)
-$AWK 'BEGIN {printf "created %d partitions in %.2f seconds\n",'\
-"$n_partitions, $t_final - $t0 }" /dev/null
+
+# Fail the test if it takes too long.
+# On Fedora 13, it takes about 15 seconds.
+# With older kernels, it typically takes more than 150 seconds.
+$AWK "BEGIN {d = $t_final - $t0; n = $n_partitions; st = 60 < d;"\
+' printf "created %d partitions in %.2f seconds\n", n, d; exit st }' /dev/null \
+ || fail=1
parted -m -s $scsi_dev u s p > out || fail=1
compare out exp || fail=1