Ejemplo n.º 1
0
	def testCurrentProcesses(self):
		a = agentaction()
		a.JOBID = 10
		a.SCHDATE = datetime.now()
		a.CMDLINE = QUICK_CMD
		a.STDOUT = True
		a.execute()
		self.assert_(len(current_processes["running"]) == 1)
		self.assert_(a.JOBID in current_processes["running"])
		
		a2 = agentaction()
		a2.JOBID = 11
		a2.SCHDATE = datetime.now()
		a2.CMDLINE = QUICK_CMD
		a2.STDOUT = True
		a2.execute()
		
		self.assert_(len(current_processes["running"]) == 2)
		self.assert_(a2.JOBID in current_processes["running"])
		
		time.sleep(1)
		l = a.check_status()

		self.assert_(len(current_processes["running"]) == 1)
		self.assert_(a2.JOBID in current_processes["running"])

		l = a2.check_status()
		
		self.assert_(len(current_processes["running"]) == 0)
Ejemplo n.º 2
0
	def testAgentAction(self):
		a = agentaction()
		a.JOBID = 10
		a.SCHDATE = datetime.now()
		a.CMDLINE = QUICK_CMD
		a.STDOUT = True
		a.execute()
		time.sleep(1)
		l = a.check_status()
		self.assert_(l.JOBID == a.JOBID)
		self.assert_(l.SCHDATE == a.SCHDATE)
		self.assert_(l.CMDLINE == a.CMDLINE)
		self.assert_(l.RESULT == 1)
		self.assert_(l.RETCODE == 0)