FYI, Just printing the elapsed time is not enough. Make it more obvious when some aspect (BLKPG?) of an older kernel makes adding many partitions take too long.
>From eedc6d77dc4b3488decd4dce9cb8cafaa95755ce Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyer...@redhat.com> Date: Thu, 6 May 2010 18:37:21 +0200 Subject: [PATCH] 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. --- tests/t9040-many-partitions.sh | 9 +++++++-- 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 -- 1.7.1.166.gf2086 _______________________________________________ bug-parted mailing list bug-parted@gnu.org http://lists.gnu.org/mailman/listinfo/bug-parted