Browse Source

[trac1104] removed redundant TSIG key addition to the key ring.
also added assertEqual checks to catch such naive redundant copies in case
that happens again.

JINMEI Tatuya 13 years ago
parent
commit
489f9a3bf2
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/bin/xfrout/tests/xfrout_test.py.in

+ 4 - 4
src/bin/xfrout/tests/xfrout_test.py.in

@@ -137,7 +137,8 @@ class TestXfroutSession(unittest.TestCase):
         self.assertEqual(rcode.to_text(), "NOTAUTH")
         self.assertTrue(self.xfrsess._tsig_ctx is not None)
         # NOERROR
-        self.xfrsess._tsig_key_ring.add(TSIG_KEY)
+        self.assertEqual(TSIGKeyRing.SUCCESS,
+                         self.xfrsess._tsig_key_ring.add(TSIG_KEY))
         [rcode, msg] = self.xfrsess._parse_query_message(request_data)
         self.assertEqual(rcode.to_text(), "NOERROR")
         self.assertTrue(self.xfrsess._tsig_ctx is not None)
@@ -176,7 +177,8 @@ class TestXfroutSession(unittest.TestCase):
         self.xfrsess._acl = isc.acl.dns.REQUEST_LOADER.load([
             {"key": "example.com", "action": "ACCEPT"}, {"action": "REJECT"}
         ])
-        self.xfrsess._tsig_key_ring.add(TSIG_KEY)
+        self.assertEqual(TSIGKeyRing.SUCCESS,
+                         self.xfrsess._tsig_key_ring.add(TSIG_KEY))
         [rcode, msg] = self.xfrsess._parse_query_message(request_data)
         self.assertEqual(rcode.to_text(), "NOERROR")
 
@@ -184,7 +186,6 @@ class TestXfroutSession(unittest.TestCase):
         self.xfrsess._acl = isc.acl.dns.REQUEST_LOADER.load([
             {"key": "example.org", "action": "ACCEPT"}, {"action": "REJECT"}
         ])
-        self.xfrsess._tsig_key_ring.add(TSIG_KEY)
         [rcode, msg] = self.xfrsess._parse_query_message(request_data)
         self.assertEqual(rcode.to_text(), "REFUSED")
 
@@ -192,7 +193,6 @@ class TestXfroutSession(unittest.TestCase):
         self.xfrsess._acl = isc.acl.dns.REQUEST_LOADER.load([
             {"key": "example.org", "action": "ACCEPT"}, {"action": "REJECT"}
         ])
-        self.xfrsess._tsig_key_ring.add(TSIG_KEY)
         [rcode, msg] = self.xfrsess._parse_query_message(self.mdata)
         self.assertEqual(rcode.to_text(), "REFUSED")