Ejemplo n.º 1
0
	def testCorrectScript(self):
		self.__ensureValidGoodService()
		path = os.path.join(modulePath(),'testservices','GoodService.py')
		good = ServiceTask(path,1,"NewFlag","0.0.0.0",None)
		good.start()
		
		self.assert_(good.status() == ServiceTask.OK)
		self.assert_(good.getPrevFlag() == "TestFlag")
Ejemplo n.º 2
0
    def testCorrectScript(self):
        self.__ensureValidGoodService()
        path = os.path.join(modulePath(), 'testservices', 'GoodService.py')
        good = ServiceTask(path, 1, "NewFlag", "0.0.0.0", None)
        good.start()

        self.assert_(good.status() == ServiceTask.OK)
        self.assert_(good.getPrevFlag() == "TestFlag")
Ejemplo n.º 3
0
 def testPastTimeout(self):
     path = os.path.join(modulePath(), 'testservices', 'GoodService.py')
     good = ServiceTask(path, 1, "NewFlag", "0.0.0.0", None)
     good.start()
     time.sleep(2)
     self.assert_(good.status() == ServiceTask.OK)
Ejemplo n.º 4
0
 def testStoreScript(self):
     path = os.path.join(modulePath(), 'testservices', 'StoreService.py')
     store = ServiceTask(path, 0.5, "NewFlag", "0.0.0.0", None)
     store.start()
     self.assert_(store.status() == ServiceTask.INVALID_FLAG)
     self.assert_(store.store() == "Store Text")
Ejemplo n.º 5
0
 def testHangScript(self):
     path = os.path.join(modulePath(), 'testservices', 'HangService.py')
     hang = ServiceTask(path, 1, "NewFlag", "0.0.0.0", None)
     hang.start()
     self.assert_(hang.status() == ServiceTask.KILLED)
Ejemplo n.º 6
0
 def testErrorScript(self):
     path = os.path.join(modulePath(), 'testservices', 'ErrorService.py')
     err = ServiceTask(path, 1, "NewFlag", "0.0.0.0", None)
     err.start()
     self.assert_(err.status() == ServiceTask.ERROR)
     self.assert_(err.error() == "An Error")
Ejemplo n.º 7
0
 def testBrokenScript(self):
     path = os.path.join(modulePath(), 'testservices', 'BrokenService.py')
     err = ServiceTask(path, 2, "NewFlag", "0.0.0.0", None)
     err.start()
     self.assert_(err.status() == ServiceTask.INVALID_FLAG)
Ejemplo n.º 8
0
	def testPastTimeout(self):
		path = os.path.join(modulePath(),'testservices','GoodService.py')
		good = ServiceTask(path,1,"NewFlag","0.0.0.0",None)
		good.start()
		time.sleep(2)
		self.assert_(good.status() == ServiceTask.OK)
Ejemplo n.º 9
0
	def testStoreScript(self):
		path = os.path.join(modulePath(),'testservices','StoreService.py')
		store = ServiceTask(path,0.5,"NewFlag","0.0.0.0",None)
		store.start()
		self.assert_(store.status() == ServiceTask.INVALID_FLAG)
		self.assert_(store.store() == "Store Text")
Ejemplo n.º 10
0
	def testHangScript(self):
		path = os.path.join(modulePath(),'testservices','HangService.py')
		hang = ServiceTask(path,1,"NewFlag","0.0.0.0",None)
		hang.start()
		self.assert_(hang.status() == ServiceTask.KILLED)
Ejemplo n.º 11
0
	def testErrorScript(self):
		path = os.path.join(modulePath(),'testservices','ErrorService.py')
		err = ServiceTask(path,1,"NewFlag","0.0.0.0",None)
		err.start()
		self.assert_(err.status() == ServiceTask.ERROR)
		self.assert_(err.error() == "An Error")
Ejemplo n.º 12
0
	def testBrokenScript(self):
		path = os.path.join(modulePath(),'testservices','BrokenService.py')
		err = ServiceTask(path,2,"NewFlag","0.0.0.0",None)
		err.start()
		self.assert_(err.status() == ServiceTask.INVALID_FLAG)