12 include_once(__DIR__.
'/../../../lib/php/Test/Agent/AgentTestMockHelper.php');
13 include_once(__DIR__.
'/SchedulerTestRunner.php');
24 public function __construct(
TestPgDb $testDb)
26 $this->testDb = $testDb;
33 public function run($uploadId, $userId=2, $groupId=2, $jobId=1, $args=
"")
35 $sysConf = $this->testDb->getFossSysConf();
37 $agentName =
"decider";
39 $agentDir = dirname(__DIR__, 2);
40 $baseDir = dirname(__DIR__, 4);
41 $execDir =
"$agentDir/agent";
42 system(
"install -D $baseDir/build/src/decider/VERSION $sysConf/mods-enabled/$agentName/VERSION");
44 $pipeFd = popen($cmd =
"echo $uploadId | $execDir/$agentName --userID=$userId --groupID=$groupId --jobId=$jobId --scheduler_start -c $sysConf $args",
"r");
45 $success = $pipeFd !==
false;
50 while (($buffer = fgets($pipeFd, 4096)) !==
false) {
53 $retCode = pclose($pipeFd);
55 print
"failed opening pipe to $cmd";
58 unlink(
"$sysConf/mods-enabled/$agentName/VERSION");
59 rmdir(
"$sysConf/mods-enabled/$agentName");
60 rmdir(
"$sysConf/mods-enabled");
62 return array($success, $output, $retCode);
run($uploadId, $userId=2, $groupId=2, $jobId=1, $args="")
Get the arguments required by agent to run and try to run the agent.
Create dummy run interface.