Update external test suite locations

This commit is contained in:
Jon Siwek 2018-12-06 20:11:01 -06:00
parent 5249a16384
commit 34e577c4f0
9 changed files with 39 additions and 49 deletions

View file

@ -7,15 +7,15 @@ function new_version_hook
# test suite repos to check out on a CI system. # test suite repos to check out on a CI system.
version=$1 version=$1
if [ -d testing/external/bro-testing ]; then if [ -d testing/external/zeek-testing ]; then
echo "Updating testing/external/commit-hash.bro-testing" echo "Updating testing/external/commit-hash.zeek-testing"
( cd testing/external/bro-testing && git fetch origin && git rev-parse origin/master ) > testing/external/commit-hash.bro-testing ( cd testing/external/zeek-testing && git fetch origin && git rev-parse origin/master ) > testing/external/commit-hash.zeek-testing
git add testing/external/commit-hash.bro-testing git add testing/external/commit-hash.zeek-testing
fi fi
if [ -d testing/external/bro-testing-private ]; then if [ -d testing/external/zeek-testing-private ]; then
echo "Updating testing/external/commit-hash.bro-testing-private" echo "Updating testing/external/commit-hash.zeek-testing-private"
( cd testing/external/bro-testing-private && git fetch origin && git rev-parse origin/master ) > testing/external/commit-hash.bro-testing-private ( cd testing/external/zeek-testing-private && git fetch origin && git rev-parse origin/master ) > testing/external/commit-hash.zeek-testing-private
git add testing/external/commit-hash.bro-testing-private git add testing/external/commit-hash.zeek-testing-private
fi fi
} }

View file

@ -1,4 +1,10 @@
2.6-18 | 2018-12-06 20:11:01 -0600
* Update external test suite locations (Jon Siwek, Corelight)
* Update submodules to use github.com/zeek (Jon Siwek, Corelight)
2.6-16 | 2018-11-29 17:05:44 -0600 2.6-16 | 2018-11-29 17:05:44 -0600
* Parallelize communication tests using btest TEST-PORT (Jon Siwek, Corelight) * Parallelize communication tests using btest TEST-PORT (Jon Siwek, Corelight)

View file

@ -1 +1 @@
2.6-16 2.6-18

View file

@ -1,4 +1,5 @@
*.git *.git
diag.log diag.log
bro-testing* bro-testing*
zeek-testing*
.proxy .proxy

View file

@ -1,5 +1,5 @@
PUBLIC_REPO=git://git.bro.org/bro-testing PUBLIC_REPO=https://github.com/zeek/zeek-testing
REPOS=`./scripts/find-git-repos ` REPOS=`./scripts/find-git-repos `
DIAG=diag.log DIAG=diag.log

View file

@ -47,7 +47,7 @@ test repository:
.. console: .. console:
> cd bro-testing > cd zeek-testing
> btest > btest
All the standard ``btest`` options can be used to run individual All the standard ``btest`` options can be used to run individual

View file

@ -114,8 +114,7 @@ build_in_docker() {
# Run Bro tests in a docker container. # Run Bro tests in a docker container.
run_in_docker() { run_in_docker() {
prepare_env docker exec -t -e TRAVIS -e TRAVIS_PULL_REQUEST -e TESTING_PRIVATE_DEPLOYKEY brotest sh testing/scripts/travis-job run travis
docker exec -t -e TRAVIS -e TRAVIS_PULL_REQUEST -e trav_key -e trav_iv brotest sh testing/scripts/travis-job run travis
} }
@ -131,39 +130,23 @@ build() {
} }
# Rename the encrypted environment variables to avoid having the hash value
# hard-coded multiple times in this script.
prepare_env() {
if [ -z "$trav_key" ]; then
# This hash value is found by logging into the Travis CI website,
# and looking at the settings in the bro repo (look in the
# "Environment Variables" section).
hash=6a6fe747ff7b
eval "trav_key=\$encrypted_${hash}_key"
eval "trav_iv=\$encrypted_${hash}_iv"
# Export so they are visible in docker containers.
export trav_key
export trav_iv
fi
}
# Get the private tests. # Get the private tests.
get_private_tests() { get_private_tests() {
prepare_env
if [ "${TRAVIS}" != "true" ]; then if [ "${TRAVIS}" != "true" ]; then
# When not running in the Travis environment, just skip trying to get # When not running in the Travis environment, just skip trying to get
# the private tests. # the private tests.
echo "Note: skipping private tests (to run them, do a git clone of the private testing repo in the 'testing/external' directory before running this script)." echo "Note: skipping private tests (to run them, do a git clone of the private testing repo in the 'testing/external' directory before running this script)."
elif [ -n "$trav_key" ] && [ -n "$trav_iv" ]; then elif [ -n "$TESTING_PRIVATE_DEPLOYKEY" ]; then
curl https://www.bro.org/static/travis-ci/travis_key.enc -o travis_key.enc echo "$TESTING_PRIVATE_DEPLOYKEY" > travis_key.b64
openssl aes-256-cbc -K $trav_key -iv $trav_iv -in travis_key.enc -out travis_key -d base64 --decode travis_key.b64 > travis_key
rm travis_key.b64
chmod 600 travis_key chmod 600 travis_key
mkdir -p ~/.ssh mkdir -p ~/.ssh
mv travis_key ~/.ssh/id_rsa mv travis_key ~/.ssh/id_rsa
echo "git.bro.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmlu+EaJfPKTVqoEUzb5JBEdvNiFxO2wm7Vl61dGBl57avakFl8YnRujbA2yxlpC2xnEKD5y++hXxtxRLefyCM=" >> ~/.ssh/known_hosts echo "Host *" >> ~/.ssh/config
git clone ssh://git@git.bro.org/bro-testing-private echo " StrictHostKeyChecking no" >> ~/.ssh/config
chmod 400 ~/.ssh/config
git clone ssh://git@github.com:zeek/zeek-testing-private
rm ~/.ssh/id_rsa rm ~/.ssh/id_rsa
elif [ -n "${TRAVIS_PULL_REQUEST}" ] && [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then elif [ -n "${TRAVIS_PULL_REQUEST}" ] && [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
# For pull request builds, the private key is not available, so skip # For pull request builds, the private key is not available, so skip
@ -196,26 +179,26 @@ run() {
echo echo
cd ../external cd ../external
if [ ! -d bro-testing ]; then if [ ! -d zeek-testing ]; then
make init make init
fi fi
if [ -d bro-testing ]; then if [ -d zeek-testing ]; then
commit=`cat commit-hash.bro-testing` commit=`cat commit-hash.zeek-testing`
echo "Checking out $commit" echo "Checking out $commit"
( cd bro-testing && git checkout -q $commit ) ( cd zeek-testing && git checkout -q $commit )
fi fi
echo echo
if [ ! -d bro-testing-private ]; then if [ ! -d zeek-testing-private ]; then
get_private_tests get_private_tests
fi fi
if [ -d bro-testing-private ]; then if [ -d zeek-testing-private ]; then
commit=`cat commit-hash.bro-testing-private` commit=`cat commit-hash.zeek-testing-private`
echo "Checking out $commit" echo "Checking out $commit"
( cd bro-testing-private && git checkout -q $commit ) ( cd zeek-testing-private && git checkout -q $commit )
fi fi
echo echo
@ -224,8 +207,8 @@ run() {
set +e set +e
if [ -d bro-testing ]; then if [ -d zeek-testing ]; then
cd bro-testing cd zeek-testing
make make
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
@ -236,8 +219,8 @@ run() {
cd .. cd ..
fi fi
if [ -d bro-testing-private ]; then if [ -d zeek-testing-private ]; then
cd bro-testing-private cd zeek-testing-private
make make
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then