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();
35 $agentName =
"unifiedreport";
37 $agentDir = dirname(dirname(__DIR__));
38 $execDir =
"$agentDir/agent";
39 system(
"install -D $agentDir/VERSION $sysConf/mods-enabled/$agentName/VERSION");
41 $pipeFd = popen($cmd =
"echo $uploadId | $execDir/$agentName --userID=$userId --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 unlink(
"$sysConf/mods-enabled/$agentName/VERSION");
56 rmdir(
"$sysConf/mods-enabled/$agentName");
57 rmdir(
"$sysConf/mods-enabled");
59 return array($success, $output, $retCode);
Handles scheduler interaction.
run($uploadId, $userId=2, $groupId=2, $jobId=1, $args="")
Function to run agent from scheduler.
Namespace for report related tests.