30 $where = dirname(__FILE__);
31 if(preg_match(
'!/home/jenkins.*?tests.*!', $where, $matches))
34 require_once (
'fossologyTestCase.php');
36 require_once(
'testClasses/parseMiniMenu.php');
37 require_once(
'testClasses/dom-parseLicenseTable.php');
38 require_once(
'testClasses/parseFolderPath.php');
39 require_once(
'commonTestFuncs.php');
44 require_once (
'../fossologyTestCase.php');
46 require_once(
'../testClasses/parseMiniMenu.php');
47 require_once(
'../testClasses/dom-parseLicenseTable.php');
48 require_once(
'../testClasses/parseFolderPath.php');
49 require_once(
'../commonTestFuncs.php');
69 $this->host = getHost($URL);
77 'No_license_found' => 6878,
86 'Apache-possibility' => 62,
87 'See-doc(OTHER)' => 28,
88 'Debian-SPI-style' => 34,
92 'Trademark-ref' => 25,
94 'UnclassifiedLicense' => 28,
95 'GPL-exception' => 24,
102 'GPL-possibility' => 1,
103 'Public-domain' => 20,
104 'Non-commercial!' => 6,
106 'ATT-possibility' => 6,
114 'Public-domain-ref' => 4,
115 'Perl-possibility' => 4,
119 'NOT-public-domain' => 10,
121 'CMU-possibility' => 2,
126 'Open-Publication_v1.0' => 2,
128 'AGFA(RESTRICTED)' => 1,
131 'ATT-Source_v1.2d' => 1,
132 'BSD-possibility' => 1,
135 'HP-possibility' => 1,
137 'GPL-Bison-exception' => 1,
138 'LGPL-possibility' => 1,
140 'MacroMedia-RPSL' => 1,
141 'Microsoft-possibility' => 1,
144 'RedHat(Non-commercial)' => 1,
145 'Same-license-as' => 1,
146 'See-file(COPYING)' => 1,
149 'Sun-possibility' => 1,
150 'Sun(RESTRICTED)' => 1,
151 'TeX-exception' => 1,
152 'U-Wash(Free-Fork)' => 1,
157 $licenseSummary = array(
158 'Unique licenses' => 71,
159 'Licenses found' => 3328,
160 'Files with no licenses' => 6878,
165 print
"starting testRHEL\n";
167 $name =
'RedHat.tar.gz';
168 $safeName = escapeDots($name);
170 $page = $this->mybrowser->clickLink(
'Browse');
171 $page = $this->mybrowser->clickLink(
'Testing');
172 $this->assertTrue($this->myassertText($page,
"/$safeName/"),
173 "verifyRedHat FAILED! did not find $safeName\n");
178 $page = $this->mybrowser->clickLink($name);
179 $this->assertTrue($this->myassertText($page,
"/1 item/"),
180 "verifyRedHat FAILED! 1 item not found\n");
181 $page = $this->mybrowser->clickLink(
'RedHat.tar');
183 $page = $this->mybrowser->clickLink(
'RedHat/');
185 $this->assertTrue($this->myassertText($page,
"/65 items/"),
186 "verifyRedHat FAILED! '65 items' not found\n");
188 $miniMenu = $mini->parseMiniMenu();
190 $url = makeUrl($this->host, $miniMenu[
'License Browser']);
191 if($url === NULL) { $this->fail(
"verifyRedHat Failed, host/url is not set"); }
193 $page = $this->mybrowser->get($url);
195 $this->assertTrue($this->myassertText($page,
'/License Browser/'),
196 "verifyRedHat FAILED! License Browser Title not found\n");
200 $licSummary->parseLicenseTbl();
202 print
"verifying summaries....\n";
203 foreach ($licSummary->hList as $summary)
206 $key = $summary[
'textOrLink'];
208 $this->assertEqual($licenseSummary[$key], $summary[
'count'],
209 "verifyRedHat FAILED! $key does not equal $licenseSummary[$key], 210 Expected: {$licenseSummary[$key]}, 211 Got: $summary[count]\n");
217 $licHistogram->parseLicenseTbl();
219 if($licHistogram->noRows === TRUE)
221 $this->fail(
"FATAL! no table rows to process, there should be many for" 222 .
" this test, Stopping the test");
234 foreach($licHistogram->hList as $licFound)
236 $key = $licFound[
'textOrLink'];
239 if(array_key_exists($key,$licBaseLine))
242 $this->assertEqual($licBaseLine[$key], $licFound[
'count'],
243 "verifyRedHat FAILED! the baseline count {$licBaseLine[$key]} does" .
244 " not equal {$licFound['count']} for license $key,\n" .
245 "Expected: {$licBaseLine[$key]},\n" .
246 " Got: {$licFound['count']}\n");
250 $this->fail(
"verifyRedHat FAILED! A License was found that is " .
251 "not in the standard:\n$key\n");
Login($User=NULL, $Password=NULL)