diff --git a/src/server.c b/src/server.c index 59497bed..a6d4008e 100644 --- a/src/server.c +++ b/src/server.c @@ -255,7 +255,12 @@ _getdns_cancel_reply(getdns_context *context, connection *conn) { struct mem_funcs *mf; - if (!context || !conn) + if (!conn) + return; + + if (context && context->server && + _getdns_rbtree_search(&context->server->connections_set, conn) + != &conn->super) return; if (conn->l->transport == GETDNS_TRANSPORT_TCP) { @@ -293,13 +298,14 @@ getdns_reply( size_t len; getdns_return_t r; - if (!context || !conn) + if (!conn) return GETDNS_RETURN_INVALID_PARAMETER; - if (!context->server) - return GETDNS_RETURN_GENERIC_ERROR;; + if (!context || !context->server) { + if (!context) + context = conn->l->set->context; - if (_getdns_rbtree_search(&context->server->connections_set, conn) + } else if (_getdns_rbtree_search(&context->server->connections_set, conn) != &conn->super) return GETDNS_RETURN_NO_SUCH_LIST_ITEM; @@ -750,11 +756,16 @@ static void free_listen_set_when_done(listen_set *set) for (i = 0; i < set->count; i++) { listener *l = &set->items[i]; - if (l->fd >= 0) + if (l->fd >= 0) { + DEBUG_SERVER("Listener %d still listening on %d\n", + (int)i, l->fd); return; - - if (l->connections) + } + if (l->connections) { + DEBUG_SERVER("Listener %d still has connections %p\n", + (int)i, (void *)l->connections); return; + } } GETDNS_FREE(*mf, set); DEBUG_SERVER("Listen set: %p freed\n", (void *)set); diff --git a/src/test/tpkg/100-compile.tpkg/100-compile.pre b/src/test/tpkg/100-compile.tpkg/100-compile.pre index ea1cacee..6b76edba 100644 --- a/src/test/tpkg/100-compile.tpkg/100-compile.pre +++ b/src/test/tpkg/100-compile.tpkg/100-compile.pre @@ -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" diff --git a/src/test/tpkg/100-compile.tpkg/100-compile.test b/src/test/tpkg/100-compile.tpkg/100-compile.test index aeb9e084..7ce2f238 100644 --- a/src/test/tpkg/100-compile.tpkg/100-compile.test +++ b/src/test/tpkg/100-compile.tpkg/100-compile.test @@ -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 diff --git a/src/test/tpkg/105-install.tpkg/105-install.test b/src/test/tpkg/105-install.tpkg/105-install.test index 16ccbfd2..bdf883af 100644 --- a/src/test/tpkg/105-install.tpkg/105-install.test +++ b/src/test/tpkg/105-install.tpkg/105-install.test @@ -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 diff --git a/src/test/tpkg/110-link.tpkg/110-link.dsc b/src/test/tpkg/110-link.tpkg/110-link.dsc deleted file mode 100644 index 7c525d9d..00000000 --- a/src/test/tpkg/110-link.tpkg/110-link.dsc +++ /dev/null @@ -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: diff --git a/src/test/tpkg/110-link.tpkg/110-link.test b/src/test/tpkg/110-link.tpkg/110-link.test deleted file mode 100644 index 305132fb..00000000 --- a/src/test/tpkg/110-link.tpkg/110-link.test +++ /dev/null @@ -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 diff --git a/src/test/tpkg/115-install-linked.tpkg/115-install-linked.dsc b/src/test/tpkg/115-install-linked.tpkg/115-install-linked.dsc deleted file mode 100644 index 335e19b2..00000000 --- a/src/test/tpkg/115-install-linked.tpkg/115-install-linked.dsc +++ /dev/null @@ -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: diff --git a/src/test/tpkg/115-install-linked.tpkg/115-install-linked.test b/src/test/tpkg/115-install-linked.tpkg/115-install-linked.test deleted file mode 100644 index 550052b4..00000000 --- a/src/test/tpkg/115-install-linked.tpkg/115-install-linked.test +++ /dev/null @@ -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 diff --git a/src/test/tpkg/120-run-getdns_query.tpkg/120-run-getdns_query.dsc b/src/test/tpkg/120-run-getdns_query.tpkg/120-run-getdns_query.dsc index 55f17b68..3716c307 100644 --- a/src/test/tpkg/120-run-getdns_query.tpkg/120-run-getdns_query.dsc +++ b/src/test/tpkg/120-run-getdns_query.tpkg/120-run-getdns_query.dsc @@ -6,7 +6,7 @@ Maintainer: Willem Toorop Category: Component: CmdDepends: -Depends: 110-link.tpkg +Depends: 105-install.tpkg Help: Pre: Post: diff --git a/src/test/tpkg/125-valgrind-checks.tpkg/125-valgrind-checks.ds b/src/test/tpkg/125-valgrind-checks.tpkg/125-valgrind-checks.ds index 8750f478..47bcd4f0 100644 --- a/src/test/tpkg/125-valgrind-checks.tpkg/125-valgrind-checks.ds +++ b/src/test/tpkg/125-valgrind-checks.tpkg/125-valgrind-checks.ds @@ -1 +1,2 @@ . DS 19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5 +. DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d diff --git a/src/test/tpkg/125-valgrind-checks.tpkg/125-valgrind-checks.dsc b/src/test/tpkg/125-valgrind-checks.tpkg/125-valgrind-checks.dsc index 93163e33..aba888b5 100644 --- a/src/test/tpkg/125-valgrind-checks.tpkg/125-valgrind-checks.dsc +++ b/src/test/tpkg/125-valgrind-checks.tpkg/125-valgrind-checks.dsc @@ -6,7 +6,7 @@ Maintainer: Willem Toorop Category: Component: CmdDepends: valgrind -Depends: 110-link.tpkg +Depends: 105-install.tpkg Help: Pre: Post: diff --git a/src/test/tpkg/130-run-unit-tests.tpkg/130-run-unit-tests.dsc b/src/test/tpkg/130-run-unit-tests.tpkg/130-run-unit-tests.dsc index 86500576..6833e43f 100644 --- a/src/test/tpkg/130-run-unit-tests.tpkg/130-run-unit-tests.dsc +++ b/src/test/tpkg/130-run-unit-tests.tpkg/130-run-unit-tests.dsc @@ -6,7 +6,7 @@ Maintainer: Willem Toorop Category: Component: CmdDepends: -Depends: 110-link.tpkg +Depends: 105-install.tpkg Help: Pre: Post: diff --git a/src/test/tpkg/200-stub-only-compile.tpkg/200-stub-only-compile.dsc b/src/test/tpkg/200-stub-only-compile-install.tpkg/200-stub-only-compile-install.dsc similarity index 56% rename from src/test/tpkg/200-stub-only-compile.tpkg/200-stub-only-compile.dsc rename to src/test/tpkg/200-stub-only-compile-install.tpkg/200-stub-only-compile-install.dsc index 4faf21b2..0888f7ff 100644 --- a/src/test/tpkg/200-stub-only-compile.tpkg/200-stub-only-compile.dsc +++ b/src/test/tpkg/200-stub-only-compile-install.tpkg/200-stub-only-compile-install.dsc @@ -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: diff --git a/src/test/tpkg/200-stub-only-compile.tpkg/200-stub-only-compile.post b/src/test/tpkg/200-stub-only-compile-install.tpkg/200-stub-only-compile-install.post similarity index 100% rename from src/test/tpkg/200-stub-only-compile.tpkg/200-stub-only-compile.post rename to src/test/tpkg/200-stub-only-compile-install.tpkg/200-stub-only-compile-install.post diff --git a/src/test/tpkg/200-stub-only-compile.tpkg/200-stub-only-compile.pre b/src/test/tpkg/200-stub-only-compile-install.tpkg/200-stub-only-compile-install.pre similarity index 92% rename from src/test/tpkg/200-stub-only-compile.tpkg/200-stub-only-compile.pre rename to src/test/tpkg/200-stub-only-compile-install.tpkg/200-stub-only-compile-install.pre index 39b234eb..587b4fed 100644 --- a/src/test/tpkg/200-stub-only-compile.tpkg/200-stub-only-compile.pre +++ b/src/test/tpkg/200-stub-only-compile-install.tpkg/200-stub-only-compile-install.pre @@ -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 diff --git a/src/test/tpkg/200-stub-only-compile.tpkg/200-stub-only-compile.test b/src/test/tpkg/200-stub-only-compile-install.tpkg/200-stub-only-compile-install.test similarity index 61% rename from src/test/tpkg/200-stub-only-compile.tpkg/200-stub-only-compile.test rename to src/test/tpkg/200-stub-only-compile-install.tpkg/200-stub-only-compile-install.test index 4b983110..53b8d656 100644 --- a/src/test/tpkg/200-stub-only-compile.tpkg/200-stub-only-compile.test +++ b/src/test/tpkg/200-stub-only-compile-install.tpkg/200-stub-only-compile-install.test @@ -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 diff --git a/src/test/tpkg/210-stub-only-link.tpkg/210-stub-only-link.dsc b/src/test/tpkg/210-stub-only-link.tpkg/210-stub-only-link.dsc deleted file mode 100644 index 4ad88d78..00000000 --- a/src/test/tpkg/210-stub-only-link.tpkg/210-stub-only-link.dsc +++ /dev/null @@ -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: diff --git a/src/test/tpkg/210-stub-only-link.tpkg/210-stub-only-link.test b/src/test/tpkg/210-stub-only-link.tpkg/210-stub-only-link.test deleted file mode 100644 index 23e786cb..00000000 --- a/src/test/tpkg/210-stub-only-link.tpkg/210-stub-only-link.test +++ /dev/null @@ -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 diff --git a/src/test/tpkg/220-stub-only-run-getdns_query.tpkg/220-stub-only-run-getdns_query.dsc b/src/test/tpkg/220-stub-only-run-getdns_query.tpkg/220-stub-only-run-getdns_query.dsc index 88f24543..8b5ac7c4 100644 --- a/src/test/tpkg/220-stub-only-run-getdns_query.tpkg/220-stub-only-run-getdns_query.dsc +++ b/src/test/tpkg/220-stub-only-run-getdns_query.tpkg/220-stub-only-run-getdns_query.dsc @@ -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: diff --git a/src/test/tpkg/225-stub-only-valgrind-checks.tpkg/225-stub-only-valgrind-checks.ds b/src/test/tpkg/225-stub-only-valgrind-checks.tpkg/225-stub-only-valgrind-checks.ds deleted file mode 100644 index 8750f478..00000000 --- a/src/test/tpkg/225-stub-only-valgrind-checks.tpkg/225-stub-only-valgrind-checks.ds +++ /dev/null @@ -1 +0,0 @@ -. DS 19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5 diff --git a/src/test/tpkg/225-stub-only-valgrind-checks.tpkg/225-stub-only-valgrind-checks.dsc b/src/test/tpkg/225-stub-only-valgrind-checks.tpkg/225-stub-only-valgrind-checks.dsc index 7167a541..42f20a57 100644 --- a/src/test/tpkg/225-stub-only-valgrind-checks.tpkg/225-stub-only-valgrind-checks.dsc +++ b/src/test/tpkg/225-stub-only-valgrind-checks.tpkg/225-stub-only-valgrind-checks.dsc @@ -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: diff --git a/src/test/tpkg/230-stub-only-run-unit-tests.tpkg/230-stub-only-run-unit-tests.dsc b/src/test/tpkg/230-stub-only-run-unit-tests.tpkg/230-stub-only-run-unit-tests.dsc index 0a683e77..3ea00b19 100644 --- a/src/test/tpkg/230-stub-only-run-unit-tests.tpkg/230-stub-only-run-unit-tests.dsc +++ b/src/test/tpkg/230-stub-only-run-unit-tests.tpkg/230-stub-only-run-unit-tests.dsc @@ -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: diff --git a/src/test/tpkg/250-json-pointers.tpkg/250-json-pointers.dsc b/src/test/tpkg/250-json-pointers.tpkg/250-json-pointers.dsc index 683876b9..db195ce3 100644 --- a/src/test/tpkg/250-json-pointers.tpkg/250-json-pointers.dsc +++ b/src/test/tpkg/250-json-pointers.tpkg/250-json-pointers.dsc @@ -6,7 +6,7 @@ Maintainer: Willem Toorop Category: Component: CmdDepends: -Depends: 200-stub-only-compile.tpkg +Depends: 200-stub-only-compile-install.tpkg Help: Pre: 250-json-pointers.pre Post: diff --git a/src/test/tpkg/255-yaml-config.tpkg/255-yaml-config.dsc b/src/test/tpkg/255-yaml-config.tpkg/255-yaml-config.dsc index e00f4468..906681b2 100644 --- a/src/test/tpkg/255-yaml-config.tpkg/255-yaml-config.dsc +++ b/src/test/tpkg/255-yaml-config.tpkg/255-yaml-config.dsc @@ -6,7 +6,7 @@ Maintainer: Jim Hague Category: Component: CmdDepends: -Depends: 200-stub-only-compile.tpkg +Depends: 200-stub-only-compile-install.tpkg Help: Pre: 255-yaml-config.pre Post: diff --git a/src/test/tpkg/260-conversion-functions.tpkg/260-conversion-functions.dsc b/src/test/tpkg/260-conversion-functions.tpkg/260-conversion-functions.dsc index eb96d979..a3534843 100644 --- a/src/test/tpkg/260-conversion-functions.tpkg/260-conversion-functions.dsc +++ b/src/test/tpkg/260-conversion-functions.tpkg/260-conversion-functions.dsc @@ -6,7 +6,7 @@ Maintainer: Willem Toorop Category: Component: CmdDepends: -Depends: 200-stub-only-compile.tpkg +Depends: 200-stub-only-compile-install.tpkg Help: 260-conversion-functions.help Pre: 260-conversion-functions.pre Post: diff --git a/src/test/tpkg/265-supported-rrs.tpkg/265-supported-rrs.dsc b/src/test/tpkg/265-supported-rrs.tpkg/265-supported-rrs.dsc index ea49490e..21f66210 100644 --- a/src/test/tpkg/265-supported-rrs.tpkg/265-supported-rrs.dsc +++ b/src/test/tpkg/265-supported-rrs.tpkg/265-supported-rrs.dsc @@ -6,7 +6,7 @@ Maintainer: Hoda Rohani Category: Component: CmdDepends: -Depends: 200-stub-only-compile.tpkg +Depends: 200-stub-only-compile-install.tpkg Help: Pre: 265-supported-rrs.pre Post: diff --git a/src/test/tpkg/270-header-extension.tpkg/270-header-extension.dsc b/src/test/tpkg/270-header-extension.tpkg/270-header-extension.dsc index f083f1b2..a371179b 100644 --- a/src/test/tpkg/270-header-extension.tpkg/270-header-extension.dsc +++ b/src/test/tpkg/270-header-extension.tpkg/270-header-extension.dsc @@ -6,7 +6,7 @@ Maintainer: Willem Toorop Category: Component: CmdDepends: -Depends: 200-stub-only-compile.tpkg +Depends: 200-stub-only-compile-install.tpkg Help: Pre: 270-header-extension.pre Post: diff --git a/src/test/tpkg/275-server-capabilities.tpkg/275-server-capabilities.dsc b/src/test/tpkg/275-server-capabilities.tpkg/275-server-capabilities.dsc index 5ab8c095..a5665693 100644 --- a/src/test/tpkg/275-server-capabilities.tpkg/275-server-capabilities.dsc +++ b/src/test/tpkg/275-server-capabilities.tpkg/275-server-capabilities.dsc @@ -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: diff --git a/src/test/tpkg/275-server-capabilities.tpkg/275-server-capabilities.test b/src/test/tpkg/275-server-capabilities.tpkg/275-server-capabilities.test index 2b144cf7..3569346b 100644 --- a/src/test/tpkg/275-server-capabilities.tpkg/275-server-capabilities.test +++ b/src/test/tpkg/275-server-capabilities.tpkg/275-server-capabilities.test @@ -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 diff --git a/src/test/tpkg/280-limit_outstanding_queries.tpkg/280-limit_outstanding_queries.dsc b/src/test/tpkg/280-limit_outstanding_queries.tpkg/280-limit_outstanding_queries.dsc index d03124b9..881977b7 100644 --- a/src/test/tpkg/280-limit_outstanding_queries.tpkg/280-limit_outstanding_queries.dsc +++ b/src/test/tpkg/280-limit_outstanding_queries.tpkg/280-limit_outstanding_queries.dsc @@ -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: diff --git a/src/test/tpkg/280-limit_outstanding_queries.tpkg/280-limit_outstanding_queries.test b/src/test/tpkg/280-limit_outstanding_queries.tpkg/280-limit_outstanding_queries.test index e22456c3..f8d5d556 100644 --- a/src/test/tpkg/280-limit_outstanding_queries.tpkg/280-limit_outstanding_queries.test +++ b/src/test/tpkg/280-limit_outstanding_queries.tpkg/280-limit_outstanding_queries.test @@ -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 +) diff --git a/src/test/tpkg/285-out_of_filedescriptors.tpkg/285-out_of_filedescriptors.dsc b/src/test/tpkg/285-out_of_filedescriptors.tpkg/285-out_of_filedescriptors.dsc index c76c3bbb..b7322cc7 100644 --- a/src/test/tpkg/285-out_of_filedescriptors.tpkg/285-out_of_filedescriptors.dsc +++ b/src/test/tpkg/285-out_of_filedescriptors.tpkg/285-out_of_filedescriptors.dsc @@ -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: diff --git a/src/test/tpkg/285-out_of_filedescriptors.tpkg/285-out_of_filedescriptors.test b/src/test/tpkg/285-out_of_filedescriptors.tpkg/285-out_of_filedescriptors.test index 6eeb53d1..f6a832e4 100644 --- a/src/test/tpkg/285-out_of_filedescriptors.tpkg/285-out_of_filedescriptors.test +++ b/src/test/tpkg/285-out_of_filedescriptors.tpkg/285-out_of_filedescriptors.test @@ -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 +) diff --git a/src/test/tpkg/290-transports.tpkg/290-transports.dsc b/src/test/tpkg/290-transports.tpkg/290-transports.dsc index acc5f398..c7a289f1 100644 --- a/src/test/tpkg/290-transports.tpkg/290-transports.dsc +++ b/src/test/tpkg/290-transports.tpkg/290-transports.dsc @@ -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: diff --git a/src/test/tpkg/320-event-loops-compile.tpkg/320-event-loops-compile.test b/src/test/tpkg/320-event-loops-compile.tpkg/320-event-loops-compile.test index b4d20345..45176f77 100644 --- a/src/test/tpkg/320-event-loops-compile.tpkg/320-event-loops-compile.test +++ b/src/test/tpkg/320-event-loops-compile.tpkg/320-event-loops-compile.test @@ -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