]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix unit tests for incoming DoH w/ nghttp2 13227/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 8 Sep 2023 14:19:41 +0000 (16:19 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 8 Sep 2023 14:19:41 +0000 (16:19 +0200)
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

index b02b86d67ecc6143de2a676cc8d38ec16cda67d0..2c98427c06932f32f2fa42e45e779fae687d25bf 100644 (file)
@@ -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}};