|
@@ -1651,6 +1651,31 @@ class TestBossComponents(unittest.TestCase):
|
|
|
# this is set by ProcessInfo.spawn()
|
|
|
self.assertEqual(42147, pi.pid)
|
|
|
|
|
|
+ def test_start_ccsession(self):
|
|
|
+ '''Test that CC session is started.'''
|
|
|
+ class DummySession():
|
|
|
+ def __init__(self, specfile, config_handler, command_handler,
|
|
|
+ socket_file):
|
|
|
+ self.specfile = specfile
|
|
|
+ self.config_handler = config_handler
|
|
|
+ self.command_handler = command_handler
|
|
|
+ self.socket_file = socket_file
|
|
|
+ self.started = False
|
|
|
+ def start(self):
|
|
|
+ self.started = True
|
|
|
+ bob = MockBobSimple()
|
|
|
+ tmp = isc.config.ModuleCCSession
|
|
|
+ isc.config.ModuleCCSession = DummySession
|
|
|
+
|
|
|
+ ccs = bob.start_ccsession({})
|
|
|
+ self.assertEqual(bind10_src.SPECFILE_LOCATION, ccs.specfile)
|
|
|
+ self.assertEqual(bob.config_handler, ccs.config_handler)
|
|
|
+ self.assertEqual(bob.command_handler, ccs.command_handler)
|
|
|
+ self.assertEqual(bob.msgq_socket_file, ccs.socket_file)
|
|
|
+ self.assertTrue(ccs.started)
|
|
|
+
|
|
|
+ isc.config.ModuleCCSession = tmp
|
|
|
+
|
|
|
def test_start_process(self):
|
|
|
'''Test that processes can be started.'''
|
|
|
bob = MockBob()
|