Browse Source

[1986] also test that stop forwarding is called

Jelte Jansen 13 years ago
parent
commit
0d9247297a
2 changed files with 16 additions and 1 deletions
  1. 16 0
      src/bin/ddns/tests/ddns_test.py
  2. 0 1
      tests/lettuce/features/ddns_system.feature

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

@@ -1193,6 +1193,17 @@ class TestDDNSSession(unittest.TestCase):
         # reset it for other tests
         self.__cc_session._recvmsg_called = 0
 
+    def check_session_stop_forwarder_called(self):
+        '''Check that the command 'start_ddns_forwarder' has been called
+           This test removes said message from the sent message queue.
+        '''
+        # check the last message sent
+        sent_msg, sent_group = self.__cc_session._sent_msg.pop()
+        sent_cmd = sent_msg['command']
+        self.assertEqual('Auth', sent_group)
+        self.assertEqual('stop_ddns_forwarder', sent_cmd[0])
+        self.assertEqual(1, len(sent_cmd))
+
     def test_session_msg(self):
         '''Test post update communication with other modules.'''
 
@@ -1241,6 +1252,11 @@ class TestDDNSSession(unittest.TestCase):
         self.__cc_session._sendmsg_exception = RuntimeError('unexpected')
         self.assertRaises(RuntimeError, self.check_session)
 
+    def test_session_shutdown_cleanup(self):
+        '''Test that the stop forwarding message is sent'''
+        self.server.shutdown_cleanup()
+        self.check_session_stop_forwarder_called()
+
     def test_session_msg_for_auth(self):
         '''Test post update communication with other modules including Auth.'''
 

+ 0 - 1
tests/lettuce/features/ddns_system.feature

@@ -52,7 +52,6 @@ Feature: DDNS System
         And wait for new bind10 stderr message DDNS_STARTED
 
         # Test 8
-        # Known issue: after shutdown, first new attempt results in SERVFAIL
         When I use DDNS to set the SOA serial to 1238
         The DDNS response should be SUCCESS
         And the SOA serial for example.org should be 1238