aboutsummaryrefslogtreecommitdiff
path: root/tests/dl-linux-tarball.bash
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-01-03 14:33:55 +0100
committerJakob Unterwurzacher2017-01-03 14:33:55 +0100
commit94b66ee1b28d0ae25114d316c382158d12f5f2dc (patch)
treeaa8ae7146cd7e6c6cca11358c745f923b551f4b9 /tests/dl-linux-tarball.bash
parent53555fec1c1db206e02d3a32bf65c43db56e04cc (diff)
tests: only check the size in dl-linux-tarball.bash
Getting rid of the MD5 calculation makes calling the script virtually free, where it took 0.2 seconds before.
Diffstat (limited to 'tests/dl-linux-tarball.bash')
-rwxr-xr-xtests/dl-linux-tarball.bash13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/dl-linux-tarball.bash b/tests/dl-linux-tarball.bash
index 5fbd2b4..9fd8534 100755
--- a/tests/dl-linux-tarball.bash
+++ b/tests/dl-linux-tarball.bash
@@ -1,14 +1,17 @@
#!/bin/bash -eu
#
-# This script checks the MD5 sum of /tmp/linux-3.0.tar.gz and downloads
-# a fresh copy if its incorrect or the file is missing.
+# This script checks the size of /tmp/linux-3.0.tar.gz and downloads
+# a fresh copy if the size is incorrect or the file is missing.
TGZ=/tmp/linux-3.0.tar.gz
-MD5_ACTUAL="$(md5sum $TGZ | cut -f1 -d' ')"
-MD5_WANT="f7e6591d86a9dbe123dfd1a0be054e7f"
+SIZE_WANT=96675825
+SIZE_ACTUAL=0
+if [[ -e $TGZ ]]; then
+ SIZE_ACTUAL=$(stat -c %s $TGZ)
+fi
-if [[ $MD5_ACTUAL != $MD5_WANT ]]; then
+if [[ $SIZE_ACTUAL -ne $SIZE_WANT ]]; then
echo "Downloading linux-3.0.tar.gz"
wget -nv --show-progress -c -O $TGZ \
https://cdn.kernel.org/pub/linux/kernel/v3.0/linux-3.0.tar.gz