FOSSology  4.4.0
Open Source License Compliance by Open Source Software
fossologyTestCase Class Reference

Inherits fossologyTest.

Inherited by AddUserTest, BasicFolderTest, CreateDeleteFldrTest, CreateFolderTest, DeleteFolderTest, DupFolderTest, DupUploadTest, DupUserTest, EditFolderDescriptionOnlyTest, EditFolderNameOnlyTest, EditFolderTest, EmailUserTest, FoldersCreateMenuTest, FoldersDeleteMenuTest, FoldersEditMenuTest, FoldersMoveMenuTest, MoveFolderTest, MoveFolderTest, OneShotTablegplv21Test, OneShotgplv21Test, SearchMenuTest, TestAboutMenu, TestRepoLogin, UploadFileMenuTest, UploadFileTest, UploadInstructMenuTest, UploadOneShotMenuTest, UploadServerMenuTest, UploadSrvTest, UploadUrlMenuTest, UploadUrlTest, UploadsDeleteMenuTest, UploadsMoveMenuTest, browseUPloadedTest, cleanupRF, cleanupTestData, createSuiUsers, createUIUsers, myFirstTest, noEmailUserTest, rhelTest, runMyTest, someTest, uploadSrvDirTest, uploadSrvFileTest, uploadTestDataTest, uploadTestDataTest, uploadUnpack, uploadWEMailTest, uploadWoutEMailTest, userEditAnyTest, verify23D1F1L, verify23D1F1L, verify23D1F1L, verifyDirsOnly, verifyDirsOnly, verifyDirsOnly, verifyFossolyTest, verifyFossolyTest, verifyFossolyTest, verifySimpletest, verifySimpletest, and zendTest.

Collaboration diagram for fossologyTestCase:
Collaboration graph

Public Member Functions

 addUser ($UserName, $Description=NULL, $Email=NULL, $Access=1, $Folder=1, $Password=NULL, $EmailNotify='y')
 
 checkEmailNotification ($number)
 
 createFolder ($parent, $name, $description=null)
 
 deleteFolder ($folder)
 
 deleteUpload ($upload)
 
 deleteUser ($User)
 
 editFolder ($folder, $newName, $description=null)
 
 editUser ($UserName, $Description=NULL, $Email=NULL, $Access=1, $Folder=1, $Block=NULL, $Blank=NULL, $Password=NULL, $EmailNotify='y')
 
 moveUpload ($oldFolder, $destFolder, $upload)
 
 mvFolder ($folder, $destination)
 
 fillGroupForm ($groupName, $user)
 
 uploadFile ($parentFolder, $uploadFile, $description=null, $uploadName=null, $agents=null)
 
 uploadServer ($parentFolder, $uploadPath, $description=null, $uploadName=null, $agents=null)
 
 uploadUrl ($parentFolder, $url, $description=null, $uploadName=null, $agents=null)
 
 wait4jobs ()
 
 dbCheck ()
 
 jobsSummary ()
 
 jobsDetail ()
 
 oneShotLicense ()
 
 rmLicAnalysis ()
 
- Public Member Functions inherited from fossologyTest
 getBrowser ()
 
 getCookie ()
 
 getPassword ()
 
 getUser ()
 
 setBrowser ($browser)
 
 setmyCookie ($cookie)
 
 setPassword ($password)
 
 setUser ($user)
 
 pmm ($test)
 
 plt ($test)
 
 createTestFolder ($name, $parent='root')
 
 getFolderId ($folderName, $page, $selectName)
 
 getUploadId ($uploadName, $page, $selectName)
 
 Login ($User=NULL, $Password=NULL)
 
 Logout ($User=NULL)
 
 myassertText ($page, $pattern)
 
 parseSelectStmnt ($page, $selectName, $optionText=NULL)
 
 parseFossjobs ($all=NULL)
 
 setAgents ($agents=NULL)
 

Public Attributes

 $mybrowser
 
 $debug
 
 $webProxy
 
- Public Attributes inherited from fossologyTest
 $mybrowser
 
 $cookie
 
 $debug
 

Protected Member Functions

 setUserFields ($UserName=NULL, $Description=NULL, $Email=NULL, $Access=1, $Folder=1, $Block=NULL, $Blank=NULL, $Password=NULL, $EmailNotify=NULL, $BucketPool=1, $Ui='simple')
 
- Protected Member Functions inherited from fossologyTest
 _browser ()
 
 getSelectAttr ($page, $selectName)
 
 setSelectAttr ($page, $selectName, $attribute, $value=NULL)
 

Additional Inherited Members

- Protected Attributes inherited from fossologyTest
 $User = NULL
 

Detailed Description

fossologyTestCase

Base class for all fossology tests. All fossology tests should extend this class. This class contains methods to interact with the fossology UI menus and forms.

Definition at line 31 of file fossologyTestCase.php.

Member Function Documentation

◆ addUser()

fossologyTestCase::addUser (   $UserName,
  $Description = NULL,
  $Email = NULL,
  $Access = 1,
  $Folder = 1,
  $Password = NULL,
  $EmailNotify = 'y' 
)

addUser

Create a Fossology user

Parameters
string$UserNamethe user name
string$Descriptiona description of the user
string$Emailthe email address for the user
int$Access,theaccess level for the user, valid values are: 0,1,2,3,4,5,6,7,10.
string$Folder,thefolder for the user....can be a 'number'
string$Passwordthe password for the user
string$EmailNotifyeither null or 'y'. Default is 'y'.
Returns
null on success, prints error on fail.

Definition at line 53 of file fossologyTestCase.php.

◆ checkEmailNotification()

fossologyTestCase::checkEmailNotification (   $number)

checkEmailNotification

Verify that the user got the email they were supposed to and that it said all the jobs finished without errors.

Parameters
int$numberis the number of emails that should have been received @TODO actually write code that uses the number!
Returns
NULL on success, array on failure: The array will with contain an error message starting with the string ERROR! or it will contain a list of non compliant email headers.

NOTE: this test uses the function getMailSubjects, which will fail:

  • if the user running this test is not the same user as the mail file being checked, /var/mail/<user-name> is only readable by that user-name.

@TODO use exceptions here, so you can indicated the correct item.

Definition at line 106 of file fossologyTestCase.php.

◆ createFolder()

fossologyTestCase::createFolder (   $parent,
  $name,
  $description = null 
)

createFolder Uses the UI 'Create' menu to create a folder. Always creates a default description. To change the default descritpion, pass a description in.

Assumes the caller is already logged into the Repository

Parameters
string$parentthe parent folder name the folder will be created as a child of the parent folder. If no name is supplied the root folder will be used for the parent folder.
string$namethe name of the folder to be created
string$descriptionOptional user defined description, a default description is always created.
Returns
exists with failure or returns folder id.

Definition at line 176 of file fossologyTestCase.php.

◆ deleteFolder()

fossologyTestCase::deleteFolder (   $folder)

deleteFolder

Remove a folder and all its contents. This is a very dangerous method. It does not check who the parent is... so don't have duplicate folder names. This method works for testing as we don't have duplicate folder names (yet). When we do, this routine will have to talk to the db.

Parameters
string$folderthe name of the folder to remove. Only leaf folder names.
Returns
boolean

Definition at line 242 of file fossologyTestCase.php.

◆ deleteUpload()

fossologyTestCase::deleteUpload (   $upload)

deleteUpload

delete an uploaded file under the root folder.

This method can only remove uploads under the root folder. It does not talk to the db (yet) so can only 'see' the root folder. All other uploads stored in subfolders have their pages dyamically generated by javascript.

Parameters
string$uploadthe upload name to delete.
Returns
boolean

Definition at line 274 of file fossologyTestCase.php.

◆ deleteUser()

fossologyTestCase::deleteUser (   $User)

Delete a fossology user

Parameters
string$User,theuser name to remove

Definition at line 298 of file fossologyTestCase.php.

◆ editFolder()

fossologyTestCase::editFolder (   $folder,
  $newName,
  $description = null 
)

editFolder

Parameters
string$folderthe folder to edit
string$newNamethe new name for the folder
string$descriptionOptional description, default description is always created, to overide the default, supply a descrtion.

Assumes that the caller has already logged in.

Definition at line 338 of file fossologyTestCase.php.

◆ editUser()

fossologyTestCase::editUser (   $UserName,
  $Description = NULL,
  $Email = NULL,
  $Access = 1,
  $Folder = 1,
  $Block = NULL,
  $Blank = NULL,
  $Password = NULL,
  $EmailNotify = 'y' 
)

addUser

Edit a Fossology user

Parameters
string$UserNamethe user name
string$Descriptiona description of the user
string$Emailthe email address for the user
int$Access,theaccess level for the user, valid values are: 0,1,2,3,4,5,6,7,10.
string$Folder,thefolder for the user....can be a 'number'
string$Block,checkbox for blocking user, default is NULL
string$Blankcheck box for blanking the users account, default is NULL
string$Passwordthe password for the user
string$EmailNotifyeither null or 'y'. Default is 'y'.
Returns
null on success, prints error on fail.

Definition at line 383 of file fossologyTestCase.php.

◆ fillGroupForm()

fossologyTestCase::fillGroupForm (   $groupName,
  $user 
)

fillGroupForm($groupName, $user) \breif fill in the manage group fields

Parameters
string$groupNamethe name of the group to create
string$userthe user who will admin the group.
Returns
NULL on success, string on error

Definition at line 509 of file fossologyTestCase.php.

◆ moveUpload()

fossologyTestCase::moveUpload (   $oldFolder,
  $destFolder,
  $upload 
)

moveUpload($oldfFolder, $destFolder, $upload)

NOTE: this routine was never finished, the screen uses java script. SO only items in the root folder can be moved....

@TODO fix so it only does thnigs with the root folder :)

Moves an upload from one folder to another. Assumes the caller has logged in.

Parameters
string$oldFolderthe folder name where the upload currently is stored.
string$destFolderthe folder where the updload will be moved to. If no folder specified, then the root folder will be used.
string$uploadThe upload to move

Definition at line 426 of file fossologyTestCase.php.

◆ mvFolder()

fossologyTestCase::mvFolder (   $folder,
  $destination 
)

mvFolder

Move a folder via the UI

Parameters
string$folderthe folder name to move.
string$destinationthe destination folder to move the folder to. Default is the root folder.

Definition at line 473 of file fossologyTestCase.php.

◆ setUserFields()

fossologyTestCase::setUserFields (   $UserName = NULL,
  $Description = NULL,
  $Email = NULL,
  $Access = 1,
  $Folder = 1,
  $Block = NULL,
  $Blank = NULL,
  $Password = NULL,
  $EmailNotify = NULL,
  $BucketPool = 1,
  $Ui = 'simple' 
)
protected

setUserFields

utility function for the user methods.

Parameters
$UserName
$Description
$Email
int$Access
int$Folder
$Block
$Blank
$Password
$EmailNotify
int$BucketPool
string$Ui
Returns
NULL on pass, string on failure (for now only returns NULL)

Definition at line 563 of file fossologyTestCase.php.

◆ uploadFile()

fossologyTestCase::uploadFile (   $parentFolder,
  $uploadFile,
  $description = null,
  $uploadName = null,
  $agents = null 
)

uploadFile ($parentFolder,$uploadFile,$description=null,$uploadName=null,$agents=null)

Upload a file and optionally schedule the agents.

Parameters
string$parentFolderthe parent folder name, default is root folder (1)
string$uploadFilethe path to the file to upload
string$description,=nulloptonal description
string$uploadName,=nulloptional upload name
Todo:
add ability to specify uploadName
Returns
pass or fail

Definition at line 717 of file fossologyTestCase.php.

◆ uploadServer()

fossologyTestCase::uploadServer (   $parentFolder,
  $uploadPath,
  $description = null,
  $uploadName = null,
  $agents = null 
)

uploadServer ($parentFolder,$uploadPath,$description=null,$uploadName=null,$agents=null)

Upload a file and optionally schedule the agents. The web-site must already be logged into before using this method.

Parameters
string$parentFolderthe parent folder name, default is root folder (1)
string$uploadPaththe path to upload data, can be a file or directory
string$descriptiona default description is always used. It can be overridden by supplying a description.
string$uploadName,=nulloptional upload name
string$agents,=nullagents to schedule
Returns
pass or fail

@TODO determine if setting alpha folders is worth it. Right now this routine does not use them.....

Definition at line 793 of file fossologyTestCase.php.

◆ uploadUrl()

fossologyTestCase::uploadUrl (   $parentFolder,
  $url,
  $description = null,
  $uploadName = null,
  $agents = null 
)

function uploadUrl ($parentFolder,$uploadFile,$description=null,$uploadName=null,$agents=null)

Upload a file and optionally schedule the agents. The web-site must already be logged into before using this method.

Parameters
string$parentFolderthe parent folder name, default is root folder (1)
string$urlthe url of the file to upload, no url sanity checking is done.
string$descriptiona default description is always used. It can be overridden by supplying a description.
string$uploadName,=nulloptional upload name
string$agents,=nullagents to schedule, the default is to schedule license, pkgettametta, and mime.
Returns
pass or fail

Definition at line 868 of file fossologyTestCase.php.

◆ wait4jobs()

fossologyTestCase::wait4jobs ( )

wait4jobs

Are there any jobs running?

Wait for 2 hours for the test jobs to finish, check every 5 minutes to see if they are done.

Returns
boolean TRUE/FALSE
Version
"$Id: fossologyTestCase.php 4020 2011-03-31 21:30:29Z rrando $"

@TODO: make a general program that can wait an arbitrary time, should also allow for an interval, e.g. check for 2 hours every 7 min.

Created on Jan. 15, 2009

Definition at line 943 of file fossologyTestCase.php.


The documentation for this class was generated from the following file: