From: Remi Gacogne Date: Fri, 8 Sep 2023 14:19:41 +0000 (+0200) Subject: dnsdist: Fix unit tests for incoming DoH w/ nghttp2 X-Git-Tag: rec-5.0.0-alpha1~10^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F13227%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Fix unit tests for incoming DoH w/ nghttp2 These tests were failing on EL with LTO enabled, and passing everywhere else. It turns out that we did not properly reset the `s_processQuery` hack that we used in these tests to simulate the policy decision (rules and actions), and thus inherited what the last test set it to instead of the default (dropping queries), which was very unexpected. --- diff --git a/pdns/dnsdistdist/test-dnsdistnghttp2-in_cc.cc b/pdns/dnsdistdist/test-dnsdistnghttp2-in_cc.cc index b02b86d67e..2c98427c06 100644 --- a/pdns/dnsdistdist/test-dnsdistnghttp2-in_cc.cc +++ b/pdns/dnsdistdist/test-dnsdistnghttp2-in_cc.cc @@ -500,6 +500,10 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_SelfAnswered, TestFixture) pwR.xfr32BitInt(0x01020304); pwR.commit(); + /* we _NEED_ to set this function to empty otherwise we might get what was set + by the last test, and we might not like it at all */ + s_processQuery = nullptr; + { /* dnsdist drops the query right away after receiving it, client closes the connection */ s_connectionContexts[counter++] = ExpectedData{{}, {query}, {response}, {403U}};