41 require_once(
'TestRun.php');
42 require_once(
'mailTo.php');
46 $usage =
"$argv[0] [-h] [-p <path>]\n" .
47 "h: help, this message\n" .
48 "p path: the path to the fossology sources to test\n";
52 $options = getopt(
'hp:');
53 if(array_key_exists(
'h', $options))
58 if(array_key_exists(
'p', $options))
60 $path = $options[
'p'];
73 function reportError($error, $file=NULL)
79 if(is_readable($file))
81 $longMsg = file_get_contents($file);
85 $longMsg =
"$file was not readable\n";
88 else if(strlen($file) != 0)
96 $longMsg =
"Could not append a non-string to the message, " .
97 "reportError was passed an invalid 2nd parameter\n";
101 $hdr =
"There were errors in the nightly test setup." .
102 "The tests were not run due to one or more errors.\n\n";
104 $msg = $hdr . $error .
"\n" . $longMsg .
"\n";
109 $tmpFile = tempnam(
'.',
'testError');
110 $F = fopen($tmpFile,
'w') or die("Can not open tmp file $tmpFile\n");
113 $last = exec("mailx -
s 'test Setup Failed' $mailTo < $tmpFile ",$tossme, $rptGen);
117 if(array_key_exists('WORKSPACE', $_ENV))
119 $JenkinsWkSpace = $_ENV[
'WORKSPACE'];
120 $path = $JenkinsWkSpace;
121 print
"workspaces path is:$JenkinsWkSpace\n";
157 print
"Making sources\n";
158 if($tonight->makeSrcs() !== TRUE)
160 $error =
"There were Errors in the make of the sources examine make.out\n";
162 reportError($error,
'make.out');
166 print
"Stopping Scheduler before install\n";
167 if($tonight->stopScheduler() !== TRUE)
169 $error =
"Could not stop fossology-scheduler, maybe it wasn't running?\n";
171 reportError($error, NULL);
175 print
"Installing fossology\n";
176 if($tonight->makeInstall() !== TRUE)
178 $error =
"There were Errors in the Installation examine make-install.out\n";
180 reportError($error,
'mi.out');
190 print
"Running fo-postinstall\n";
191 $iRes = $tonight->foPostinstall();
192 print
"install results are:$iRes\n";
197 $error =
"There were errors in the postinstall process check fop.out\n";
199 print
"calling reportError\n";
200 reportError($error,
'fop.out');
205 print
"Starting Scheduler Test\n";
206 if($tonight->schedulerTest() !== TRUE)
208 $error =
"Error! in scheduler test examine ST.out\n";
210 reportError($error,
'ST.out');
214 print
"Starting Scheduler\n";
215 if($tonight->startScheduler() !== TRUE)
217 $error =
"Error! Could not start fossology-scheduler\n";
219 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