23 include_once(__DIR__.
'/../../../lib/php/Test/Agent/AgentTestMockHelper.php');
24 include_once(__DIR__.
'/SchedulerTestRunner.php');
42 public function run($uploadId, $userId=2, $groupId=2, $jobId=1, $args=
"")
44 $sysConf = $this->testDb->getFossSysConf();
48 $agentDir = dirname(dirname(__DIR__));
49 $execDir =
"$agentDir/agent";
51 $pipeFd = popen($cmd =
"echo $uploadId | $execDir/$agentName --userID=$userId " 52 .
"--groupID=$groupId --jobId=$jobId --scheduler_start -c $sysConf $args",
"r");
53 $success = $pipeFd !==
false;
58 while (($buffer = fgets($pipeFd, 4096)) !==
false) {
61 $retCode = pclose($pipeFd);
63 print
"failed opening pipe to $cmd";
66 return array($success, $output, $retCode);
run($uploadId, $userId=2, $groupId=2, $jobId=1, $args="")
Function to run agent from scheduler.
Namespace to hold test cases for SPDX2 agent.
Handles scheduler interaction.