Browse Source

[1986] more review comments

- additional info in auth commands
- move 'check_session_start_forwarder_called' to session test setUp()
- fixed comment in auth_srv unit test
Jelte Jansen 12 years ago
parent
commit
09d8f46c29

+ 2 - 2
src/bin/auth/auth.spec.pre.in

@@ -134,12 +134,12 @@
       },
       {
         "command_name": "start_ddns_forwarder",
-        "command_description": "(Re)start internal forwarding of DDNS Update messages. This is automatically called if b10-ddns is started.",
+        "command_description": "(Re)start internal forwarding of DDNS Update messages. This is automatically called if b10-ddns is started, and is not expected to be called by administrators; it will be removed as a public command in the future.",
         "command_args": []
       },
       {
         "command_name": "stop_ddns_forwarder",
-        "command_description": "Stop internal forwarding of DDNS Update messages. This is automatically called if b10-ddns is stopped.",
+        "command_description": "Stop internal forwarding of DDNS Update messages. This is automatically called if b10-ddns is stopped, and is not expected to be called by administrators; it will be removed as a public command in the future.",
         "command_args": []
       }
     ],

+ 3 - 2
src/bin/auth/tests/auth_srv_unittest.cc

@@ -1657,8 +1657,9 @@ namespace {
 
 TEST_F(AuthSrvTest, DDNSForwardCreateDestroy) {
     // Test that AuthSrv returns NOTIMP before ddns forwarder is created,
-    // that is is connected when the start_ddns_forwarder command is sent,
-    // and that is it is no longer connected and returns NOTIMP after
+    // that the ddns_forwarder is connected when the 'start_ddns_forwarder'
+    // command has been sent,
+    // and that it is no longer connected and auth returns NOTIMP after
     // the stop_ddns_forwarding command is sent.
     scoped_ptr<AuthSrv> tmp_server(new AuthSrv(true, xfrout, ddns_forwarder));
 

+ 6 - 11
src/bin/ddns/tests/ddns_test.py

@@ -918,6 +918,10 @@ class TestDDNSSession(unittest.TestCase):
         self.orig_tsig_keyring = isc.server_common.tsig_keyring
         isc.server_common.tsig_keyring = FakeKeyringModule()
         self.server = ddns.DDNSServer(self.__cc_session)
+        # Check that start_ddns_forwarder has been called upon
+        # initialization (before we do anything else that might
+        # cause messages to be sent)
+        self.check_session_start_forwarder_called()
         self.server._UpdateSessionClass = self.__fake_session_creator
         self.__faked_result = UPDATE_SUCCESS # will be returned by fake session
         self.__sock = FakeSocket(-1)
@@ -1206,10 +1210,6 @@ class TestDDNSSession(unittest.TestCase):
     def test_session_msg(self):
         '''Test post update communication with other modules.'''
 
-        # Check that start_ddns_forwarder has been called upon
-        # initialization
-        self.check_session_start_forwarder_called()
-
         # Normal cases, confirming communication takes place iff update
         # succeeds
         for r in [UPDATE_SUCCESS, UPDATE_ERROR, UPDATE_DROP]:
@@ -1261,8 +1261,6 @@ class TestDDNSSession(unittest.TestCase):
     def test_session_msg_for_auth(self):
         '''Test post update communication with other modules including Auth.'''
 
-        self.check_session_start_forwarder_called()
-
         # Let the CC session return in-memory config with sqlite3 backend.
         # (The default case was covered by other tests.)
         self.__cc_session.auth_datasources = \
@@ -1329,11 +1327,8 @@ class TestDDNSSession(unittest.TestCase):
             self.__cc_session._recvmsg_exception = None
 
     def test_session_auth_started(self):
-        '''Check that 'start_ddns_forwarder' is sent when the notification
-           'auth_started' is received'''
-        # It should have already been called during init
-        self.check_session_start_forwarder_called()
-
+        '''Check that 'start_ddns_forwarder' is sent (again) when the
+           notification 'auth_started' is received'''
         # auth_started message should trigger it again
         answer = self.server.command_handler('auth_started', None)
         self.check_session_start_forwarder_called()