mirror of https://github.com/getdnsapi/getdns.git
Unit test maintenance, to:
- remove obsolete tests - test better for parallel installs - run custom servers through valgrind
This commit is contained in:
parent
21155d5aa9
commit
65e610f26e
|
@ -25,4 +25,4 @@ done
|
|||
rm -fr "${BUILDDIR}/build"
|
||||
mkdir "${BUILDDIR}/build"
|
||||
cd "${BUILDDIR}/build"
|
||||
"${SRCROOT}/configure" $* --prefix "${BUILDDIR}/install" --enable-debug-anchor
|
||||
"${SRCROOT}/configure" $* --prefix "${BUILDDIR}/install"
|
||||
|
|
|
@ -5,4 +5,4 @@
|
|||
[ -f .tpkg.var.test ] && source .tpkg.var.test
|
||||
|
||||
cd "${BUILDDIR}/build"
|
||||
make XTRA_CFLAGS='-Werror' -j 4
|
||||
make XTRA_CFLAGS='-g -Werror' -j 4
|
||||
|
|
|
@ -5,4 +5,6 @@
|
|||
[ -f .tpkg.var.test ] && source .tpkg.var.test
|
||||
|
||||
cd "${BUILDDIR}/build"
|
||||
make -j 4 install
|
||||
make -j 4 install \
|
||||
&& echo "export GETDNS_QUERY=\"${BUILDDIR}/build/src/tools/getdns_query\"" \
|
||||
>> ../.tpkg.var.master
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
BaseName: 110-link
|
||||
Version: 1.0
|
||||
Description: Link getdns_query program
|
||||
CreationDate: do dec 10 11:10:11 CET 2015
|
||||
Maintainer: Willem Toorop
|
||||
Category:
|
||||
Component:
|
||||
CmdDepends:
|
||||
Depends: 100-compile.tpkg
|
||||
Help:
|
||||
Pre:
|
||||
Post:
|
||||
Test: 110-link.test
|
||||
AuxFiles:
|
||||
Passed:
|
||||
Failure:
|
|
@ -1,10 +0,0 @@
|
|||
# #-- 110-link.test --#
|
||||
# source the master var file when it's there
|
||||
[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
|
||||
# use .tpkg.var.test for in test variable passing
|
||||
[ -f .tpkg.var.test ] && source .tpkg.var.test
|
||||
|
||||
cd "${BUILDDIR}/build"
|
||||
make -j 4 getdns_query \
|
||||
&& echo "export GETDNS_QUERY=\"${BUILDDIR}/build/src/tools/getdns_query\"" \
|
||||
>> ../.tpkg.var.master
|
|
@ -1,16 +0,0 @@
|
|||
BaseName: 115-install-linked
|
||||
Version: 1.0
|
||||
Description: Install the getdns_query program
|
||||
CreationDate: vr dec 18 10:52:26 CET 2015
|
||||
Maintainer: Willem Toorop
|
||||
Category:
|
||||
Component:
|
||||
CmdDepends:
|
||||
Depends: 110-link.tpkg
|
||||
Help:
|
||||
Pre:
|
||||
Post:
|
||||
Test: 115-install-linked.test
|
||||
AuxFiles:
|
||||
Passed:
|
||||
Failure:
|
|
@ -1,8 +0,0 @@
|
|||
# #-- 115-install-linked.test --#
|
||||
# source the master var file when it's there
|
||||
[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
|
||||
# use .tpkg.var.test for in test variable passing
|
||||
[ -f .tpkg.var.test ] && source .tpkg.var.test
|
||||
|
||||
cd "${BUILDDIR}/build"
|
||||
make -j 4 install-getdns_query
|
|
@ -6,7 +6,7 @@ Maintainer: Willem Toorop
|
|||
Category:
|
||||
Component:
|
||||
CmdDepends:
|
||||
Depends: 110-link.tpkg
|
||||
Depends: 105-install.tpkg
|
||||
Help:
|
||||
Pre:
|
||||
Post:
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
. DS 19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5
|
||||
. DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d
|
||||
|
|
|
@ -6,7 +6,7 @@ Maintainer: Willem Toorop
|
|||
Category:
|
||||
Component:
|
||||
CmdDepends: valgrind
|
||||
Depends: 110-link.tpkg
|
||||
Depends: 105-install.tpkg
|
||||
Help:
|
||||
Pre:
|
||||
Post:
|
||||
|
|
|
@ -6,7 +6,7 @@ Maintainer: Willem Toorop
|
|||
Category:
|
||||
Component:
|
||||
CmdDepends:
|
||||
Depends: 110-link.tpkg
|
||||
Depends: 105-install.tpkg
|
||||
Help:
|
||||
Pre:
|
||||
Post:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
BaseName: 200-stub-only-compile
|
||||
BaseName: 200-stub-only-compile-install
|
||||
Version: 1.0
|
||||
Description: Create builddir and compile stub only
|
||||
CreationDate: do dec 10 11:08:24 CET 2015
|
||||
|
@ -8,9 +8,9 @@ Component:
|
|||
CmdDepends:
|
||||
Depends:
|
||||
Help:
|
||||
Pre: 200-stub-only-compile.pre
|
||||
Post: 200-stub-only-compile.post
|
||||
Test: 200-stub-only-compile.test
|
||||
Pre: 200-stub-only-compile-install.pre
|
||||
Post: 200-stub-only-compile-install.post
|
||||
Test: 200-stub-only-compile-install.test
|
||||
AuxFiles:
|
||||
Passed:
|
||||
Failure:
|
|
@ -25,4 +25,4 @@ done
|
|||
rm -fr "${BUILDDIR}/build-stub-only"
|
||||
mkdir "${BUILDDIR}/build-stub-only"
|
||||
cd "${BUILDDIR}/build-stub-only"
|
||||
"${SRCROOT}/configure" $* --prefix "${BUILDDIR}/install-stub-only" --enable-stub-only
|
||||
"${SRCROOT}/configure" $* --prefix "${BUILDDIR}/install-stub-only" --enable-stub-only --enable-debug-server --enable-debug-anchor
|
|
@ -5,4 +5,6 @@
|
|||
[ -f .tpkg.var.test ] && source .tpkg.var.test
|
||||
|
||||
cd "${BUILDDIR}/build-stub-only"
|
||||
make XTRA_CFLAGS='-Werror' -j 4
|
||||
make XTRA_CFLAGS='-g -Werror' -j 4 install \
|
||||
&& echo "export GETDNS_STUB_QUERY=\"${BUILDDIR}/build-stub-only/src/tools/getdns_query\"" \
|
||||
>> ../.tpkg.var.master
|
|
@ -1,16 +0,0 @@
|
|||
BaseName: 210-stub-only-link
|
||||
Version: 1.0
|
||||
Description: Link getdns_query program
|
||||
CreationDate: do dec 10 11:08:37 CET 2015
|
||||
Maintainer: Willem Toorop
|
||||
Category:
|
||||
Component:
|
||||
CmdDepends:
|
||||
Depends: 200-stub-only-compile.tpkg
|
||||
Help:
|
||||
Pre:
|
||||
Post:
|
||||
Test: 210-stub-only-link.test
|
||||
AuxFiles:
|
||||
Passed:
|
||||
Failure:
|
|
@ -1,10 +0,0 @@
|
|||
# #-- 210-stub-only-link.test --#
|
||||
# source the master var file when it's there
|
||||
[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
|
||||
# use .tpkg.var.test for in test variable passing
|
||||
[ -f .tpkg.var.test ] && source .tpkg.var.test
|
||||
|
||||
cd "${BUILDDIR}/build-stub-only"
|
||||
make -j 4 getdns_query \
|
||||
&& echo "export GETDNS_STUB_QUERY=\"${BUILDDIR}/build-stub-only/src/tools/getdns_query\"" \
|
||||
>> ../.tpkg.var.master
|
|
@ -6,7 +6,7 @@ Maintainer: Willem Toorop
|
|||
Category:
|
||||
Component:
|
||||
CmdDepends:
|
||||
Depends: 210-stub-only-link.tpkg
|
||||
Depends: 200-stub-only-compile-install.tpkg
|
||||
Help:
|
||||
Pre:
|
||||
Post:
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
. DS 19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5
|
|
@ -1,12 +1,12 @@
|
|||
BaseName: 225-stub-only-valgrind-checks
|
||||
Version: 1.0
|
||||
Description: Run valgrind to detect memory leaks
|
||||
Description: Run getdns_query in valgrind + Zero configuration DNSSEC test
|
||||
CreationDate: ma mrt 21 16:24:56 CET 2016
|
||||
Maintainer: Willem Toorop
|
||||
Category:
|
||||
Component:
|
||||
CmdDepends: valgrind
|
||||
Depends: 210-stub-only-link.tpkg
|
||||
Depends: 200-stub-only-compile-install.tpkg
|
||||
Help:
|
||||
Pre:
|
||||
Post:
|
||||
|
|
|
@ -6,7 +6,7 @@ Maintainer: Willem Toorop
|
|||
Category:
|
||||
Component:
|
||||
CmdDepends:
|
||||
Depends: 210-stub-only-link.tpkg
|
||||
Depends: 200-stub-only-compile-install.tpkg
|
||||
Help:
|
||||
Pre:
|
||||
Post:
|
||||
|
|
|
@ -6,7 +6,7 @@ Maintainer: Hoda Rohani
|
|||
Category:
|
||||
Component:
|
||||
CmdDepends:
|
||||
Depends: 210-stub-only-link.tpkg
|
||||
Depends: 200-stub-only-compile-install.tpkg
|
||||
Help:
|
||||
Pre: 275-server-capabilities.pre
|
||||
Post:
|
||||
|
|
|
@ -21,10 +21,14 @@ make && "${BUILDDIR}/build-stub-only/libtool" exec valgrind -v --log-file=valgri
|
|||
|
||||
${GETDNS_STUB_QUERY} -s -q @${LOCALHOST}:$PORT TXT quit.
|
||||
)
|
||||
if grep -q 'definitely lost: [^0]' valgrind.log
|
||||
if ! awk '/^==.*(definitely|indirectly|possibly) lost/{print;if($4>0)exit(1)}' valgrind.log
|
||||
then
|
||||
cat valgrind.log
|
||||
exit 1
|
||||
fi
|
||||
if ! awk '/^==.* ERROR SUMMARY/{print;if($4>0)exit(1)}' valgrind.log
|
||||
then
|
||||
cat valgrind.log
|
||||
echo "error: Memory loss!"
|
||||
exit 1
|
||||
fi
|
||||
if ! grep -q '"status": GETDNS_RESPSTATUS_ALL_TIMEOUT' time_out
|
||||
|
|
|
@ -6,7 +6,7 @@ Maintainer: Willem Toorop
|
|||
Category: Resource depletion
|
||||
Component:
|
||||
CmdDepends:
|
||||
Depends: 210-stub-only-link.tpkg
|
||||
Depends: 200-stub-only-compile-install.tpkg
|
||||
Help:
|
||||
Pre: 280-limit_outstanding_queries.pre
|
||||
Post:
|
||||
|
|
|
@ -19,13 +19,13 @@ echo "# queries: $NQUERIES"
|
|||
# which is smaller than 5 seconds default query timeout value,
|
||||
# so the test should succeed.
|
||||
|
||||
make && "./${TPKG_NAME}" ${LOCALHOST} | (
|
||||
make && "${BUILDDIR}/build-stub-only/libtool" exec valgrind -v --log-file=valgrind.log --leak-check=full --error-exitcode=1 --track-origins=yes "./${TPKG_NAME}" ${LOCALHOST} | (
|
||||
read PORT
|
||||
${GETDNS_STUB_QUERY} @${LOCALHOST}:$PORT TXT \
|
||||
${GETDNS_STUB_QUERY} -s @${LOCALHOST}:$PORT TXT \
|
||||
-a -F "./${TPKG_NAME}.queries" \
|
||||
"{limit_outstanding_queries:$QLIMIT}" 2>&1 > out
|
||||
|
||||
${GETDNS_STUB_QUERY} -q @${LOCALHOST}:$PORT TXT quit.
|
||||
${GETDNS_STUB_QUERY} -s -q @${LOCALHOST}:$PORT TXT quit.
|
||||
) && grep '"n_requests: [0-9][0-9]*"' out | sed -e 's/^.*n_requests: //g' -e 's/".*$//g' \
|
||||
| awk -vQLIMIT=$QLIMIT -vNQUERIES=$NQUERIES '
|
||||
|
||||
|
@ -43,4 +43,15 @@ END{
|
|||
exit(-1);
|
||||
} else
|
||||
print "SUCCESS: No more than "QLIMIT" outstanding queries: "max_outstanding;
|
||||
}'
|
||||
}' && (
|
||||
if ! awk '/^==.*(definitely|indirectly|possibly) lost/{print;if($4>0)exit(1)}' valgrind.log
|
||||
then
|
||||
cat valgrind.log
|
||||
exit 1
|
||||
fi
|
||||
if ! awk '/^==.* ERROR SUMMARY/{print;if($4>0)exit(1)}' valgrind.log
|
||||
then
|
||||
cat valgrind.log
|
||||
exit 1
|
||||
fi
|
||||
)
|
||||
|
|
|
@ -6,7 +6,7 @@ Maintainer: Willem Toorop
|
|||
Category: Resource depletion
|
||||
Component:
|
||||
CmdDepends:
|
||||
Depends: 210-stub-only-link.tpkg
|
||||
Depends: 200-stub-only-compile-install.tpkg
|
||||
Help:
|
||||
Pre: 285-out_of_filedescriptors.pre
|
||||
Post:
|
||||
|
|
|
@ -27,13 +27,13 @@ echo "# queries: $NQUERIES"
|
|||
# which is smaller than 5 seconds default query timeout value,
|
||||
# so the test should succeed.
|
||||
|
||||
make && "./${TPKG_NAME}" ${LOCALHOST}| (
|
||||
make && "${BUILDDIR}/build-stub-only/libtool" exec valgrind -v --log-file=valgrind.log --leak-check=full --error-exitcode=1 --track-origins=yes "./${TPKG_NAME}" ${LOCALHOST}| (
|
||||
read PORT
|
||||
ulimit -n $QLIMIT
|
||||
${GETDNS_STUB_QUERY} @${LOCALHOST}:$PORT TXT \
|
||||
${GETDNS_STUB_QUERY} -s @${LOCALHOST}:$PORT TXT \
|
||||
-a -F "./${TPKG_NAME}.queries" 2>&1 > out
|
||||
|
||||
${GETDNS_STUB_QUERY} -q @${LOCALHOST}:$PORT TXT quit.
|
||||
${GETDNS_STUB_QUERY} -s -q @${LOCALHOST}:$PORT TXT quit.
|
||||
) && grep '"n_requests: [0-9][0-9]*"' out | sed -e 's/^.*n_requests: //g' -e 's/".*$//g' \
|
||||
| awk -vQLIMIT=$QLIMIT -vNQUERIES=$NQUERIES '
|
||||
|
||||
|
@ -51,4 +51,15 @@ END{
|
|||
exit(-1);
|
||||
} else
|
||||
print "SUCCESS: No more than "QLIMIT" outstanding queries: "max_outstanding;
|
||||
}'
|
||||
}' && (
|
||||
if ! awk '/^==.*(definitely|indirectly|possibly) lost/{print;if($4>0)exit(1)}' valgrind.log
|
||||
then
|
||||
cat valgrind.log
|
||||
exit 1
|
||||
fi
|
||||
if ! awk '/^==.* ERROR SUMMARY/{print;if($4>0)exit(1)}' valgrind.log
|
||||
then
|
||||
cat valgrind.log
|
||||
exit 1
|
||||
fi
|
||||
)
|
||||
|
|
|
@ -6,7 +6,7 @@ Maintainer: Hoda Rohani
|
|||
Category:
|
||||
Component:
|
||||
CmdDepends:
|
||||
Depends: 210-stub-only-link.tpkg
|
||||
Depends: 200-stub-only-compile-install.tpkg
|
||||
Help:
|
||||
Pre:
|
||||
Post:
|
||||
|
|
|
@ -5,4 +5,4 @@
|
|||
[ -f .tpkg.var.test ] && source .tpkg.var.test
|
||||
|
||||
cd "${BUILDDIR}/build-event-loops"
|
||||
make XTRA_CFLAGS=-Werror -j 4
|
||||
make XTRA_CFLAGS="-g -Werror" -j 4 install
|
||||
|
|
Loading…
Reference in New Issue