12 include_once(__DIR__.
'/../../../lib/php/Test/Agent/AgentTestMockHelper.php');
13 include_once(__DIR__.
'/SchedulerTestRunner.php');
25 public function __construct(
TestPgDb $testDb)
27 $this->testDb = $testDb;
39 public function run($uploadId, $userId=2, $groupId=2, $jobId=1, $args=
"")
41 $sysConf = $this->testDb->getFossSysConf();
43 $agentName =
"deciderjob";
45 $agentDir = dirname(__DIR__, 2);
46 $execDir =
"$agentDir/agent";
47 system(
"install -D $agentDir/VERSION $sysConf/mods-enabled/$agentName/VERSION");
49 $pipeFd = popen($cmd =
"echo $uploadId | $execDir/$agentName --userID=$userId --groupID=$groupId --jobId=$jobId --scheduler_start -c $sysConf $args",
"r");
50 $success = $pipeFd !==
false;
55 while (($buffer = fgets($pipeFd, 4096)) !==
false) {
58 $retCode = pclose($pipeFd);
60 print
"failed opening pipe to $cmd";
63 unlink(
"$sysConf/mods-enabled/$agentName/VERSION");
64 rmdir(
"$sysConf/mods-enabled/$agentName");
65 rmdir(
"$sysConf/mods-enabled");
67 return array($success, $output, $retCode);
run($uploadId, $userId=2, $groupId=2, $jobId=1, $args="")
Mock as agent was called from CLI.
Interface for scheduler. Called by test case.
Namespace for decider job test cases.