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

debug(msg, *args)[source]

Pass a debug message to stderr.

Prints out msg % args.

@param msg: A message string. @param args: Arguments which should be evaluated into the message.

error(msg, *args)[source]

Pass an error message to stderr.

@see: debug

exception(msg, *args)[source]

Pass an exception message to stderr.

@see: debug

info(msg, *args)[source]

Pass an info-level message to stderr.

@see: debug

warning(msg, *args)[source]

Pass a warning-level message to stderr.

@see: debug

glideinwms.unittests.profile_frontend.main()[source]
class glideinwms.unittests.profile_frontend.mock_condorq_el(obj)[source]

Bases: object

fetchStored()[source]

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.

tearDown()[source]

remove all remaining files created by tests

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

class glideinwms.unittests.test_creation_lib_cWDictFile_DictFile.TestDictFile(methodName='runTest')[source]

Bases: TestCase

test class for DictFile from glideinwms/creation/lib/cWDictFile.py TODO File cWDictFile.py is 1700 lines long and contains too many classes. It should be split up

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test___getitem__()[source]
test___init__()[source]
test_add()[source]
test_bad_init()[source]
test_erase()[source]
test_file_header()[source]
test_format_val()[source]
test_get_dir()[source]
test_get_filepath()[source]
test_get_fname()[source]
test_has_key()[source]
test_is_compatible()[source]
test_is_equal()[source]
test_parse_val()[source]
test_remove()[source]
test_save()[source]
test_save_into_load_from_fd()[source]
test_save_to_load_from_str()[source]
test_set_readonly()[source]

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

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test___getitem__()[source]
test___init__()[source]
test_add_has_key2_get_val2()[source]
test_add_no_overwrite()[source]
test_erase()[source]
test_file_header()[source]
test_format_val()[source]
test_get_dir()[source]
test_get_filepath()[source]
test_get_fname()[source]
test_has_key()[source]
test_is_compatible()[source]
test_is_compatible2()[source]
test_is_equal()[source]
test_parse_val()[source]
test_remove()[source]
test_save()[source]
test_save_into_load_from_fd()[source]
test_save_to_load_from_str()[source]
test_set_readonly()[source]

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

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_format_val()[source]
test_parse_val()[source]
class glideinwms.unittests.test_creation_lib_cWDictFile_DictFileTwoKeys_SubClasses.TestGridMapDict(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_file_header()[source]
test_format_val()[source]
test_parse_val()[source]

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

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_add_from_file()[source]
test_format_val()[source]
test_init()[source]
test_parse_val()[source]
class glideinwms.unittests.test_creation_lib_cWDictFile_SHADicts.TestSummarySHA1DictFile(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_add()[source]
test_add_from_file()[source]
test_format_val()[source]
test_init()[source]
test_parse_val()[source]

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

class glideinwms.unittests.test_creation_lib_cWDictFile_validate_node.Test_validate_node(methodName='runTest')[source]

Bases: TestCase

test_bad()[source]
test_good()[source]
test_no_dns()[source]
test_range_not_allowed()[source]

glideinwms.unittests.test_creation_lib_cgWConsts module

class glideinwms.unittests.test_creation_lib_cgWConsts.TestGetEntryLogDir(methodName='runTest')[source]

Bases: TestCase

test_get_entry_log_dir()[source]
class glideinwms.unittests.test_creation_lib_cgWConsts.TestGetEntryMonitorDir(methodName='runTest')[source]

Bases: TestCase

test_get_entry_monitor_dir()[source]
class glideinwms.unittests.test_creation_lib_cgWConsts.TestGetEntryNameFromEntryMonitorDir(methodName='runTest')[source]

Bases: TestCase

test_get_entry_name_from_entry_monitor_dir()[source]
class glideinwms.unittests.test_creation_lib_cgWConsts.TestGetEntryNameFromEntryStageDir(methodName='runTest')[source]

Bases: TestCase

test_get_entry_name_from_entry_stage_dir()[source]
class glideinwms.unittests.test_creation_lib_cgWConsts.TestGetEntryNameFromEntrySubmitDir(methodName='runTest')[source]

Bases: TestCase

test_get_entry_name_from_entry_submit_dir()[source]
class glideinwms.unittests.test_creation_lib_cgWConsts.TestGetEntryStageDir(methodName='runTest')[source]

Bases: TestCase

test_get_entry_stage_dir()[source]
class glideinwms.unittests.test_creation_lib_cgWConsts.TestGetEntrySubmitDir(methodName='runTest')[source]

Bases: TestCase

test_get_entry_submit_dir()[source]
class glideinwms.unittests.test_creation_lib_cgWConsts.TestGetEntryUserlogDir(methodName='runTest')[source]

Bases: TestCase

test_get_entry_userlog_dir()[source]
class glideinwms.unittests.test_creation_lib_cgWConsts.TestGetEntryUserproxiesDir(methodName='runTest')[source]

Bases: TestCase

test_get_entry_userproxies_dir()[source]

glideinwms.unittests.test_creation_lib_cgWCreate module

Unit test of glideinwms/creation/lib/cgWCreate.py

class glideinwms.unittests.test_creation_lib_cgWCreate.TestGlideinSubmitDictFile(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_populate()[source]
test_populate_standard_grid()[source]

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

test___init__()[source]
class glideinwms.unittests.test_creation_lib_cgWDictFile.TestChmodClientDirSupport(methodName='runTest')[source]

Bases: TestCase

test___init__()[source]
test_create_dir()[source]
class glideinwms.unittests.test_creation_lib_cgWDictFile.TestClientDirSupport(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test___init__()[source]
test_create_dir()[source]
test_delete_dir()[source]
class glideinwms.unittests.test_creation_lib_cgWDictFile.TestClientLogDirSupport(methodName='runTest')[source]

Bases: TestCase

test___init__()[source]
class glideinwms.unittests.test_creation_lib_cgWDictFile.TestClientProxiesDirSupport(methodName='runTest')[source]

Bases: TestCase

test___init__()[source]
class glideinwms.unittests.test_creation_lib_cgWDictFile.TestClientSymlinksSupport(methodName='runTest')[source]

Bases: TestCase

test___init__()[source]
class glideinwms.unittests.test_creation_lib_cgWDictFile.TestCondorJDLDictFile(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test__init__()[source]
test_format_val_CondorJDLDictFile()[source]
test_is_equal_CondorJDLDictFile()[source]
test_parse_val_CondorJDLDictFile()[source]
test_refresh_description()[source]
test_refresh_file_list()[source]
test_refresh_signature()[source]
test_reuse_common_dicts()[source]
test_reuse_entry_dicts()[source]
test_reuse_file_dict()[source]
test_reuse_main_dicts()[source]
test_reuse_simple_dict()[source]
test_save_common_dicts()[source]
test_save_entry_dicts()[source]
class glideinwms.unittests.test_creation_lib_cgWDictFile.TestGlideinDicts(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test___init__()[source]
test_new_MainDicts()[source]
test_new_SubDicts()[source]
test_populate()[source]
test_reuse()[source]
test_sortit()[source]
class glideinwms.unittests.test_creation_lib_cgWDictFile.TestGlideinEntryDicts(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test___init__()[source]
test_erase()[source]
test_get_sub_dicts()[source]
test_get_sub_log_dir()[source]
test_get_sub_stage_dir()[source]
test_get_sub_work_dir()[source]
test_load()[source]
test_reuse()[source]
test_reuse_nocheck()[source]
test_save()[source]
test_save_final()[source]
class glideinwms.unittests.test_creation_lib_cgWDictFile.TestGlideinMainDicts(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test___init__()[source]
test_get_daemon_log_dir()[source]
test_get_main_dicts()[source]
test_load()[source]
test_reuse()[source]
test_save()[source]
class glideinwms.unittests.test_creation_lib_cgWDictFile.TestcgWDictFile(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test__init__()[source]
test_add_InfoSysDictFile()[source]
test_add_MonitorGroupDictFile()[source]
test_add_extended_InfoSysDictFile()[source]
test_add_extended_MonitorGroupDictFile()[source]
test_common_dicts()[source]
test_file_header_InfoSysDictFile()[source]
test_file_header_MonitorGroupDictFile()[source]
test_format_val_InfoSysDictFile()[source]
test_format_val_MonitorGroupDictFile()[source]
test_load_common_dicts()[source]
test_load_entry_dicts()[source]
test_load_main_dicts()[source]
test_parse_val_InfoSysDictFile()[source]
test_parse_val_MonitorGroupDictFile()[source]
test_save_main_dicts()[source]

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

test_add_attr_unparsed()[source]
class glideinwms.unittests.test_creation_lib_cgWParamDict.TestAddAttrUnparsedReal(methodName='runTest')[source]

Bases: TestCase

test_add_attr_unparsed_real()[source]
class glideinwms.unittests.test_creation_lib_cgWParamDict.TestAddFileUnparsed(methodName='runTest')[source]

Bases: TestCase

test_add_file_unparsed()[source]
class glideinwms.unittests.test_creation_lib_cgWParamDict.TestCalcMonitoringCollectorsString(methodName='runTest')[source]

Bases: TestCase

test_calc_monitoring_collectors_string()[source]
class glideinwms.unittests.test_creation_lib_cgWParamDict.TestCalcPrimaryMonitoringCollectors(methodName='runTest')[source]

Bases: TestCase

test_calc_primary_monitoring_collectors()[source]
class glideinwms.unittests.test_creation_lib_cgWParamDict.TestGetValidCondorTarballs(methodName='runTest')[source]

Bases: TestCase

test_get_valid_condor_tarballs()[source]
class glideinwms.unittests.test_creation_lib_cgWParamDict.TestGlideinDicts(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_MainDicts_populate()[source]
test__init__()[source]
test_has_file_wrapper()[source]
test_new_MainDicts()[source]
test_new_SubDicts()[source]
test_reuse()[source]
test_save()[source]
test_save_monitor()[source]
test_save_pub_key()[source]
test_submit_files_ok()[source]
class glideinwms.unittests.test_creation_lib_cgWParamDict.TestIterToDict(methodName='runTest')[source]

Bases: TestCase

test_iter_to_dict()[source]
class glideinwms.unittests.test_creation_lib_cgWParamDict.TestItertoolsProduct(methodName='runTest')[source]

Bases: TestCase

test_itertools_product()[source]
class glideinwms.unittests.test_creation_lib_cgWParamDict.TestOldGetValidCondorTarballs(methodName='runTest')[source]

Bases: TestCase

test_old_get_valid_condor_tarballs()[source]
class glideinwms.unittests.test_creation_lib_cgWParamDict.TestPopulateFactoryDescript(methodName='runTest')[source]

Bases: TestCase

test_populate_factory_descript()[source]
class glideinwms.unittests.test_creation_lib_cgWParamDict.TestPopulateFrontendDescript(methodName='runTest')[source]

Bases: TestCase

test_populate_frontend_descript()[source]
class glideinwms.unittests.test_creation_lib_cgWParamDict.TestPopulateGridmap(methodName='runTest')[source]

Bases: TestCase

test_populate_gridmap()[source]
class glideinwms.unittests.test_creation_lib_cgWParamDict.TestPopulateJobDescript(methodName='runTest')[source]

Bases: TestCase

test_populate_job_descript()[source]
class glideinwms.unittests.test_creation_lib_cgWParamDict.TestValidateCondorTarballAttrs(methodName='runTest')[source]

Bases: TestCase

test_validate_condor_tarball_attrs()[source]

glideinwms.unittests.test_creation_lib_cgWParams module

Project:

glideinWMS

Description:

unit test for glideinwms/creation/lib/cgWParams.py

Author:

Dennis Box dbox@fnal.gov

class glideinwms.unittests.test_creation_lib_cgWParams.TestGlideinParams(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test__eq__()[source]
test_buildDir()[source]
test_derive()[source]
test_file_read_and_write()[source]
test_get_description()[source]
test_get_top_element()[source]
test_get_xml()[source]
test_get_xml_format()[source]
test_init()[source]
test_init_defaults()[source]
test_validate_names()[source]

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

test_get_group_log_dir()[source]
class glideinwms.unittests.test_creation_lib_cvWConsts.TestGetGroupMonitorDir(methodName='runTest')[source]

Bases: TestCase

test_get_group_monitor_dir()[source]
class glideinwms.unittests.test_creation_lib_cvWConsts.TestGetGroupNameFromGroupMonitorDir(methodName='runTest')[source]

Bases: TestCase

test_get_group_name_from_group_monitor_dir()[source]
class glideinwms.unittests.test_creation_lib_cvWConsts.TestGetGroupNameFromGroupStageDir(methodName='runTest')[source]

Bases: TestCase

test_get_group_name_from_group_stage_dir()[source]
class glideinwms.unittests.test_creation_lib_cvWConsts.TestGetGroupNameFromGroupWorkDir(methodName='runTest')[source]

Bases: TestCase

test_get_group_name_from_group_work_dir()[source]
class glideinwms.unittests.test_creation_lib_cvWConsts.TestGetGroupStageDir(methodName='runTest')[source]

Bases: TestCase

test_get_group_stage_dir()[source]
class glideinwms.unittests.test_creation_lib_cvWConsts.TestGetGroupWorkDir(methodName='runTest')[source]

Bases: TestCase

test_get_group_work_dir()[source]

glideinwms.unittests.test_creation_lib_cvWCreate module

Unit test for glideinwms/creation/lib/cvWCreate.py

class glideinwms.unittests.test_creation_lib_cvWCreate.Test_cvWCreate(methodName='runTest')[source]

Bases: TestCase

test_create_client_condor_config()[source]
test_create_client_mapfile()[source]
test_get_template()[source]

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

test_calc_glidein_ccbs()[source]
class glideinwms.unittests.test_creation_lib_cvWParamDict.TestCalcGlideinCollectors(methodName='runTest')[source]

Bases: TestCase

test_calc_glidein_collectors()[source]
class glideinwms.unittests.test_creation_lib_cvWParamDict.TestFrontendDicts(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test__init__()[source]
test_populate()[source]
test_save()[source]
class glideinwms.unittests.test_creation_lib_cvWParamDict.TestFrontendGroupDicts(methodName='runTest')[source]

Bases: TestCase

populate_wrapper()[source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

test__init__()[source]
test_apply_group_singularity_policy()[source]
test_apply_multicore_policy()[source]
test_derive_and_validate_match()[source]
test_populate()[source]
test_populate_common_attrs()[source]
test_reuse()[source]
test_save()[source]
class glideinwms.unittests.test_creation_lib_cvWParamDict.TestFrontendMainDicts(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test__init__()[source]
test_apply_group_singularity_policy()[source]
test_apply_multicore_policy()[source]
test_find_parend_dir()[source]
test_populate()[source]
test_populate_common_attrs()[source]
test_reuse()[source]
test_save()[source]
test_save_monitor()[source]
class glideinwms.unittests.test_creation_lib_cvWParamDict.TestGetPoolList(methodName='runTest')[source]

Bases: TestCase

test_get_pool_list()[source]
class glideinwms.unittests.test_creation_lib_cvWParamDict.TestPopulateCommonDescript(methodName='runTest')[source]

Bases: TestCase

test_populate_common_descript()[source]
class glideinwms.unittests.test_creation_lib_cvWParamDict.TestPopulateGroupDescript(methodName='runTest')[source]

Bases: TestCase

test_populate_group_descript()[source]
class glideinwms.unittests.test_creation_lib_cvWParamDict.TestPopulateGroupSecurity(methodName='runTest')[source]

Bases: TestCase

test_populate_group_security()[source]
class glideinwms.unittests.test_creation_lib_cvWParamDict.TestPopulateMainSecurity(methodName='runTest')[source]

Bases: TestCase

test_populate_main_security()[source]

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

test_extract_attr_val()[source]
class glideinwms.unittests.test_creation_lib_cvWParams.TestVOFrontendParams(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test__eq__()[source]
test_buildDir()[source]
test_derive()[source]
test_extract_attr_val()[source]
test_file_read_and_write()[source]
test_get_description()[source]
test_get_subparams_class()[source]
test_get_top_element()[source]
test_get_xml()[source]
test_get_xml_format()[source]
test_init()[source]
test_init_defaults()[source]
test_validate_names()[source]
class glideinwms.unittests.test_creation_lib_cvWParams.TestVOFrontendSubParams(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test__eq__()[source]
test_extract_attr_val()[source]
test_init()[source]
test_looks_like_dict()[source]

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

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_validate()[source]
class glideinwms.unittests.test_creation_lib_factoryXmlConfig.TestConfig(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test___init__()[source]
test_get_client_log_dirs()[source]
test_get_client_proxy_dirs()[source]
test_get_entries()[source]
test_get_log_dir()[source]
test_get_monitor_dir()[source]
test_get_stage_dir()[source]
test_get_submit_dir()[source]
test_get_web_url()[source]
test_set_client_log_dirs()[source]
test_set_client_proxy_dirs()[source]
test_set_log_dir()[source]
test_set_monitor_dir()[source]
test_set_stage_dir()[source]
test_set_submit_dir()[source]
test_set_web_url()[source]
test_validate()[source]
class glideinwms.unittests.test_creation_lib_factoryXmlConfig.TestEntryElement(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_getName()[source]
test_validate()[source]
test_validate_sub_elements()[source]
class glideinwms.unittests.test_creation_lib_factoryXmlConfig.TestEntrySetElement(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_validate_entries()[source]
test_validate_entry_sets()[source]
class glideinwms.unittests.test_creation_lib_factoryXmlConfig.TestFactAttrElement(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_validate()[source]
class glideinwms.unittests.test_creation_lib_factoryXmlConfig.TestFactFileElement(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_validate()[source]
class glideinwms.unittests.test_creation_lib_factoryXmlConfig.TestFrontendElement(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_validate()[source]
class glideinwms.unittests.test_creation_lib_factoryXmlConfig.TestParse(methodName='runTest')[source]

Bases: TestCase

test_parse()[source]

glideinwms.unittests.test_factory_glideFactoryConfig module

Project:

glideinWMS

Purpose:

unit test for glideinwms/factory/glideFactoryConfig.py

Author:

Dennis Box, dbox@fnal.gov

class glideinwms.unittests.test_factory_glideFactoryConfig.TestFactoryConfig(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test__contains__()[source]
test__init__()[source]
test_backup_and_load_old_key()[source]
test_backup_rsa_key()[source]
test_get_all_frontend_sec_classes()[source]
test_get_all_usernames()[source]
test_get_frontend_name()[source]
test_get_identity()[source]
test_get_username()[source]
test_has_key()[source]
test_load_old_rsa_key()[source]
test_load_pub_key()[source]
test_remove_old_key()[source]
test_str_()[source]

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

test_check_and_perform_work()[source]
class glideinwms.unittests.test_factory_glideFactoryEntry.TestEntry(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test___init__()[source]
test_advertise()[source]
test_getGlideinConfiguredLimits()[source]
test_getGlideinExpectedCores()[source]
test_getLogStatsCurrentStatsData()[source]
test_getLogStatsData()[source]
test_getLogStatsOldStatsData()[source]
test_getState()[source]
test_glideinsWithinLimits()[source]
test_initIteration()[source]
test_isClientBlacklisted()[source]
test_isClientInWhitelist()[source]
test_isClientWhitelisted()[source]
test_isInDowntime()[source]
test_isSecurityClassAllowed()[source]
test_isSecurityClassInDowntime()[source]
test_loadContext()[source]
test_loadDowntimes()[source]
test_loadWhitelist()[source]
test_logLogStats()[source]
test_queryQueuedGlideins()[source]
test_setDowntime()[source]
test_setLogStatsCurrentStatsData()[source]
test_setLogStatsData()[source]
test_setLogStatsOldStatsData()[source]
test_setState()[source]
test_setState_old()[source]
test_unsetInDowntime()[source]
test_writeClassadsToFile()[source]
test_writeStats()[source]
class glideinwms.unittests.test_factory_glideFactoryEntry.TestPerformWorkV3(methodName='runTest')[source]

Bases: TestCase

test_perform_work_v3()[source]
class glideinwms.unittests.test_factory_glideFactoryEntry.TestTermsignal(methodName='runTest')[source]

Bases: TestCase

test_termsignal()[source]
class glideinwms.unittests.test_factory_glideFactoryEntry.TestUnitWorkV3(methodName='runTest')[source]

Bases: TestCase

test_unit_work_v3()[source]
class glideinwms.unittests.test_factory_glideFactoryEntry.TestWriteDescript(methodName='runTest')[source]

Bases: TestCase

test_write_descript()[source]

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

test_clean_glidein_queue()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestClientWeb(methodName='runTest')[source]

Bases: TestCase

test___init__()[source]
test_get_glidein_args()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestDays2sec(methodName='runTest')[source]

Bases: TestCase

test_days2sec()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestDiffList(methodName='runTest')[source]

Bases: TestCase

test_diff_list()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestEscapeParam(methodName='runTest')[source]

Bases: TestCase

test_escape_param()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestExecuteSubmit(methodName='runTest')[source]

Bases: TestCase

test_execute_submit()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractHeldSimple(methodName='runTest')[source]

Bases: TestCase

test_extract_held_simple()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractIdleQueued(methodName='runTest')[source]

Bases: TestCase

test_extract_idle_queued()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractIdleSimple(methodName='runTest')[source]

Bases: TestCase

test_extract_idle_simple()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractIdleUnsubmitted(methodName='runTest')[source]

Bases: TestCase

test_extract_idle_unsubmitted()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractJobId(methodName='runTest')[source]

Bases: TestCase

test_extract_job_id()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractNonRunSimple(methodName='runTest')[source]

Bases: TestCase

test_extract_non_run_simple()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractRecoverableHeldSimple(methodName='runTest')[source]

Bases: TestCase

test_extract_recoverable_held_simple()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractRecoverableHeldSimpleWithinLimits(methodName='runTest')[source]

Bases: TestCase

test_extract_recoverable_held_simple_within_limits()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractRunSimple(methodName='runTest')[source]

Bases: TestCase

test_extract_run_simple()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractRunStale(methodName='runTest')[source]

Bases: TestCase

test_extract_run_stale()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractStaleSimple(methodName='runTest')[source]

Bases: TestCase

test_extract_stale_simple()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractUnrecoverableHeldForceX(methodName='runTest')[source]

Bases: TestCase

test_extract_unrecoverable_held_force_x()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestExtractUnrecoverableHeldSimple(methodName='runTest')[source]

Bases: TestCase

test_extract_unrecoverable_held_simple()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestFactoryConfig(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test__init__()[source]
test_config_dirs()[source]
test_config_remove_freq()[source]
test_config_submit_freq()[source]
test_config_whoamI()[source]
test_config_whoamI_()[source]
test_env_list2dict()[source]
test_get_client_log_dir()[source]
test_get_client_proxies_dir()[source]
test_get_condor_q_credential_list()[source]
test_get_condor_q_data()[source]
test_get_condor_status_data()[source]
test_get_q_credentials()[source]
test_get_q_prox_sec_class()[source]
test_get_q_status()[source]
test_get_q_status_s_f()[source]
test_get_q_status_stale()[source]
test_is_str_safe()[source]
test_sec_class2_name()[source]
test_update_x509_proxy_file()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestGetStatusGlideidx(methodName='runTest')[source]

Bases: TestCase

test_get_status_glideidx()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestGetSubmitEnvironment(methodName='runTest')[source]

Bases: TestCase

test_get_submit_environment()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestGlideinTotals(methodName='runTest')[source]

Bases: TestCase

test___init__()[source]
test___str__()[source]
test_add_idle_glideins()[source]
test_can_add_idle_glideins()[source]
test_get_max_held()[source]
test_has_entry_exceeded_max_glideins()[source]
test_has_entry_exceeded_max_held()[source]
test_has_entry_exceeded_max_idle()[source]
test_has_sec_class_exceeded_max_held()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestGroupUnclaimed(methodName='runTest')[source]

Bases: TestCase

test_group_unclaimed()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestHashStatus(methodName='runTest')[source]

Bases: TestCase

test_hash_status()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestHashStatusStale(methodName='runTest')[source]

Bases: TestCase

test_hash_status_stale()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestHrs2sec(methodName='runTest')[source]

Bases: TestCase

test_hrs2sec()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestInSubmitEnvironment(methodName='runTest')[source]

Bases: TestCase

test_in_submit_environment()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestIsGlideinHeldNTimes(methodName='runTest')[source]

Bases: TestCase

test_is_glidein_held_n_times()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestIsGlideinUnrecoverable(methodName='runTest')[source]

Bases: TestCase

test_is_glidein_unrecoverable()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestIsGlideinWithinHeldLimits(methodName='runTest')[source]

Bases: TestCase

test_is_glidein_within_held_limits()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestKeepIdleGlideins(methodName='runTest')[source]

Bases: TestCase

test_keep_idle_glideins()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestLogStats(methodName='runTest')[source]

Bases: TestCase

test_log_stats()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestLogWorkRequest(methodName='runTest')[source]

Bases: TestCase

test_log_work_request()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestPickSubmitFile(methodName='runTest')[source]

Bases: TestCase

test_pick_submit_file()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestReleaseGlideins(methodName='runTest')[source]

Bases: TestCase

test_release_glideins()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestRemoveGlideins(methodName='runTest')[source]

Bases: TestCase

test_remove_glideins()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestSanitizeGlideins(methodName='runTest')[source]

Bases: TestCase

test_sanitize_glideins()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestScheddName2str(methodName='runTest')[source]

Bases: TestCase

test_schedd_name2str()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestSetCondorIntegrityChecks(methodName='runTest')[source]

Bases: TestCase

test_set_condor_integrity_checks()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestSubmitGlideins(methodName='runTest')[source]

Bases: TestCase

test_submit_glideins()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestSumIdleCount(methodName='runTest')[source]

Bases: TestCase

test_sum_idle_count()[source]
class glideinwms.unittests.test_factory_glideFactoryLib.TestWhich(methodName='runTest')[source]

Bases: TestCase

test_which()[source]

glideinwms.unittests.test_factory_glideFactoryLogParser module

class glideinwms.unittests.test_factory_glideFactoryLogParser.TestUtils(methodName='runTest')[source]

Bases: TestCase

test_extractLogData()[source]

glideinwms.unittests.test_frontend module

Unit test for glideinwms/creation/lib/cgWConsts.py

class glideinwms.unittests.test_frontend.FETestCaseBase(methodName='runTest')[source]

Bases: TestCase

prepare_condorq_dict()[source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

class glideinwms.unittests.test_frontend.FETestCaseCondorQ(methodName='runTest')[source]

Bases: FETestCaseBase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_countCondorQ()[source]
test_getClientCondorStatusCredIdOnly(m_subquery)[source]
test_getClientCondorStatusPerCredId(m_getClientCondorStatusCredIdOnly, m_getClientCondorStatus)[source]
test_getCondorQ(m_exe_cmd, m_iGetEnv)[source]
test_getCondorQUsers()[source]
test_getCondorQ_no_constraints(m_getCondorQConstrained)[source]
test_getIdleCondorQ()[source]
test_getIdleVomsCondorQ()[source]
test_getOldCondorQ()[source]
test_getRunningCondorQ()[source]
test_oldCondorQ(m_SubQuery)[source]
class glideinwms.unittests.test_frontend.FETestCaseCondorStatus(methodName='runTest')[source]

Bases: FETestCaseBase

test_countCondorStatus()[source]
test_getClientCondorStatus()[source]
test_getClientCondorStatusCredIdOnly()[source]
test_getClientCondorStatusPerCredId()[source]
test_getCondorStatus()[source]
test_getCondorStatusSchedds()[source]
test_getFactoryEntryList()[source]
test_getIdleCondorStatus()[source]
test_getRunningCondorStatus()[source]
class glideinwms.unittests.test_frontend.FETestCaseCount(methodName='runTest')[source]

Bases: FETestCaseBase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_countMatch()[source]
test_countMatchDowntime()[source]
test_countMatch_missingKey()[source]
test_countMatch_otherException()[source]
test_countRealRunning_match()[source]
test_countRealRunning_missingKey()[source]
test_countRealRunning_otherException()[source]
class glideinwms.unittests.test_frontend.FETestCaseMisc(methodName='runTest')[source]

Bases: FETestCaseBase

test_appendRealRunning()[source]
test_evalParamExpr()[source]
test_getGlideinCpusNum()[source]
test_hashJob()[source]
test_uniqueSets()[source]
glideinwms.unittests.test_frontend.compareLambdas(func1, func2)[source]

glideinwms.unittests.test_frontend_element module

Unit test for glideinwms/frontend/glideinFrontendElement

class glideinwms.unittests.test_frontend_element.FEElementTestCase(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_compute_glidein_max_run()[source]
test_get_condor_q()[source]
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

test___init__()[source]
test_get_condor_vars()[source]
test_get_constants()[source]
test_load_preentry_file_list()[source]
class glideinwms.unittests.test_frontend_glideinFrontendConfig.TestFrontendConfig(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test__init__()[source]
test_get_group_dir()[source]
test_split_func()[source]
class glideinwms.unittests.test_frontend_glideinFrontendConfig.TestHistoryFile(methodName='runTest')[source]

Bases: TestCase

test___contains__()[source]
test___delitem__()[source]
test___getitem__()[source]
test___init__()[source]
test___setitem__()[source]
test_empty()[source]
test_get()[source]
test_has_key()[source]
test_load()[source]
test_save()[source]
class glideinwms.unittests.test_frontend_glideinFrontendConfig.TestMergeStageFiles(methodName='runTest')[source]

Bases: TestCase

test___init__()[source]
test_get_condor_vars()[source]
test_get_constants()[source]
class glideinwms.unittests.test_frontend_glideinFrontendConfig.TestStageFiles(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test___init__()[source]
test_get_file_list()[source]
test_get_stage_file()[source]

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

test_check_parent()[source]
class glideinwms.unittests.test_frontend_glideinFrontendElement.TestCounterWrapper(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test___contains__()[source]
test___delitem__()[source]
test___getitem__()[source]
test___setitem__()[source]
test_has_key()[source]
class glideinwms.unittests.test_frontend_glideinFrontendElement.TestGlideinFrontendElement(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test___init__()[source]
test_build_resource_classad()[source]
test_check_removal_config()[source]
test_choose_remove_excess_type()[source]
test_compute_glidein_max_run()[source]
test_compute_glidein_min_idle()[source]
test_configure()[source]
test_count_factory_entries_without_classads()[source]
test_deadvertiseAllClassads()[source]
test_decide_removal_type()[source]
test_expand__d_d()[source]
test_get_condor_status()[source]
test_identify_bad_schedds()[source]
test_identify_limits_triggered()[source]
test_init_factory_stats_arr()[source]
test_iterate()[source]
test_log_and_print_total_stats()[source]
test_log_and_print_unmatched()[source]
test_log_factory_header()[source]
test_main()[source]
test_populate_condorq_dict_types()[source]
test_populate_pubkey()[source]
test_populate_status_dict_types()[source]
test_query_entries()[source]
test_query_factory()[source]
test_query_factoryclients()[source]
test_query_globals()[source]
test_set_glidein_config_limits()[source]
test_subprocess_count_dt()[source]
test_subprocess_count_glidein()[source]
test_subprocess_count_real()[source]
test_write_stats()[source]
class glideinwms.unittests.test_frontend_glideinFrontendElement.TestLogAndSumFactoryLine(methodName='runTest')[source]

Bases: TestCase

test_log_and_sum_factory_line()[source]
glideinwms.unittests.test_frontend_glideinFrontendElement.condor_q_side_effect()[source]
glideinwms.unittests.test_frontend_glideinFrontendElement.condor_status_side_effect()[source]
glideinwms.unittests.test_frontend_glideinFrontendElement.log_side_effect(*args, **kwargs)[source]
glideinwms.unittests.test_frontend_glideinFrontendElement.query_factory_side_effect(*args, **kwargs)[source]
glideinwms.unittests.test_frontend_glideinFrontendElement.readit(fnm)[source]

glideinwms.unittests.test_glideFactoryDowntimeLib module

Unit test for glideinwms/factory/glideFactoryDowntimeLib.py

class glideinwms.unittests.test_glideFactoryDowntimeLib.TestDowntimes(methodName='runTest')[source]

Bases: TestCase

Test the downtimes library

setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_downtimesfile()[source]
test_entryonlydowntime()[source]
test_setdelayedperiod()[source]
test_setfrontendsecclass()[source]
test_setperiodwithendtime()[source]

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

createCondor()[source]
getCredlist()[source]
killCredlist(cred_list)[source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_proxy_all()[source]
test_proxy_cardinality()[source]
test_proxy_first()[source]
test_proxy_usermap()[source]
test_proxy_userr()[source]
class glideinwms.unittests.test_glideinFrontendPlugins.fakeDescript[source]

Bases: object

addproxy(name)[source]
class glideinwms.unittests.test_glideinFrontendPlugins.fakeObj[source]

Bases: object

glideinwms.unittests.test_lib_DiskCache module

Project:

glideinWMS

Description:

unit test for glideinwms/creation/lib/cvWParams.py

Author:

Dennis Box dbox@fnal.gov

class glideinwms.unittests.test_lib_DiskCache.TestDiskCache(methodName='runTest')[source]

Bases: TestCase

Test the DiskCache class

setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_normal()[source]

Test a few things

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

setUp()[source]

Hook method for setting up the test fixture before exercising it.

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

class glideinwms.unittests.test_lib_disk_cache.TestDiskCache(methodName='runTest')[source]

Bases: TestCase

Test the DiskCache class

setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_normal()[source]

Test a few things

glideinwms.unittests.test_lib_exprParser module

Unit test for glideinwms/lib/exprParser.py

class glideinwms.unittests.test_lib_exprParser.TestExprParserSymmetric(methodName='runTest')[source]

Bases: TestCase

test__compile()[source]
test_parse_symmetric()[source]
test_unparse_ret()[source]

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

test_fetch_fork_result()[source]
class glideinwms.unittests.test_lib_fork.TestFetchForkResultList(methodName='runTest')[source]

Bases: TestCase

test_fetch_fork_result_list()[source]
class glideinwms.unittests.test_lib_fork.TestFetchReadyForkResultList(methodName='runTest')[source]

Bases: TestCase

test_fetch_ready_fork_result_list()[source]
class glideinwms.unittests.test_lib_fork.TestForkInBg(methodName='runTest')[source]

Bases: TestCase

test_fork_in_bg()[source]
class glideinwms.unittests.test_lib_fork.TestForkManager(methodName='runTest')[source]

Bases: TestCase

load_forks(num_forks=None, sleep_val=None)[source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

test___init__()[source]
test_add_fork_and_len()[source]
test_bounded_fork_and_collect_use_epoll()[source]
test_bounded_fork_and_collect_use_poll()[source]
test_bounded_fork_and_collect_use_select()[source]
test_fork_and_collect()[source]
test_fork_and_wait()[source]
class glideinwms.unittests.test_lib_fork.TestForkResultError(methodName='runTest')[source]

Bases: TestCase

test___init__()[source]
class glideinwms.unittests.test_lib_fork.TestPrinChildProcesses(methodName='runTest')[source]

Bases: TestCase

test_print_child_processes()[source]
class glideinwms.unittests.test_lib_fork.TestWaitForPids(methodName='runTest')[source]

Bases: TestCase

test_wait_for_pids()[source]
glideinwms.unittests.test_lib_fork.fake_check_output(*argv)[source]
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_fork.sleep_fn(sleep_tm=None)[source]

glideinwms.unittests.test_lib_logSupport module

Purpose:

test glideinwms/lib/logSupport.py

class glideinwms.unittests.test_lib_logSupport.TestLogSupport(methodName='runTest')[source]

Bases: TestCase

Test the cleaners to ensure that only the files that we want to be deleted are.

load_log(section)[source]
rotated_log_tests(section, log_dir)[source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_backup_count()[source]
test_level()[source]
test_logSupport_compression()[source]
test_logSupport_size_rotate()[source]
test_logSupport_time_rotate()[source]

glideinwms.unittests.test_lib_pubCrypto module

Unit test for glideinwms/lib/pubCrypto.py

class glideinwms.unittests.test_lib_pubCrypto.TestPubCrypto(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_symmetric(plaintext='5105105105105100')[source]
test_symmetric_base64(plaintext='5105105105105100')[source]
test_symmetric_hex(plaintext='5105105105105100')[source]

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

test_get_perf_metric()[source]
class glideinwms.unittests.test_lib_servicePerformance.TestGetPerfMetricEventLifetime(methodName='runTest')[source]

Bases: TestCase

test_get_perf_metric_event_lifetime()[source]
class glideinwms.unittests.test_lib_servicePerformance.TestPerfMetric(methodName='runTest')[source]

Bases: TestCase

test___init__()[source]
test___repr__()[source]
test___str__()[source]
test_deregister_event()[source]
test_event_end()[source]
test_event_lifetime()[source]
test_event_start()[source]
test_register_event_time()[source]

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

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_auto_load()[source]
class glideinwms.unittests.test_lib_symCrypto.TestMutableSymKey(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test___init__()[source]
test_get_wcrypto()[source]
test_is_valid()[source]
test_redefine()[source]
class glideinwms.unittests.test_lib_symCrypto.TestParametrizedSymKey(methodName='runTest')[source]

Bases: TestCase

test___init__()[source]
class glideinwms.unittests.test_lib_symCrypto.TestSym3DESKey(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test___init__()[source]
test_symmetric() None[source]
class glideinwms.unittests.test_lib_symCrypto.TestSymAES128Key(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test___init__()[source]
test_symmetric() None[source]
class glideinwms.unittests.test_lib_symCrypto.TestSymAES256Key(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test___init__()[source]
test_symmetric() None[source]

glideinwms.unittests.test_lib_timeConversion module

Project:

glideinwms

Purpose:

unit test for glideinwms/lib/timeConversion.python

Author:

Dennis Box, dbox@fnal.gov

class glideinwms.unittests.test_lib_timeConversion.TestTimeFunctions(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_ISO8601_Local__symmetric() None[source]
test_extract_human()[source]
test_extract_is_o8601__local()[source]
test_extract_is_o8601__ut_c()[source]
test_extract_rf_c2822__local()[source]
test_extract_rf_c2822__ut_c()[source]
test_extract_seconds()[source]
test_get_human()[source]
test_get_is_o8601__local()[source]
test_get_is_o8601__ut_c()[source]
test_get_rf_c2822__local()[source]
test_get_rf_c2822__ut_c()[source]
test_get_seconds()[source]
test_get_t_zval()[source]
test_get_time_in_format()[source]
test_rf_c2822_local_symmetric() None[source]

glideinwms.unittests.test_lib_x509Support module

Project:

glideinwms

Purpose:

unit test of glideinwms/lib/x509Support.py

Author:

Dennis Box dbox@fnal.gov

class glideinwms.unittests.test_lib_x509Support.TestExtractDN(methodName='runTest')[source]

Bases: TestCase

test_extract_dn()[source]

Testing DN extraction. Need to adapt to change in behavior of openssl

On EL8: “openssl x509 -noout -subject -nameopt compat -in %s” returns the desired /DN=… string and “openssl x509 -noout -subject -in %s” returns DN = org, DC =… On El7 happens exactly the opposite

glideinwms.unittests.test_lib_xmlParse module

class glideinwms.unittests.test_lib_xmlParse.TestDomel2dict(methodName='runTest')[source]

Bases: TestCase

test_domel2dict()[source]
class glideinwms.unittests.test_lib_xmlParse.TestGetXMLAttributes(methodName='runTest')[source]

Bases: TestCase

test_get_xml_attributes()[source]
class glideinwms.unittests.test_lib_xmlParse.TestGetXMLElements(methodName='runTest')[source]

Bases: TestCase

test_get_xml_elements()[source]
class glideinwms.unittests.test_lib_xmlParse.TestIsSingularOf(methodName='runTest')[source]

Bases: TestCase

test_is_singular_of()[source]
class glideinwms.unittests.test_lib_xmlParse.TestOrderedDict(methodName='runTest')[source]

Bases: TestCase

test___delitem__()[source]
test___init__()[source]
test___setitem__()[source]
test_clear()[source]
test_copy()[source]
test_items()[source]
test_keys()[source]
test_popitem()[source]
test_setdefault()[source]
test_update()[source]
test_values()[source]
class glideinwms.unittests.test_lib_xmlParse.TestXmlfile2dict(methodName='runTest')[source]

Bases: TestCase

test_xmlfile2dict()[source]
class glideinwms.unittests.test_lib_xmlParse.TestXmlstring2dict(methodName='runTest')[source]

Bases: TestCase

test_xmlstring2dict()[source]

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

test_parse_vomses()[source]
test_voms_proxy_init(mock_run_command)[source]
test_voms_proxy_init_with_voms(mock_run_command)[source]
class glideinwms.unittests.test_renew_proxy.TestVo(methodName='runTest')[source]

Bases: TestCase

Test the VOMS attributes class

assertVomsAttr(vo, vo_name, cmd)[source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_fqan_malformed()[source]
test_fqan_vo_prefix()[source]
test_fqan_without_vo_prefix()[source]
glideinwms.unittests.test_renew_proxy.get_opt_val(cmd, opt_name)[source]

Given a command as a list, return the value of opt_name.

glideinwms.unittests.test_tarSupport module

Project:

glideinWMS

Purpose:

unit test of glideinwms/lib/tarSupport.py

Author:

Anthony Tiradani <tiradani@fnal.gov>

class glideinwms.unittests.test_tarSupport.TestTarSupport(methodName='runTest')[source]

Bases: TestCase

Test the cleaners to ensure that only the files that we want to be deleted are.

create_archive_blob()[source]
create_archive_file()[source]
extract_archive_blob(blob)[source]
extract_archive_file(archive_file)[source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_tarSupport_blob()[source]
test_tarSupport_file()[source]

glideinwms.unittests.test_util module

class glideinwms.unittests.test_util.TestUtils(methodName='runTest')[source]

Bases: TestCase

test_import_module()[source]
test_safe_boolcomp()[source]

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

debug(msg, *args)[source]

Pass a debug message to stderr.

Prints out msg % args.

@param msg: A message string. @param args: Arguments which should be evaluated into the message.

error(msg, *args)[source]

Pass an error message to stderr.

@see: debug

exception(msg, *args)[source]

Pass an exception message to stderr.

@see: debug

info(msg, *args)[source]

Pass an info-level message to stderr.

@see: debug

warning(msg, *args)[source]

Pass a warning-level message to stderr.

@see: debug

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_random_string(length=8)[source]
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.