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