Commit 489f9a3b authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[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.
parent 67f6e4ba
......@@ -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")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment