コード例 #1
0
 def testCookieScript(self):
     path = os.path.join(modulePath(), 'testservices', 'StoreService.py')
     store = ServiceTask(path, self.team1)
     store.launch("NewFlag")
     time.sleep(0.1)
     store.finish()
     store.processOutput()
     store.quit()
     #self.assertEquals(store.status() == ServiceTask.INVALID_FLAG)
     self.assertEquals(store.cookie(), "Store Text")
コード例 #2
0
    def testErrorScript(self):
        path = os.path.join(modulePath(), 'testservices', 'ErrorService.py')
        err = ServiceTask(path, self.team1)
        err.launch("NewFlag")
        time.sleep(0.1)
        err.finish()
        err.processOutput()
        err.quit()

        self.assertEquals(err.error(), "An Error")
コード例 #3
0
    def testHangScript(self):
        path = os.path.join(modulePath(), 'testservices', 'HangService.py')
        hang = ServiceTask(path, self.team1)
        hang.launch("NewFlag")
        time.sleep(0.1)

        self.assertEquals(hang.isAlive(), True)
        hang.finish()
        self.assertEquals(hang.isAlive(), False)
        hang.quit()
コード例 #4
0
	def testCookieScript(self):
		path = os.path.join(modulePath(),'testservices','StoreService.py')
		store = ServiceTask(path,self.team1)
		store.launch("NewFlag")
		time.sleep(0.1)
		store.finish()
		store.processOutput()
		store.quit()
		#self.assertEquals(store.status() == ServiceTask.INVALID_FLAG)
		self.assertEquals(store.cookie(),"Store Text")
コード例 #5
0
    def testBrokenScript(self):
        path = os.path.join(modulePath(), 'testservices', 'BrokenService.py')
        broken = ServiceTask(path, self.team1)
        broken.launch("NewFlag")
        time.sleep(0.1)
        broken.finish()
        broken.processOutput()
        broken.quit()

        self.assertEquals(broken.prevFlag(), None)
コード例 #6
0
	def testHangScript(self):
		path = os.path.join(modulePath(),'testservices','HangService.py')
		hang = ServiceTask(path,self.team1)
		hang.launch("NewFlag")
		time.sleep(0.1)

		self.assertEquals(hang.isAlive(),True)
		hang.finish()
		self.assertEquals(hang.isAlive(),False)
		hang.quit()
コード例 #7
0
	def testErrorScript(self):
		path = os.path.join(modulePath(),'testservices','ErrorService.py')
		err = ServiceTask(path,self.team1)
		err.launch("NewFlag")
		time.sleep(0.1)
		err.finish()
		err.processOutput()
		err.quit()

		self.assertEquals(err.error(),"An Error")
コード例 #8
0
	def testBrokenScript(self):
		path = os.path.join(modulePath(),'testservices','BrokenService.py')
		broken = ServiceTask(path,self.team1)
		broken.launch("NewFlag")
		time.sleep(0.1)
		broken.finish()
		broken.processOutput()
		broken.quit()

		self.assertEquals(broken.prevFlag(),None)
コード例 #9
0
    def testCorrectScript(self):
        self.__ensureValidGoodService()
        path = os.path.join(modulePath(), 'testservices', 'GoodService.py')
        good = ServiceTask(path, self.team1)

        good.launch("NewFlag")
        time.sleep(0.1)
        good.finish()
        good.processOutput()
        good.quit()

        self.assertEquals(good.prevFlag(), "TestFlag")
コード例 #10
0
	def testCorrectScript(self):
		self.__ensureValidGoodService()
		path = os.path.join(modulePath(),'testservices','GoodService.py')
		good = ServiceTask(path,self.team1)

		good.launch("NewFlag")
		time.sleep(0.1)
		good.finish()
		good.processOutput()
		good.quit()

		self.assertEquals(good.prevFlag(),"TestFlag")