args.append("--config-filename=" + self.config_filename)
if self.clear_config:
args.append("--clear-config")
- bind_cfgd = ProcessInfo("b10-cfgmgr", args,
- self.c_channel_env)
+ bind_cfgd = self._make_process_info("b10-cfgmgr", args,
+ self.c_channel_env)
bind_cfgd.spawn()
self.log_started(bind_cfgd.pid)
time_remaining = time_remaining - 1
msg, env = self.cc_session.group_recvmsg()
- if not self.process_running(msg, "ConfigManager"):
+ # wait_time is set to 0 only by unittests
+ if self.wait_time > 0 and not self.process_running(msg, "ConfigManager"):
raise ProcessStartError("Configuration manager process has not started")
return bind_cfgd
# this is set by ProcessInfo.spawn()
self.assertEqual(42147, pi.pid)
+ def test_start_cfgmgr(self):
+ '''Test that b10-msgq is started.'''
+ class DummySession():
+ def group_recvmsg(self):
+ return (None, None)
+ bob = MockBobSimple()
+ bob.c_channel_env = {}
+ bob.cc_session = DummySession()
+ bob.wait_time = 0
+
+ # use the MockProcessInfo creator
+ bob._make_process_info = bob._make_mock_process_info
+
+ # defaults
+ pi = bob.start_cfgmgr()
+ self.assertEqual('b10-cfgmgr', pi.name)
+ self.assertEqual(['b10-cfgmgr'], pi.args)
+ self.assertEqual({}, pi.env)
+
+ # this is set by ProcessInfo.spawn()
+ self.assertEqual(42147, pi.pid)
+
def test_start_process(self):
'''Test that processes can be started.'''
bob = MockBob()