BIND 10 trac1357, updated. 7028610344ad69d3e5da57575da3e2e85b257d0e [1357] Fix TCP-TSIG test

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Sep 7 08:54:31 UTC 2012


The branch, trac1357 has been updated
       via  7028610344ad69d3e5da57575da3e2e85b257d0e (commit)
      from  6f8add1167cb4781cc2f84d8c65ee5db73846ab8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7028610344ad69d3e5da57575da3e2e85b257d0e
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Fri Sep 7 10:53:14 2012 +0200

    [1357] Fix TCP-TSIG test
    
    The TSIGContext acts strange in case of sending multiple queries. So use
    a more real-life scenario, sending multiple answers.

-----------------------------------------------------------------------

Summary of changes:
 src/lib/dns/tests/tsig_unittest.cc |   20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/dns/tests/tsig_unittest.cc b/src/lib/dns/tests/tsig_unittest.cc
index 5361764..7813626 100644
--- a/src/lib/dns/tests/tsig_unittest.cc
+++ b/src/lib/dns/tests/tsig_unittest.cc
@@ -1044,6 +1044,18 @@ TEST_F(TSIGTest, getTSIGLength) {
 TEST_F(TSIGTest, verifyMulti) {
     isc::util::detail::gettimeFunction = testGetTime<0x4da8877a>;
 
+    // First, send query from the verify one to the normal one, so
+    // we initialize something like AXFR
+    {
+        SCOPED_TRACE("Query");
+        ConstTSIGRecordPtr tsig = createMessageAndSign(1234, test_name,
+                                                       tsig_verify_ctx.get());
+        commonVerifyChecks(*tsig_ctx, tsig.get(),
+                           renderer.getData(), renderer.getLength(),
+                           TSIGError(Rcode::NOERROR()),
+                           TSIGContext::RECEIVED_REQUEST);
+    }
+
     {
         SCOPED_TRACE("First message");
         ConstTSIGRecordPtr tsig = createMessageAndSign(1234, test_name,
@@ -1051,7 +1063,7 @@ TEST_F(TSIGTest, verifyMulti) {
         commonVerifyChecks(*tsig_verify_ctx, tsig.get(),
                            renderer.getData(), renderer.getLength(),
                            TSIGError(Rcode::NOERROR()),
-                           TSIGContext::RECEIVED_REQUEST);
+                           TSIGContext::VERIFIED_RESPONSE);
         EXPECT_TRUE(tsig_verify_ctx->lastHadSignature());
     }
 
@@ -1062,7 +1074,7 @@ TEST_F(TSIGTest, verifyMulti) {
         commonVerifyChecks(*tsig_verify_ctx, tsig.get(),
                            renderer.getData(), renderer.getLength(),
                            TSIGError(Rcode::NOERROR()),
-                           TSIGContext::RECEIVED_REQUEST);
+                           TSIGContext::VERIFIED_RESPONSE);
         EXPECT_TRUE(tsig_verify_ctx->lastHadSignature());
     }
 
@@ -1087,7 +1099,7 @@ TEST_F(TSIGTest, verifyMulti) {
         commonVerifyChecks(*tsig_verify_ctx, NULL,
                            renderer.getData(), renderer.getLength(),
                            TSIGError(Rcode::NOERROR()),
-                           TSIGContext::RECEIVED_REQUEST);
+                           TSIGContext::VERIFIED_RESPONSE);
 
         EXPECT_FALSE(tsig_verify_ctx->lastHadSignature());
     }
@@ -1099,7 +1111,7 @@ TEST_F(TSIGTest, verifyMulti) {
         commonVerifyChecks(*tsig_verify_ctx, tsig.get(),
                            renderer.getData(), renderer.getLength(),
                            TSIGError(Rcode::NOERROR()),
-                           TSIGContext::RECEIVED_REQUEST);
+                           TSIGContext::VERIFIED_RESPONSE);
         EXPECT_TRUE(tsig_verify_ctx->lastHadSignature());
     }
     // TODO: Fill in 99 unsigned messages and then try the 100th and see



More information about the bind10-changes mailing list