12 include_once(__DIR__.
'/../../../lib/php/Test/Agent/AgentTestMockHelper.php');
13 include_once(__DIR__.
'/SchedulerTestRunner.php');
20 public function __construct(
TestPgDb $testDb)
22 $this->testDb = $testDb;
25 public function run($uploadId, $userId=2, $groupId=2, $jobId=1, $args=
"")
27 $sysConf = $this->testDb->getFossSysConf();
29 $agentName =
"clixml";
31 $agentDir = dirname(dirname(__DIR__));
32 $execDir =
"$agentDir/agent";
34 $pipeFd = popen($cmd =
"echo $uploadId | $execDir/$agentName --userID=$userId --groupID=$groupId --jobId=$jobId --scheduler_start -c $sysConf $args",
"r");
35 $success = $pipeFd !==
false;
40 while (($buffer = fgets($pipeFd, 4096)) !==
false) {
43 $retCode = pclose($pipeFd);
45 print
"failed opening pipe to $cmd";
48 return array($success, $output, $retCode);