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();
46 $agentName =
"unifiedreport";
48 $agentDir = dirname(dirname(__DIR__));
49 $execDir =
"$agentDir/agent";
50 system(
"install -D $agentDir/VERSION $sysConf/mods-enabled/$agentName/VERSION");
52 $pipeFd = popen($cmd =
"echo $uploadId | $execDir/$agentName --userID=$userId --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 unlink(
"$sysConf/mods-enabled/$agentName/VERSION");
67 rmdir(
"$sysConf/mods-enabled/$agentName");
68 rmdir(
"$sysConf/mods-enabled");
70 return array($success, $output, $retCode);
run($uploadId, $userId=2, $groupId=2, $jobId=1, $args="")
Function to run agent from scheduler.
Handles scheduler interaction.
Namespace for report related tests.