From 9eaa6332084badc63db023d6d1a8ffc1a1001d31 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 8 Sep 2023 16:19:41 +0200 Subject: [PATCH] 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. --- pdns/dnsdistdist/test-dnsdistnghttp2-in_cc.cc | 4 ++++ 1 file changed, 4 insertions(+) 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}}; -- 2.47.2