diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2018-10-16 20:03:21 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2018-10-16 21:56:00 +0200 |
commit | 4db228b9079386b9e24e0389a080f86ac3008e69 (patch) | |
tree | 74a8388d41213aa5e589d348c3c7246756d18137 | |
parent | c15ac326cc29b5d91e726647d584c1b563c8c294 (diff) | |
download | lvm2-4db228b9079386b9e24e0389a080f86ac3008e69.tar.gz |
tests: timing without /usr/bin/time
Use just 'date' so the 'time' package doesn't need to be installed
just for this purpose.
-rw-r--r-- | test/shell/thin-many-dmeventd.sh | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/test/shell/thin-many-dmeventd.sh b/test/shell/thin-many-dmeventd.sh index f73b5161c..a40c75ab3 100644 --- a/test/shell/thin-many-dmeventd.sh +++ b/test/shell/thin-many-dmeventd.sh @@ -54,10 +54,15 @@ sleep 9 # new thin-pool registration. for i in $(seq 11 15) do - /usr/bin/time -o TM -f %e lvcreate --errorwhenfull y -Zn -T -L4M -V4M $vg/pool_${i} -n $lv${i} - read -r t < TM - test ${t%%.*} -lt 8 || die "Creation of thin pool took more then 8 second! ($t seconds)" - # Fill thin-pool to some capacity >50% + #/usr/bin/time -o TM -f %e lvcreate --errorwhenfull y -Zn -T -L4M -V4M $vg/pool_${i} -n $lv${i} + #read -r t < TM + #test ${t%%.*} -lt 8 || die "Creation of thin pool took more then 8 second! ($t seconds)" + START=$(date +%s) + lvcreate --errorwhenfull y -Zn -T -L4M -V4M $vg/pool_${i} -n $lv${i} + END=$(date +%s) + DIFF=$(( END - START )) + test "$DIFF" -lt 8 || die "Creation of thin pool took more then 8 second! ($DIFF seconds)" + # Fill thin-pool to some capacity >50% dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv${i}" bs=256K count=9 conv=fdatasync done |