diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 15:26:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 15:26:00 +0000 |
commit | 830407e88f9d40d954356c3754f2647f91d5c06a (patch) | |
tree | d6a0ece6feea91f3c656166dbaa884ef8a29740e /tests/dnstap/src/dnstap-test/run.sh | |
parent | Initial commit. (diff) | |
download | knot-resolver-830407e88f9d40d954356c3754f2647f91d5c06a.tar.xz knot-resolver-830407e88f9d40d954356c3754f2647f91d5c06a.zip |
Adding upstream version 5.6.0.upstream/5.6.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dnstap/src/dnstap-test/run.sh')
-rwxr-xr-x | tests/dnstap/src/dnstap-test/run.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/dnstap/src/dnstap-test/run.sh b/tests/dnstap/src/dnstap-test/run.sh new file mode 100755 index 0000000..2f32ea1 --- /dev/null +++ b/tests/dnstap/src/dnstap-test/run.sh @@ -0,0 +1,31 @@ +#!/bin/bash +set -e +KRESD_CMD=$1 +MESON_BUILD_ROOT=$(pwd) +mkdir -p tests/dnstap +export GOPATH=$MESON_BUILD_ROOT/tests/dnstap +cd "$(dirname $0)" +DNSTAP_TEST=dnstap-test + +if [ -z "$GITLAB_CI" ]; then + type -P go >/dev/null || exit 77 + echo "Building the dnstap test and its dependencies..." + # some packages may be missing on the system right now + go get github.com/{FiloSottile/gvt,cloudflare/dns,dnstap/golang-dnstap,golang/protobuf/proto} +else + # In CI we've prebuilt dependencies into the default GOPATH. + # We're in a scratch container, so we just add the dnstap test inside. + export GOPATH=/root/go +fi +DTAP=$GOPATH/src/$DNSTAP_TEST +rm -f $DTAP && ln -s $(realpath ..)/$DNSTAP_TEST $DTAP +go install $DNSTAP_TEST + + +CONFIG=$(realpath ./config) +ZONES="fake1.localdomain,fake2.localdomain,fake3.localdomain" +TIMEOUT=60s +GRACE=5s +cd $MESON_BUILD_ROOT/tests/dnstap # don't leave stuff like *.mdb in ./. +$GOPATH/bin/$DNSTAP_TEST -c $CONFIG -cmd $KRESD_CMD -q $ZONES -t $TIMEOUT -g $GRACE -d + |