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")
Exemple #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")
Exemple #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)
Exemple #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")
Exemple #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)
Exemple #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")
Exemple #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)
	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)
	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")
	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)
	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")
	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)