29 require_once(
'TestRun.php');
30 require_once(
'mailTo.php');
34 $usage =
"$argv[0] [-h] [-p <path>]\n" .
35 "h: help, this message\n" .
36 "p path: the path to the fossology sources to test\n";
40 $options = getopt(
'hp:');
41 if(array_key_exists(
'h', $options))
46 if(array_key_exists(
'p', $options))
48 $path = $options[
'p'];
61 function reportError($error, $file=NULL)
67 if(is_readable($file))
69 $longMsg = file_get_contents($file);
73 $longMsg =
"$file was not readable\n";
76 else if(strlen($file) != 0)
84 $longMsg =
"Could not append a non-string to the message, " .
85 "reportError was passed an invalid 2nd parameter\n";
89 $hdr =
"There were errors in the nightly test setup." .
90 "The tests were not run due to one or more errors.\n\n";
92 $msg = $hdr . $error .
"\n" . $longMsg .
"\n";
97 $tmpFile = tempnam(
'.',
'testError');
98 $F = fopen($tmpFile,
'w') or die("Can not open tmp file $tmpFile\n");
101 $last = exec("mailx -
s 'test Setup Failed' $mailTo < $tmpFile ",$tossme, $rptGen);
105 if(array_key_exists('WORKSPACE', $_ENV))
107 $JenkinsWkSpace = $_ENV[
'WORKSPACE'];
108 $path = $JenkinsWkSpace;
109 print
"workspaces path is:$JenkinsWkSpace\n";
145 print
"Making sources\n";
146 if($tonight->makeSrcs() !== TRUE)
148 $error =
"There were Errors in the make of the sources examine make.out\n";
150 reportError($error,
'make.out');
154 print
"Stopping Scheduler before install\n";
155 if($tonight->stopScheduler() !== TRUE)
157 $error =
"Could not stop fossology-scheduler, maybe it wasn't running?\n";
159 reportError($error, NULL);
163 print
"Installing fossology\n";
164 if($tonight->makeInstall() !== TRUE)
166 $error =
"There were Errors in the Installation examine make-install.out\n";
168 reportError($error,
'mi.out');
178 print
"Running fo-postinstall\n";
179 $iRes = $tonight->foPostinstall();
180 print
"install results are:$iRes\n";
185 $error =
"There were errors in the postinstall process check fop.out\n";
187 print
"calling reportError\n";
188 reportError($error,
'fop.out');
193 print
"Starting Scheduler Test\n";
194 if($tonight->schedulerTest() !== TRUE)
196 $error =
"Error! in scheduler test examine ST.out\n";
198 reportError($error,
'ST.out');
202 print
"Starting Scheduler\n";
203 if($tonight->startScheduler() !== TRUE)
205 $error =
"Error! Could not start fossology-scheduler\n";
207 reportError($error, NULL);
int s
The socket that the CLI will use to communicate.
if(!preg_match("/\s$projectGroup\s/", $groups) &&(posix_getgid() !=$gInfo[ 'gid']))
get monk license list of one specified uploadtree_id