12 include_once(__DIR__.
'/../../../lib/php/Test/Agent/AgentTestMockHelper.php');
13 include_once(__DIR__.
'/SchedulerTestRunner.php');
31 public function run($uploadId, $userId=2, $groupId=2, $jobId=1, $args=
"")
33 $sysConf = $this->testDb->getFossSysConf();
37 $agentDir = dirname(dirname(__DIR__));
38 $execDir =
"$agentDir/agent";
40 $pipeFd = popen($cmd =
"echo $uploadId | $execDir/$agentName --userID=$userId "
41 .
"--groupID=$groupId --jobId=$jobId --scheduler_start -c $sysConf $args",
"r");
42 $success = $pipeFd !==
false;
47 while (($buffer = fgets($pipeFd, 4096)) !==
false) {
50 $retCode = pclose($pipeFd);
52 print
"failed opening pipe to $cmd";
55 return array($success, $output, $retCode);
Handles scheduler interaction.
run($uploadId, $userId=2, $groupId=2, $jobId=1, $args="")
Function to run agent from scheduler.
Namespace to hold test cases for SPDX2 agent.