23 include_once(__DIR__.
'/../../../lib/php/Test/Agent/AgentTestMockHelper.php');
24 include_once(__DIR__.
'/SchedulerTestRunner.php');
36 public function __construct(
TestPgDb $testDb)
38 $this->testDb = $testDb;
50 public function run($uploadId, $userId=2, $groupId=2, $jobId=1, $args=
"")
52 $sysConf = $this->testDb->getFossSysConf();
54 $agentName =
"deciderjob";
56 $agentDir = dirname(dirname(__DIR__));
57 $execDir =
"$agentDir/agent";
58 system(
"install -D $agentDir/VERSION $sysConf/mods-enabled/$agentName/VERSION");
60 $pipeFd = popen($cmd =
"echo $uploadId | $execDir/$agentName --userID=$userId --groupID=$groupId --jobId=$jobId --scheduler_start -c $sysConf $args",
"r");
61 $success = $pipeFd !==
false;
66 while (($buffer = fgets($pipeFd, 4096)) !==
false) {
69 $retCode = pclose($pipeFd);
71 print
"failed opening pipe to $cmd";
74 unlink(
"$sysConf/mods-enabled/$agentName/VERSION");
75 rmdir(
"$sysConf/mods-enabled/$agentName");
76 rmdir(
"$sysConf/mods-enabled");
78 return array($success, $output, $retCode);
Namespace for decider job test cases.
Interface for scheduler. Called by test case.
run($uploadId, $userId=2, $groupId=2, $jobId=1, $args="")
Mock as agent was called from CLI.