Changes to the testing/external infrastructure.

The traces for external test-suites are no longer kept inside the
repositories themselves but downloaded separately via curl. This is
because git is pretty bad at dealing with large files.

See the README for more information.
This commit is contained in:
Robin Sommer 2011-09-08 12:36:35 -07:00
parent 79601ca0c3
commit bd4a629bef
7 changed files with 121 additions and 14 deletions

View file

@ -35,6 +35,7 @@ done
ln -s ../subdir-btest.cfg ./btest.cfg
cp $cwd/`dirname $0`/skel/test.skeleton tests
cp $cwd/`dirname $0`/skel/traces.cfg .
cp $cwd/`dirname $0`/skel/Makefile .
cp $cwd/`dirname $0`/skel/.gitignore .

View file

@ -1 +1,3 @@
Traces
diag.log
.proxy

View file

@ -2,10 +2,13 @@
DIAG=diag.log
BTEST=../../../aux/btest/btest
all:
all: update-traces
@rm -f $(DIAG)
@$(BTEST) -f $(DIAG)
brief:
brief: update-traces
@rm -f $(DIAG)
@$(BTEST) -b -f $(DIAG)
update-traces:
../scripts/update-traces Traces

View file

@ -0,0 +1,7 @@
#
# Format:
#
# <url> <md5sum>
#
# Use scripts/make-md5sum to calculate the md5sum.
#

76
testing/external/scripts/update-traces vendored Executable file
View file

@ -0,0 +1,76 @@
#! /usr/bin/env bash
#
# Downloads all traces as specified in <cwd>/traces.cfg to directory $1.
#
# traces.cfg must consist of lines of the form "<url> <md5sum>"
if [ "$1" == "" ]; then
echo "usage: `basename $0` <traces-directory>"
exit 1
fi
if [ ! -e $cfg ]; then
echo "No $cfg found."
exit 1
fi
cfg=traces.cfg
for proxy in .proxy ../.proxy; do
if [ -e $proxy ]; then
proxy=`cat $proxy | head -1 | awk '{print $1}'`
echo Using proxy $proxy ...
proxy="ALL_PROXY=$proxy"
break
fi
done
cat $cfg | while read line; do
if echo $line | grep -q '^[ \t]*$'; then
continue
fi
if echo $line | grep -q '^[ \t]*#'; then
continue
fi
url=`echo $line | awk '{print $1}'`
auth=`echo $line | awk '{print $3}'`
file=$1/`echo $url | sed 's#^.*/##g'`
fp=$file.md5sum
if [ "$auth" != "" ]; then
auth="-u $auth"
fi
# Get the fingerprint file.
if ! eval "$proxy curl $auth -fsS --anyauth $url.md5sum -o $fp.tmp"; then
echo "Error: Could not get $url.fingerprint, skipping download."
continue
fi
download=0
if [ -e $fp ]; then
if ! cmp -s $fp $fp.tmp; then
download=1
fi
else
download=1
fi
if [ "$download" = "1" ]; then
echo Getting $url ...
echo
eval "$proxy curl $auth -f --anyauth $url -o $file"
echo
mv $fp.tmp $fp
else
echo "`basename $file` already available."
fi
done