コード例 #1
0
 def test_make_service_with_health(self):
     """Test schedulelib with heart beater"""
     opts = dict(timeout=10, grace=2, frequency=30)
     opts['args'] = ['/bin/echo', 'hello']
     myEnv = test_heart.buildEnv()
     test_heart.replaceEnvironment(self, myEnv)
     masterService = schedulelib.makeService(opts)
     service = masterService.getServiceNamed('heart')
     test_heart.checkHeartService(self, service)
コード例 #2
0
 def test_make_service_with_health(self):
     """Test schedulelib with heart beater"""
     opts = dict(timeout=10, grace=2, frequency=30)
     opts["args"] = ["/bin/echo", "hello"]
     myEnv = test_heart.buildEnv()
     test_heart.replaceEnvironment(self, myEnv)
     masterService = schedulelib.makeService(opts)
     service = masterService.getServiceNamed("heart")
     test_heart.checkHeartService(self, service)
コード例 #3
0
 def test_make_service(self):
     """Test the make service function"""
     opts = {}
     opts["args"] = ["/bin/echo", "hello"]
     opts["timeout"] = 10
     opts["grace"] = 2
     opts["frequency"] = 30
     masterService = schedulelib.makeService(opts)
     service = masterService.getServiceNamed("scheduler")
     self.assertIsInstance(service, tainternet.TimerService)
     func, args, kwargs = service.call
     self.assertFalse(kwargs)
     self.assertIs(func, schedulelib.runProcess)
     self.assertEquals(args, (opts["args"], opts["timeout"], opts["grace"], reactor))
     self.assertEquals(service.step, opts["frequency"])
コード例 #4
0
 def test_make_service(self):
     """Test the make service function"""
     opts = {}
     opts['args'] = ['/bin/echo', 'hello']
     opts['timeout'] = 10
     opts['grace'] = 2
     opts['frequency'] = 30
     masterService = schedulelib.makeService(opts)
     service = masterService.getServiceNamed('scheduler')
     self.assertIsInstance(service, tainternet.TimerService)
     func, args, kwargs = service.call
     self.assertFalse(kwargs)
     self.assertIs(func, schedulelib.runProcess)
     self.assertEquals(
         args, (opts['args'], opts['timeout'], opts['grace'], reactor))
     self.assertEquals(service.step, opts['frequency'])