Browse Source

[2013] added one more test in general session.

it checks with more realistic configs.
JINMEI Tatuya 13 years ago
parent
commit
6e845d8827
1 changed files with 22 additions and 0 deletions
  1. 22 0
      src/bin/ddns/tests/ddns_test.py

+ 22 - 0
src/bin/ddns/tests/ddns_test.py

@@ -660,6 +660,28 @@ class TestDDNSession(unittest.TestCase):
         self.check_session(result=UPDATE_DROP, ipv6=False,
                            tsig_key=BAD_TSIG_KEY)
 
+    def test_session_with_config(self):
+        '''Check a session with more relistic config setups
+
+        We don't have to explore various cases in detail in this test.
+        We're just checking if the expected configured objects are passed
+        to the session object.
+
+        '''
+
+        # reset the session class to the real one
+        self.server._UpdateSessionClass = isc.ddns.session.UpdateSession
+
+        # install all-drop ACL
+        new_config = { 'zones': [ { 'origin': TEST_ZONE_NAME_STR,
+                                    'class': TEST_RRCLASS_STR,
+                                    'update_acl': [{'action': 'DROP'}] } ] }
+        answer = self.server.config_handler(new_config)
+        self.assertEqual((0, None), isc.config.parse_answer(answer))
+
+        # check the result
+        self.check_session(UPDATE_DROP)
+
 class TestMain(unittest.TestCase):
     def setUp(self):
         self._server = MyDDNSServer()