mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 05:28:20 +00:00
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:
parent
79601ca0c3
commit
bd4a629bef
7 changed files with 121 additions and 14 deletions
1
testing/external/scripts/create-new-repo
vendored
1
testing/external/scripts/create-new-repo
vendored
|
@ -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 .
|
||||
|
||||
|
|
2
testing/external/scripts/skel/.gitignore
vendored
2
testing/external/scripts/skel/.gitignore
vendored
|
@ -1 +1,3 @@
|
|||
Traces
|
||||
diag.log
|
||||
.proxy
|
||||
|
|
7
testing/external/scripts/skel/Makefile
vendored
7
testing/external/scripts/skel/Makefile
vendored
|
@ -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
|
||||
|
|
7
testing/external/scripts/skel/traces.cfg
vendored
Normal file
7
testing/external/scripts/skel/traces.cfg
vendored
Normal 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
76
testing/external/scripts/update-traces
vendored
Executable 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
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue