@@ -124,7 +124,7 @@ fetch_http()
# NOTE: the timeout is short, and we only try twice to access the
# remote host. This is to improve performance when offline, or
# the remote host is offline.
- dryrun "${wget_bin} --timeout=1 --tries=2 --directory-prefix=${local_snapshots}/${dir} ${remote_snapshots}/${getfile}"
+ dryrun "${wget_bin} ${wget_quiet:+-q} --timeout=1 --tries=2 --directory-prefix=${local_snapshots}/${dir} ${remote_snapshots}/${getfile}"
if test ! -s ${local_snapshots}/${getfile}; then
warning "downloaded file ${getfile} has zero data!"
return 1
@@ -15,6 +15,10 @@ if test -e "${PWD}/host.conf"; then
. "${PWD}/host.conf"
else
warning "no host.conf file!"
+ remote_snapshots=http://cbuild.validation.linaro.org/snapshots
+ local_snapshots=test_snapshots
+ wget_bin=/usr/bin/wget
+ wget_quiet=yes
fi
# Since we're testing, we don't load the host.conf file, instead
@@ -22,6 +26,10 @@ fi
cbuild_top=/build/cbuild2/test
hostname=test.foobar.org
target=x86_64-linux-gnu
+#remote_snapshots=http://cbuild.validation.linaro.org/snapshots
+#local_snapshots=test_snapshots
+#wget_bin=/usr/bin/wget
+#wget_quiet=yes
if test x"$1" = x"-v"; then
debug=yes
@@ -142,6 +150,19 @@ else
fi
# ----------------------------------------------------------------------------------
+echo "============= fetch() tests ================"
+if test -d "${local_snapshots}"; then
+ notice "${local_snapshots} directory exists. Moving it to ${local_snapshots}.bak."
+ mv ${local_snapshots} ${local_snapshots}.bak
+fi
+
+out="`fetch md5sums`"
+if test $? -eq 0; then
+ pass "fetch md5sums"
+else
+ fail "fetch md5sums"
+fi
+# ----------------------------------------------------------------------------------
echo "============= find_snapshot() tests ================"
out="`find_snapshot gcc`"
From: "Ryan S. Arnold" <ryan.arnold@linaro.org> When run in the src dir the find_snapshot test would generate errors because the md5sums file that find_snapshot uses wasn't downloaded. This test addition creates a temporary build directory and performs a "fetch md5sums" test. This patch also adds a wget quiet option that is used when running the test suite. --- lib/fetch.sh | 2 +- testsuite/test.sh | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-)