Beispiel #1
0
 def test_handle_unknown_signal(self):
     options = DummyOptions()
     options.signal = signal.SIGUSR1
     supervisord = self._makeOne(options)
     supervisord.handle_signal()
     self.assertEqual(supervisord.options.mood, 1)
     self.assertEqual(options.logger.data[0],
                      'received SIGUSR1 indicating nothing')
Beispiel #2
0
 def test_handle_sighup(self):
     options = DummyOptions()
     options.signal = signal.SIGHUP
     supervisord = self._makeOne(options)
     supervisord.handle_signal()
     self.assertEqual(supervisord.options.mood, 0)
     self.assertEqual(options.logger.data[0],
                      'received SIGHUP indicating restart request')
Beispiel #3
0
 def test_handle_sigquit(self):
     options = DummyOptions()
     options.signal = signal.SIGQUIT
     supervisord = self._makeOne(options)
     supervisord.handle_signal()
     self.assertEqual(supervisord.options.mood, -1)
     self.assertEqual(options.logger.data[0],
                      'received SIGQUIT indicating exit request')
Beispiel #4
0
 def test_handle_unknown_signal(self):
     options = DummyOptions()
     options.signal = signal.SIGUSR1
     supervisord = self._makeOne(options)
     supervisord.handle_signal()
     self.assertEqual(supervisord.options.mood, 1)
     self.assertEqual(options.logger.data[0],
                      'received SIGUSR1 indicating nothing')
Beispiel #5
0
 def test_handle_sighup(self):
     options = DummyOptions()
     options.signal = signal.SIGHUP
     supervisord = self._makeOne(options)
     supervisord.handle_signal()
     self.assertEqual(supervisord.options.mood, 0)
     self.assertEqual(options.logger.data[0],
                      'received SIGHUP indicating restart request')
Beispiel #6
0
 def test_handle_sigquit(self):
     options = DummyOptions()
     options.signal = signal.SIGQUIT
     supervisord = self._makeOne(options)
     supervisord.handle_signal()
     self.assertEqual(supervisord.options.mood, -1)
     self.assertEqual(options.logger.data[0],
                      'received SIGQUIT indicating exit request')
Beispiel #7
0
 def test_handle_sigusr2(self):
     options = DummyOptions()
     options.signal = signal.SIGUSR2
     pconfig1 = DummyPConfig(options, 'process1', 'process1','/bin/process1')
     from supervisor.process import ProcessStates
     process1 = DummyProcess(pconfig1, state=ProcessStates.STOPPING)
     process1.delay = time.time() - 1
     supervisord = self._makeOne(options)
     pconfigs = [DummyPConfig(options, 'foo', 'foo', '/bin/foo')]
     options.process_group_configs = DummyPGroupConfig(
         options, 'foo',
         pconfigs=pconfigs)
     supervisord.handle_signal()
     self.assertEqual(supervisord.options.mood, 1)
     self.assertEqual(options.logs_reopened, True)
     self.assertEqual(options.logger.data[0],
                      'received SIGUSR2 indicating log reopen request')
Beispiel #8
0
 def test_handle_sigusr2(self):
     options = DummyOptions()
     options.signal = signal.SIGUSR2
     pconfig1 = DummyPConfig(options, 'process1', 'process1',
                             '/bin/process1')
     from supervisor.process import ProcessStates
     process1 = DummyProcess(pconfig1, state=ProcessStates.STOPPING)
     process1.delay = time.time() - 1
     supervisord = self._makeOne(options)
     pconfigs = [DummyPConfig(options, 'foo', 'foo', '/bin/foo')]
     options.process_group_configs = DummyPGroupConfig(options,
                                                       'foo',
                                                       pconfigs=pconfigs)
     supervisord.handle_signal()
     self.assertEqual(supervisord.options.mood, 1)
     self.assertEqual(options.logs_reopened, True)
     self.assertEqual(options.logger.data[0],
                      'received SIGUSR2 indicating log reopen request')