From 4a7f4b1a439438a6903e0c524616ffc25ddf9be2 Mon Sep 17 00:00:00 2001 From: Mike Beaumont Date: Tue, 9 Jul 2024 21:10:35 +0200 Subject: [PATCH] test: fix expectations with ID zero Signed-off-by: Mike Beaumont --- .../extensions/filters/udp/dns_filter/dns_filter_test.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/extensions/filters/udp/dns_filter/dns_filter_test.cc b/test/extensions/filters/udp/dns_filter/dns_filter_test.cc index cd2adfa09bf4..5af78ddd4b77 100644 --- a/test/extensions/filters/udp/dns_filter/dns_filter_test.cc +++ b/test/extensions/filters/udp/dns_filter/dns_filter_test.cc @@ -1863,12 +1863,11 @@ TEST_F(DnsFilterTest, NotImplementedQueryTest) { EXPECT_EQ(0, config_->stats().downstream_rx_invalid_queries_.value()); } -TEST_F(DnsFilterTest, NoTransactionIdTest) { +TEST_F(DnsFilterTest, ZeroTransactionIdTest) { InSequence s; setup(forward_query_off_config); - // This buffer has an invalid Transaction ID. We should return an error - // to the client + // This buffer has a Transaction ID of zero. This is not an error. constexpr char dns_request[] = { 0x00, 0x00, // Transaction ID 0x01, 0x20, // Flags @@ -1888,8 +1887,8 @@ TEST_F(DnsFilterTest, NoTransactionIdTest) { sendQueryFromClient("10.0.0.1:1000", query); response_ctx_ = ResponseValidator::createResponseContext(udp_response_, counters_); - EXPECT_FALSE(response_ctx_->parse_status_); - EXPECT_EQ(DNS_RESPONSE_CODE_FORMAT_ERROR, response_ctx_->getQueryResponseCode()); + EXPECT_TRUE(response_ctx_->parse_status_); + EXPECT_EQ(DNS_RESPONSE_CODE_NOT_IMPLEMENTED, response_ctx_->getQueryResponseCode()); } TEST_F(DnsFilterTest, InvalidShortBufferTest) {