16 require_once(
'../../../tests/fossologyTestCase.php');
17 require_once(
'../../../tests/commonTestFuncs.php');
18 require_once(
'../../../tests/TestEnvironment.php');
19 require_once(
'../../../tests/testClasses/parseMiniMenu.php');
20 require_once(
'../../../tests/testClasses/parseFolderPath.php');
21 require_once(
'../../../tests/testClasses/dom-parseLicenseTable.php');
45 $name =
'foss23D1F1L.tar.bz2';
46 $safeName = escapeDots($name);
47 $this->host = getHost($URL);
51 $page = $this->mybrowser->get($URL);
52 $page = $this->mybrowser->clickLink(
'Browse');
53 $this->assertTrue($this->myassertText($page,
'/Browse/'),
54 "verify23D1F1L FAILED! Could not find Browse menu\n");
55 $page = $this->mybrowser->clickLink(
'Testing');
56 $this->assertTrue($this->myassertText($page,
'/Testing/'),
57 "verify23D1F1L FAILED! Could not find Testing folder\n");
58 $result = $this->myassertText($page,
"/$name/");
59 if(!($result)) { exit(FALSE); }
62 function testVerifyFossology()
68 $licenseSummary = array(
69 'Unique licenses' => 1,
70 'Licenses found' => 1,
71 'Files with no licenses' => 0,
75 print
"starting VerifyFoss23D1F1L test\n";
76 $page = $this->mybrowser->clickLink(
'Browse');
77 $this->assertTrue($this->myassertText($page,
'/Browse/'),
78 "verify23D1F1L FAILED! Could not find Browse menu\n");
79 $page = $this->mybrowser->clickLink(
'Testing');
81 $this->assertTrue($this->myassertText($page,
"/Browse/"),
82 "verify23D1F1L FAILED! Browse Title not found\n");
83 $this->assertTrue($this->myassertText($page,
"/$safeName/"),
84 "verify23D1F1L FAILED! did not find $name\n");
85 $this->assertTrue($this->myassertText($page,
"/>View</"),
86 "verifyfoss23D1F1L FAILED! >View< not found\n");
87 $this->assertTrue($this->myassertText($page,
"/>Info</"),
88 "verifyFoss23D1F1L FAILED! >Info< not found\n");
89 $this->assertTrue($this->myassertText($page,
"/>Download</"),
90 "verifyFoss23D1F1L FAILED! >Download< not found\n");
93 $page = $this->mybrowser->clickLink($name);
95 $this->assertTrue($this->myassertText($page,
"/foss23Dirs1File1Lic\//"),
96 "verifyfoss23D1F1L FAILED! 'foss23Dirs1File1Lic/' not found\n");
97 $this->assertTrue($this->myassertText($page,
"/1 item/"),
98 "verifyfoss23D1F1L FAILED! '1 item' not found\n");
101 $page = $this->mybrowser->clickLink(
'foss23Dirs1File1Lic/');
104 $this->assertTrue($this->myassertText($page,
"/9 items/"),
105 "verifyfoss23D1F1L FAILED! '9 items' not found\n");
106 $this->assertTrue($this->myassertText($page,
"/agents/"),
107 "verify23D1F1L FAILED! did not find 'agents' directory\n");
108 $this->assertTrue($this->myassertText($page,
"/scheduler/"),
109 "verify23D1F1L FAILED! did not find scheduler directory\n");
113 $miniMenu = $mini->parseMiniMenu();
114 $url = makeUrl($this->host, $miniMenu[
'Nomos License']);
115 if($url === NULL) { $this->fail(
"verify23D1F1L Failed, host is not set"); }
117 $page = $this->mybrowser->get($url);
119 $this->assertTrue($this->myassertText($page,
'/Nomos License Browser/'),
120 "verify23D1F1L FAILED! License Browser Title not found\n");
124 $licSummary->parseLicenseTbl();
126 foreach ($licSummary->hList as $summary) {
127 $key = $summary[
'textOrLink'];
128 $this->assertEqual($licenseSummary[$key], $summary[
'count'],
129 "verifyFossDirsOnly FAILED! $key does not equal $licenseSummary[$key],
130 got $summary[count]\n");
136 $licHisto->parseLicenseTbl();
137 if(empty($licHisto->hList)) {
138 $this->fail(
"FATAL! table with id=lichistogram was not found on
139 the page, nothing to process, stopping test\n");
143 $gplv2URL = makeUrl($this->host, $licHisto->hList[1][
'showLink']);
144 $page = $this->mybrowser->get($gplv2URL);
146 $tblList = $licFileList->parseFolderPath();
147 $fileCnt = count($tblList);
148 print
"Checking the number of files based on 'GPL_v2'\n";
149 $this->assertTrue($fileCnt == 1,
150 "FAILURE! Should only have 1 file with a GPL_v2 license: " .
151 "Testing/foss23D1F1L.bz2/foss23Dirs1File1Lic/cli/cp2foss.php, " .
Login($User=NULL, $Password=NULL)