27 require_once(
'../../../tests/fossologyTestCase.php');
28 require_once(
'../../../tests/commonTestFuncs.php');
29 require_once(
'../../../tests/TestEnvironment.php');
30 require_once(
'../../../tests/testClasses/parseMiniMenu.php');
31 require_once(
'../../../tests/testClasses/parseFolderPath.php');
32 require_once(
'../../../tests/testClasses/dom-parseLicenseTable.php');
56 $name =
'foss23D1F1L.tar.bz2';
57 $safeName = escapeDots($name);
58 $this->host = getHost($URL);
62 $page = $this->mybrowser->get($URL);
63 $page = $this->mybrowser->clickLink(
'Browse');
64 $this->assertTrue($this->myassertText($page,
'/Browse/'),
65 "verify23D1F1L FAILED! Could not find Browse menu\n");
66 $page = $this->mybrowser->clickLink(
'Testing');
67 $this->assertTrue($this->myassertText($page,
'/Testing/'),
68 "verify23D1F1L FAILED! Could not find Testing folder\n");
69 $result = $this->myassertText($page,
"/$name/");
70 if(!($result)) { exit(FALSE); }
73 function testVerifyFossology()
79 $licenseSummary = array(
80 'Unique licenses' => 1,
81 'Licenses found' => 1,
82 'Files with no licenses' => 0,
86 print
"starting VerifyFoss23D1F1L test\n";
87 $page = $this->mybrowser->clickLink(
'Browse');
88 $this->assertTrue($this->myassertText($page,
'/Browse/'),
89 "verify23D1F1L FAILED! Could not find Browse menu\n");
90 $page = $this->mybrowser->clickLink(
'Testing');
92 $this->assertTrue($this->myassertText($page,
"/Browse/"),
93 "verify23D1F1L FAILED! Browse Title not found\n");
94 $this->assertTrue($this->myassertText($page,
"/$safeName/"),
95 "verify23D1F1L FAILED! did not find $name\n");
96 $this->assertTrue($this->myassertText($page,
"/>View</"),
97 "verifyfoss23D1F1L FAILED! >View< not found\n");
98 $this->assertTrue($this->myassertText($page,
"/>Info</"),
99 "verifyFoss23D1F1L FAILED! >Info< not found\n");
100 $this->assertTrue($this->myassertText($page,
"/>Download</"),
101 "verifyFoss23D1F1L FAILED! >Download< not found\n");
104 $page = $this->mybrowser->clickLink($name);
106 $this->assertTrue($this->myassertText($page,
"/foss23Dirs1File1Lic\//"),
107 "verifyfoss23D1F1L FAILED! 'foss23Dirs1File1Lic/' not found\n");
108 $this->assertTrue($this->myassertText($page,
"/1 item/"),
109 "verifyfoss23D1F1L FAILED! '1 item' not found\n");
112 $page = $this->mybrowser->clickLink(
'foss23Dirs1File1Lic/');
115 $this->assertTrue($this->myassertText($page,
"/9 items/"),
116 "verifyfoss23D1F1L FAILED! '9 items' not found\n");
117 $this->assertTrue($this->myassertText($page,
"/agents/"),
118 "verify23D1F1L FAILED! did not find 'agents' directory\n");
119 $this->assertTrue($this->myassertText($page,
"/scheduler/"),
120 "verify23D1F1L FAILED! did not find scheduler directory\n");
124 $miniMenu = $mini->parseMiniMenu();
125 $url = makeUrl($this->host, $miniMenu[
'Nomos License']);
126 if($url === NULL) { $this->fail(
"verify23D1F1L Failed, host is not set"); }
128 $page = $this->mybrowser->get($url);
130 $this->assertTrue($this->myassertText($page,
'/Nomos License Browser/'),
131 "verify23D1F1L FAILED! License Browser Title not found\n");
135 $licSummary->parseLicenseTbl();
137 foreach ($licSummary->hList as $summary) {
138 $key = $summary[
'textOrLink'];
139 $this->assertEqual($licenseSummary[$key], $summary[
'count'],
140 "verifyFossDirsOnly FAILED! $key does not equal $licenseSummary[$key], 141 got $summary[count]\n");
147 $licHisto->parseLicenseTbl();
148 if(empty($licHisto->hList)) {
149 $this->fail(
"FATAL! table with id=lichistogram was not found on 150 the page, nothing to process, stopping test\n");
154 $gplv2URL = makeUrl($this->host, $licHisto->hList[1][
'showLink']);
155 $page = $this->mybrowser->get($gplv2URL);
157 $tblList = $licFileList->parseFolderPath();
158 $fileCnt = count($tblList);
159 print
"Checking the number of files based on 'GPL_v2'\n";
160 $this->assertTrue($fileCnt == 1,
161 "FAILURE! Should only have 1 file with a GPL_v2 license: " .
162 "Testing/foss23D1F1L.bz2/foss23Dirs1File1Lic/cli/cp2foss.php, " .
Login($User=NULL, $Password=NULL)