19 $where = dirname(__FILE__);
20 if(preg_match(
'!/home/jenkins.*?tests.*!', $where, $matches))
23 require_once (
'fossologyTestCase.php');
25 require_once(
'testClasses/parseMiniMenu.php');
26 require_once(
'testClasses/dom-parseLicenseTable.php');
27 require_once(
'testClasses/parseFolderPath.php');
28 require_once(
'commonTestFuncs.php');
33 require_once (
'../fossologyTestCase.php');
35 require_once(
'../testClasses/parseMiniMenu.php');
36 require_once(
'../testClasses/dom-parseLicenseTable.php');
37 require_once(
'../testClasses/parseFolderPath.php');
38 require_once(
'../commonTestFuncs.php');
58 $this->host = getHost($URL);
66 'No_license_found' => 6878,
75 'Apache-possibility' => 62,
76 'See-doc(OTHER)' => 28,
77 'Debian-SPI-style' => 34,
81 'Trademark-ref' => 25,
83 'UnclassifiedLicense' => 28,
84 'GPL-exception' => 24,
91 'GPL-possibility' => 1,
92 'Public-domain' => 20,
93 'Non-commercial!' => 6,
95 'ATT-possibility' => 6,
103 'Public-domain-ref' => 4,
104 'Perl-possibility' => 4,
108 'NOT-public-domain' => 10,
110 'CMU-possibility' => 2,
115 'Open-Publication_v1.0' => 2,
117 'AGFA(RESTRICTED)' => 1,
120 'ATT-Source_v1.2d' => 1,
121 'BSD-possibility' => 1,
124 'HP-possibility' => 1,
126 'GPL-Bison-exception' => 1,
127 'LGPL-possibility' => 1,
129 'MacroMedia-RPSL' => 1,
130 'Microsoft-possibility' => 1,
133 'RedHat(Non-commercial)' => 1,
134 'Same-license-as' => 1,
135 'See-file(COPYING)' => 1,
138 'Sun-possibility' => 1,
139 'Sun(RESTRICTED)' => 1,
140 'TeX-exception' => 1,
141 'U-Wash(Free-Fork)' => 1,
146 $licenseSummary = array(
147 'Unique licenses' => 71,
148 'Licenses found' => 3328,
149 'Files with no licenses' => 6878,
154 print
"starting testRHEL\n";
156 $name =
'RedHat.tar.gz';
157 $safeName = escapeDots($name);
159 $page = $this->mybrowser->clickLink(
'Browse');
160 $page = $this->mybrowser->clickLink(
'Testing');
161 $this->assertTrue($this->myassertText($page,
"/$safeName/"),
162 "verifyRedHat FAILED! did not find $safeName\n");
167 $page = $this->mybrowser->clickLink($name);
168 $this->assertTrue($this->myassertText($page,
"/1 item/"),
169 "verifyRedHat FAILED! 1 item not found\n");
170 $page = $this->mybrowser->clickLink(
'RedHat.tar');
172 $page = $this->mybrowser->clickLink(
'RedHat/');
174 $this->assertTrue($this->myassertText($page,
"/65 items/"),
175 "verifyRedHat FAILED! '65 items' not found\n");
177 $miniMenu = $mini->parseMiniMenu();
179 $url = makeUrl($this->host, $miniMenu[
'License Browser']);
180 if($url === NULL) { $this->fail(
"verifyRedHat Failed, host/url is not set"); }
182 $page = $this->mybrowser->get($url);
184 $this->assertTrue($this->myassertText($page,
'/License Browser/'),
185 "verifyRedHat FAILED! License Browser Title not found\n");
189 $licSummary->parseLicenseTbl();
191 print
"verifying summaries....\n";
192 foreach ($licSummary->hList as $summary)
195 $key = $summary[
'textOrLink'];
197 $this->assertEqual($licenseSummary[$key], $summary[
'count'],
198 "verifyRedHat FAILED! $key does not equal $licenseSummary[$key],
199 Expected: {$licenseSummary[$key]},
200 Got: $summary[count]\n");
206 $licHistogram->parseLicenseTbl();
208 if($licHistogram->noRows === TRUE)
210 $this->fail(
"FATAL! no table rows to process, there should be many for"
211 .
" this test, Stopping the test");
223 foreach($licHistogram->hList as $licFound)
225 $key = $licFound[
'textOrLink'];
228 if(array_key_exists($key,$licBaseLine))
231 $this->assertEqual($licBaseLine[$key], $licFound[
'count'],
232 "verifyRedHat FAILED! the baseline count {$licBaseLine[$key]} does" .
233 " not equal {$licFound['count']} for license $key,\n" .
234 "Expected: {$licBaseLine[$key]},\n" .
235 " Got: {$licFound['count']}\n");
239 $this->fail(
"verifyRedHat FAILED! A License was found that is " .
240 "not in the standard:\n$key\n");
Login($User=NULL, $Password=NULL)