glideinwms.unittests package¶
Submodules¶
glideinwms.unittests.profile_frontend module¶
- class glideinwms.unittests.profile_frontend.FakeLogger(afile=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>)[source]¶
Bases:
object
Super simple logger for the unittests
glideinwms.unittests.test_OSG_autoconf module¶
glideinwms.unittests.test_cleanupSupport module¶
- Project:
glideinWMS
- Description:
unit test for glideinwms/lib/cleanupSupport.py
- Author:
tiradani: <tiradani@fnal.gov>
- class glideinwms.unittests.test_cleanupSupport.TestCleanupSupport(methodName='runTest')[source]¶
Bases:
TestCase
Test the cleaners to ensure that only the files that we want to be deleted are.
- check_for_cleanup_files()[source]¶
Get a directory listing of the reference directory excluding all files except the cleanup files.
@return: Number in cleanup files found
- check_for_noncleanup_files()[source]¶
Get a directory listing of the cleanup directory excluding all files except the non-cleanup files.
@return: Number in non-cleanup files found
- create_cleanup_tempfiles()[source]¶
Call the create_files function with the appropriate suffix to denote files that should be cleaned up.
- create_files(number_of_files, suffix='')[source]¶
Create temporary files using the tempfile module. The absolute path toThe file extension to place on the temporary file the file is written to the file for content.
@type number_of_files: int @param number_of_files: The number of temporary files to create @type file_suffix: string @param file_suffix: The file extension to place on the temporary file
- create_noncleanup_tempfiles()[source]¶
Call the create_files function with the appropriate suffix to denote files that should not be cleaned up.
- setUp()[source]¶
The cleanupSupport module logs so implement the FakeLogger so that things don’t break. We will create a bunch of files to cleanup and a bunch to keep around.
- test_DirCleanupWSpace()[source]¶
Instantiate the directory cleaner and direct it to clean all cleanup files with the cleanup extension. After teh cleanup method has been called, check for the presence of cleanup files. Fail if any exist. Also check for the presence of the other files created. Fail if any were deleted.
glideinwms.unittests.test_creation_lib_cWDictFile_DictFile module¶
Unit test for DictFile object from glideinwms/creation/lib/cWDictFile.py
glideinwms.unittests.test_creation_lib_cWDictFile_DictFileTwoKeys module¶
- Project:
glideinWMS
- Description:
unit test for DictFileTwoKeys class and friends from glideinwms/creation/lib/cWDictfile
- Author:
Dennis Box dbox@fnal.gov
- class glideinwms.unittests.test_creation_lib_cWDictFile_DictFileTwoKeys.TestDictFileTwoKeys(methodName='runTest')[source]¶
Bases:
TestCase
test class for DictFileTwoKeys from glideinwms/creation/lib/cWDictFile.py TODO File cWDictFile.py is 1700 lines long and contains too many classes. It should be split up
glideinwms.unittests.test_creation_lib_cWDictFile_DictFileTwoKeys_SubClasses module¶
- Project:
glideinWMS
- Description:
unit test for subclasses of DictFileTwoKeys in glideinwms/creation/lib/cWDictFile.py
- Author:
Dennis Box dbox@fnal.gov
- class glideinwms.unittests.test_creation_lib_cWDictFile_DictFileTwoKeys_SubClasses.TestDescriptionDictFile(methodName='runTest')[source]¶
Bases:
TestCase
glideinwms.unittests.test_creation_lib_cWDictFile_SHADicts module¶
- Project:
glideinWMS
- Description:
unit test for SHA1DictFile and SummarySHA1DictFile classes in glideinwms/creation/lib/cWDictFile.py
- Author:
Dennis Box dbox@fnal.gov
- class glideinwms.unittests.test_creation_lib_cWDictFile_SHADicts.TestSHA1DictFile(methodName='runTest')[source]¶
Bases:
TestCase
glideinwms.unittests.test_creation_lib_cWDictFile_validate_node module¶
- Project:
glideinWMS
- Description:
unit test for validate_node from glideinwms/creation/lib/cWDictfile
- Author:
Dennis Box dbox@fnal.gov
glideinwms.unittests.test_creation_lib_cgWConsts module¶
- class glideinwms.unittests.test_creation_lib_cgWConsts.TestGetEntryLogDir(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWConsts.TestGetEntryMonitorDir(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWConsts.TestGetEntryNameFromEntryMonitorDir(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWConsts.TestGetEntryNameFromEntryStageDir(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWConsts.TestGetEntryNameFromEntrySubmitDir(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWConsts.TestGetEntryStageDir(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWConsts.TestGetEntrySubmitDir(methodName='runTest')[source]¶
Bases:
TestCase
glideinwms.unittests.test_creation_lib_cgWCreate module¶
Unit test of glideinwms/creation/lib/cgWCreate.py
glideinwms.unittests.test_creation_lib_cgWDictFile module¶
Project: glideinwms File: test_creation_lib_cgWDictFile.py Purpose: unit test of glideinwms/creation/lib/cgWDictFile.py Author: Dennis Box, dbox@fnal.gov
- class glideinwms.unittests.test_creation_lib_cgWDictFile.TestBaseClientDirSupport(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWDictFile.TestChmodClientDirSupport(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWDictFile.TestClientDirSupport(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWDictFile.TestClientLogDirSupport(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWDictFile.TestClientProxiesDirSupport(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWDictFile.TestClientSymlinksSupport(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWDictFile.TestCondorJDLDictFile(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWDictFile.TestGlideinDicts(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWDictFile.TestGlideinEntryDicts(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWDictFile.TestGlideinMainDicts(methodName='runTest')[source]¶
Bases:
TestCase
glideinwms.unittests.test_creation_lib_cgWParamDict module¶
- Project:
glideinWMS
- Description:
unit test for glideinwms/creation/lib/cgWParamDict.py
- Author:
Dennis Box, dbox@fnal.gov
- class glideinwms.unittests.test_creation_lib_cgWParamDict.TeOBstAddAttrUnparsed(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWParamDict.TestAddAttrUnparsedReal(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWParamDict.TestAddFileUnparsed(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWParamDict.TestCalcMonitoringCollectorsString(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWParamDict.TestCalcPrimaryMonitoringCollectors(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWParamDict.TestGetValidCondorTarballs(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWParamDict.TestGlideinDicts(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWParamDict.TestIterToDict(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWParamDict.TestItertoolsProduct(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWParamDict.TestOldGetValidCondorTarballs(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWParamDict.TestPopulateFactoryDescript(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWParamDict.TestPopulateFrontendDescript(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cgWParamDict.TestPopulateGridmap(methodName='runTest')[source]¶
Bases:
TestCase
glideinwms.unittests.test_creation_lib_cgWParams module¶
- Project:
glideinWMS
- Description:
unit test for glideinwms/creation/lib/cgWParams.py
- Author:
Dennis Box dbox@fnal.gov
glideinwms.unittests.test_creation_lib_cvWConsts module¶
- Project:
glideinWMS
- Description:
unit test for glideinwms/creation/lib/cvWConsts.py
- Author:
Dennis Box dbox@fnal.gov
- class glideinwms.unittests.test_creation_lib_cvWConsts.TestGetGroupLogDir(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cvWConsts.TestGetGroupMonitorDir(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cvWConsts.TestGetGroupNameFromGroupMonitorDir(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cvWConsts.TestGetGroupNameFromGroupStageDir(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cvWConsts.TestGetGroupNameFromGroupWorkDir(methodName='runTest')[source]¶
Bases:
TestCase
glideinwms.unittests.test_creation_lib_cvWCreate module¶
Unit test for glideinwms/creation/lib/cvWCreate.py
glideinwms.unittests.test_creation_lib_cvWParamDict module¶
Unit test for glideinwms/creation/lib/cvWParamDict.py
- class glideinwms.unittests.test_creation_lib_cvWParamDict.TestCalcGlideinCcbs(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cvWParamDict.TestCalcGlideinCollectors(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cvWParamDict.TestFrontendDicts(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cvWParamDict.TestFrontendGroupDicts(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cvWParamDict.TestFrontendMainDicts(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cvWParamDict.TestGetPoolList(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cvWParamDict.TestPopulateCommonDescript(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cvWParamDict.TestPopulateGroupDescript(methodName='runTest')[source]¶
Bases:
TestCase
glideinwms.unittests.test_creation_lib_cvWParams module¶
- Project:
glideinWMS
- Description:
unit test for glideinwms/creation/lib/cvWParams.py
- Author:
Dennis Box dbox@fnal.gov
- class glideinwms.unittests.test_creation_lib_cvWParams.TestExtractAttrVal(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_cvWParams.TestVOFrontendParams(methodName='runTest')[source]¶
Bases:
TestCase
glideinwms.unittests.test_creation_lib_factoryXmlConfig module¶
- Project:
glideinWMS
- Description:
unit test for glideinwms/creation/factoryXmlConfig.py
- Author:
Dennis Box dbox@fnal.gov
- class glideinwms.unittests.test_creation_lib_factoryXmlConfig.TestCondTarElement(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_factoryXmlConfig.TestConfig(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_factoryXmlConfig.TestEntryElement(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_factoryXmlConfig.TestEntrySetElement(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_factoryXmlConfig.TestFactAttrElement(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_creation_lib_factoryXmlConfig.TestFactFileElement(methodName='runTest')[source]¶
Bases:
TestCase
glideinwms.unittests.test_factory_glideFactoryConfig module¶
- Project:
glideinWMS
- Purpose:
unit test for glideinwms/factory/glideFactoryConfig.py
- Author:
Dennis Box, dbox@fnal.gov
glideinwms.unittests.test_factory_glideFactoryEntry module¶
- Project:
glideinWMS
- Purpose:
unit test of glideinwms/factory/glideFactoryEntry.py
- Author:
Dennis Box, dbox@fnal.gov
- class glideinwms.unittests.test_factory_glideFactoryEntry.TestCheckAndPerformWork(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryEntry.TestEntry(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryEntry.TestPerformWorkV3(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryEntry.TestTermsignal(methodName='runTest')[source]¶
Bases:
TestCase
glideinwms.unittests.test_factory_glideFactoryLib module¶
Unit test for glideinwms/factory/glideFactoryLib.py
- class glideinwms.unittests.test_factory_glideFactoryLib.TestCleanGlideinQueue(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestClientWeb(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestDays2sec(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestDiffList(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestEscapeParam(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestExecuteSubmit(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractHeldSimple(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractIdleQueued(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractIdleSimple(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractIdleUnsubmitted(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractJobId(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractNonRunSimple(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractRecoverableHeldSimple(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractRecoverableHeldSimpleWithinLimits(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractRunSimple(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractRunStale(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractStaleSimple(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractUnrecoverableHeldForceX(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractUnrecoverableHeldSimple(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestFactoryConfig(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestGetStatusGlideidx(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestGetSubmitEnvironment(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestGlideinTotals(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestGroupUnclaimed(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestHashStatus(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestHashStatusStale(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestHrs2sec(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestInSubmitEnvironment(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestIsGlideinHeldNTimes(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestIsGlideinUnrecoverable(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestIsGlideinWithinHeldLimits(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestKeepIdleGlideins(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestLogStats(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestLogWorkRequest(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestPickSubmitFile(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestReleaseGlideins(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestRemoveGlideins(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestSanitizeGlideins(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestScheddName2str(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestSetCondorIntegrityChecks(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_factory_glideFactoryLib.TestSubmitGlideins(methodName='runTest')[source]¶
Bases:
TestCase
glideinwms.unittests.test_factory_glideFactoryLogParser module¶
glideinwms.unittests.test_frontend module¶
Unit test for glideinwms/creation/lib/cgWConsts.py
- class glideinwms.unittests.test_frontend.FETestCaseBase(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_frontend.FETestCaseCondorQ(methodName='runTest')[source]¶
Bases:
FETestCaseBase
- class glideinwms.unittests.test_frontend.FETestCaseCondorStatus(methodName='runTest')[source]¶
Bases:
FETestCaseBase
- class glideinwms.unittests.test_frontend.FETestCaseCount(methodName='runTest')[source]¶
Bases:
FETestCaseBase
- class glideinwms.unittests.test_frontend.FETestCaseMisc(methodName='runTest')[source]¶
Bases:
FETestCaseBase
glideinwms.unittests.test_frontend_element module¶
Unit test for glideinwms/frontend/glideinFrontendElement
- class glideinwms.unittests.test_frontend_element.FEElementTestCase(methodName='runTest')[source]¶
Bases:
TestCase
- test_populate_pubkey()[source]¶
test that good public keys get populated and bad public keys get removed
- test_some_iterate_one_artifacts()[source]¶
- Mock our way into glideinFrontendElement:iterate_one() to test if
- glideinFrontendElement.glidein_dict[‘entry_point’][‘attrs’][‘GLIDEIN_REQUIRE_VOMS’]
and
glideinFrontendElement.glidein_dict[‘entry_point’][‘attrs’][‘GLIDEIN_In_Downtime’]
are being evaluated correctly
- glideinwms.unittests.test_frontend_element.bounded_fork_and_collect_side_effect()[source]¶
populate data structures in glideinFrontendElement::do_match from json artifact in fixtures
- glideinwms.unittests.test_frontend_element.fork_and_collect_side_effect()[source]¶
populate data structures in glideinFrontendElement::iterate_one from json artifact in fixtures
- glideinwms.unittests.test_frontend_element.log_exception_side_effect(*args, **kwargs)[source]¶
keep logSupport.log.exception data in an array so we can search it later
- glideinwms.unittests.test_frontend_element.log_info_side_effect(*args, **kwargs)[source]¶
keep logSupport.log.info data in an array so we can search it later
- glideinwms.unittests.test_frontend_element.refresh_entry_token_side_effect(*args, **kwargs)[source]¶
place holder, needs more token testing stuff here
- glideinwms.unittests.test_frontend_element.uni_to_str_JSON(obj)[source]¶
on some machines jsonpickle.decode() returns unicode strings and on others it returns ascii strings from the same data. The objects being tested here expect python strings, so convert them if necessary. I am sure there is a better way to do this.
glideinwms.unittests.test_frontend_glideinFrontendConfig module¶
- Project:
glideinWMS
- Description:
unit test for glideinwms/frontend/glideinFrontendConfig
- Author:
Dennis Box <dbox@fnal.gov>
- class glideinwms.unittests.test_frontend_glideinFrontendConfig.TestExtStageFiles(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_frontend_glideinFrontendConfig.TestFrontendConfig(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_frontend_glideinFrontendConfig.TestHistoryFile(methodName='runTest')[source]¶
Bases:
TestCase
glideinwms.unittests.test_frontend_glideinFrontendElement module¶
Unit test for glideinwms/frontend/glideinFrontendElement.py
- class glideinwms.unittests.test_frontend_glideinFrontendElement.TestCheckParent(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_frontend_glideinFrontendElement.TestCounterWrapper(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_frontend_glideinFrontendElement.TestGlideinFrontendElement(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_frontend_glideinFrontendElement.TestLogAndSumFactoryLine(methodName='runTest')[source]¶
Bases:
TestCase
glideinwms.unittests.test_glideFactoryDowntimeLib module¶
Unit test for glideinwms/factory/glideFactoryDowntimeLib.py
glideinwms.unittests.test_glideinFrontendPlugins module¶
- Project:
glideinWMS
- Description:
unit tests for glideinwms/frontend/glideinFrontendPlugins.py
- Author:
Doug Strain
- class glideinwms.unittests.test_glideinFrontendPlugins.TestPlugins(methodName='runTest')[source]¶
Bases:
TestCase
Test the proxy plugins
glideinwms.unittests.test_lib_DiskCache module¶
- Project:
glideinWMS
- Description:
unit test for glideinwms/creation/lib/cvWParams.py
- Author:
Dennis Box dbox@fnal.gov
glideinwms.unittests.test_lib_condorExe module¶
Unit tests for glideinwms/lib/condorExe.py
- class glideinwms.unittests.test_lib_condorExe.TestCondorExe(methodName='runTest')[source]¶
Bases:
TestCase
- test_exe_cmd()[source]¶
exe_cmd is a wrapper for iexe_cmd. See test_iexe_cmd docstring for full details.
- test_exe_cmd_sbin()[source]¶
exe_cmd_sbin is a wrapper for iexe_cmd. See test_iexe_cmd docstring for full details.
- test_iexe_cmd()[source]¶
Test the iexe_cmd function for errors. There are two sets of worker functions that will be executed. The first set writes 20k lines to stdout and exits normally (exit code: 0). The second also writes 20k lines to stdout, but these exit abnormally (exit code: 1). Both sets of scripts consist of one written in python and one written in shell script (bash).
The original code for iexe_cmd would block if the buffer was filled and EOF wasn’t in the buffer. The code was re-written to handle that use case, but still blocked because the write side could still fill the buffer without appending EOF. There are two solutions. One, give the buffer read command a ridiculously small buffer size (but even that isn’t a guarantee since the read side doesn’t know hat the buffer size should be), or two, make the read buffers non-blocking.
Option two was selected. This unittest tests both the blocking condition and error handling in the function.
glideinwms.unittests.test_lib_disk_cache module¶
- Project:
glideinWMS
- Description:
unit test for glideinwms/creation/lib/cvWParams.py
- Author:
Dennis Box dbox@fnal.gov
glideinwms.unittests.test_lib_exprParser module¶
Unit test for glideinwms/lib/exprParser.py
glideinwms.unittests.test_lib_fork module¶
Unit test for glideinwms/lib/fork.py
- class glideinwms.unittests.test_lib_fork.TestFetchForkResult(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_lib_fork.TestFetchForkResultList(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_lib_fork.TestFetchReadyForkResultList(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_lib_fork.TestForkInBg(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_lib_fork.TestForkManager(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_lib_fork.TestForkResultError(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_lib_fork.TestPrinChildProcesses(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_lib_fork.TestWaitForPids(methodName='runTest')[source]¶
Bases:
TestCase
- glideinwms.unittests.test_lib_fork.global_log_cleanup()[source]¶
Closes all the file handles in LOGDICT. Erases all the log files in LOGDICT unless environment variable SAVE_LOGFILES is defined.
- glideinwms.unittests.test_lib_fork.init_log(file_suffix='test_lib_fork')[source]¶
Initialize a new log file for a test
Args: file_suffix (char):
Creates a file named /tmp/tmp(randchars)_(file_suffix) to be used as a log file. Some of the code being tested forks and creates multiple log files with the naming conventiion above (with different random chars of course) this can be helpful for debugging. A global dictionary LOGDICT keeps track of all the created file names and handles.
glideinwms.unittests.test_lib_logSupport module¶
- Purpose:
test glideinwms/lib/logSupport.py
glideinwms.unittests.test_lib_pubCrypto module¶
Unit test for glideinwms/lib/pubCrypto.py
glideinwms.unittests.test_lib_servicePerformance module¶
- Project:
glideinWMS
- Description:
unit test for glideinwms/lib/servicePerformance.py
- Author:
Dennis Box dbox@fnal.gov
- class glideinwms.unittests.test_lib_servicePerformance.TestGetPerfMetric(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_lib_servicePerformance.TestGetPerfMetricEventLifetime(methodName='runTest')[source]¶
Bases:
TestCase
glideinwms.unittests.test_lib_symCrypto module¶
Unit test for glideinwms/lib/symCrypto.py
- class glideinwms.unittests.test_lib_symCrypto.TestAutoSymKey(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_lib_symCrypto.TestMutableSymKey(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_lib_symCrypto.TestParametrizedSymKey(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_lib_symCrypto.TestSym3DESKey(methodName='runTest')[source]¶
Bases:
TestCase
glideinwms.unittests.test_lib_timeConversion module¶
- Project:
glideinwms
- Purpose:
unit test for glideinwms/lib/timeConversion.python
- Author:
Dennis Box, dbox@fnal.gov
glideinwms.unittests.test_lib_x509Support module¶
- Project:
glideinwms
- Purpose:
unit test of glideinwms/lib/x509Support.py
- Author:
Dennis Box dbox@fnal.gov
glideinwms.unittests.test_lib_xmlParse module¶
- class glideinwms.unittests.test_lib_xmlParse.TestDomel2dict(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_lib_xmlParse.TestGetXMLAttributes(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_lib_xmlParse.TestGetXMLElements(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_lib_xmlParse.TestIsSingularOf(methodName='runTest')[source]¶
Bases:
TestCase
- class glideinwms.unittests.test_lib_xmlParse.TestOrderedDict(methodName='runTest')[source]¶
Bases:
TestCase
glideinwms.unittests.test_renew_proxy module¶
- Project:
glideinWMS
- Purpose:
unit test of glideinwms/frontend/gwms_renew_proxies.py
- Author:
Brian Lin <brianhlin@gmail.com>
- class glideinwms.unittests.test_renew_proxy.TestUtils(methodName='runTest')[source]¶
Bases:
TestCase
Test utility functions in gwms_renew_proxies
glideinwms.unittests.test_tarSupport module¶
- Project:
glideinWMS
- Purpose:
unit test of glideinwms/lib/tarSupport.py
- Author:
Anthony Tiradani <tiradani@fnal.gov>
glideinwms.unittests.test_util module¶
glideinwms.unittests.unittest_utils module¶
- class glideinwms.unittests.unittest_utils.FakeLogger(afile=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>)[source]¶
Bases:
object
Super simple logger for the unittests
- exception glideinwms.unittests.unittest_utils.TestImportError(err_msg='Error')[source]¶
Bases:
Exception
Error handler for import errors in this test suite If import of package listed in handled_import_errors fails, print out hopefully informative message and exit 0
- glideinwms.unittests.unittest_utils.balanced_text(myText)[source]¶
checks line by line that parens and quotations are balanced :param myText: contents of a text file, multi-line string
- Returns:
- string, “Balanced” if no problems found
- ”Unbalanced, line x” if a problem was found
on line x of text
- glideinwms.unittests.unittest_utils.create_temp_file(file_suffix='', file_prefix='tmp', file_dir='/tmp', text_access=True, write_path_to_file=True)[source]¶
- glideinwms.unittests.unittest_utils.runAllTests()[source]¶
We assume that this particular module is in the unittest directory Search the unittest directory for all files matching test_*.py. Attempt to import main() execute main()
What kinds of safety checks do we need here?
- glideinwms.unittests.unittest_utils.runTest(cls)[source]¶
Given a test class, generate and run a test suite
- @param cls: Test class to use to generate a test suite. It is assumed
that the constructor for this class has signature cls(cp, site_name). If per_site=False, then the signature is assumed to be cls().
@type cls: class
Module contents¶
Unittests should be placed in glideinWMS/unittests
- Unittests are branch/tag specific. This allows the unittests to test for
features that a specific tag or branch has but not other branches/tags. Once a feature is merged to head (and/or the current release branch), the corresponding unittest should be merged as well.
- Unless there is a compelling reason, the unittest should never call a binary
outside the glideinWMS codebase. In order to create accurate tests, all inputs should be well defined and “known”. All outputs should be derived from the inputs. If you need output from outside sources, consider creating a “worker script” that returns known sample output. Place the “worker script” in glideinWMS/unittests/worker_scripts.
- All unittest file names must follow the following convention:
test_<your name>.py
unittest_utils.py contains a function that will trigger all unittests that follow the file naming convention.
- All unittests should import unittest_utils. This will setup the appropriate
PYTHON_PATH for glideinWMS. After the unittest import, all other imports can proceed as normal without having to specify or append to PYTHON_PATH.
Note: NMI will separate the unittest location from the source location. It defines $GLIDEINWMS_LOCATION. unittest_utils.py handles this for you.
- All unittests must have the following code appended:
- def main():
return runTest(<Unittest Class>)
- if __name__ == ‘__main__’:
sys.exit(main())
The main function will be executed both when you directly run the unittest and when unittest_utils.runAllTests() funtion is called. Replace <Unittest Class> with the class name.