DIRAC 9.0.0a42__py3-none-any.whl → 9.0.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. DIRAC/AccountingSystem/Client/AccountingCLI.py +0 -140
  2. DIRAC/AccountingSystem/Client/DataStoreClient.py +0 -13
  3. DIRAC/AccountingSystem/Client/Types/BaseAccountingType.py +0 -7
  4. DIRAC/AccountingSystem/ConfigTemplate.cfg +0 -5
  5. DIRAC/AccountingSystem/Service/DataStoreHandler.py +0 -72
  6. DIRAC/ConfigurationSystem/Client/Helpers/CSGlobals.py +0 -9
  7. DIRAC/ConfigurationSystem/Client/Helpers/Registry.py +38 -26
  8. DIRAC/ConfigurationSystem/Client/Helpers/Resources.py +11 -43
  9. DIRAC/ConfigurationSystem/Client/Helpers/test/Test_Helpers.py +0 -16
  10. DIRAC/ConfigurationSystem/Client/LocalConfiguration.py +14 -8
  11. DIRAC/ConfigurationSystem/Client/PathFinder.py +47 -8
  12. DIRAC/ConfigurationSystem/Client/SyncPlugins/CERNLDAPSyncPlugin.py +4 -1
  13. DIRAC/ConfigurationSystem/Client/VOMS2CSSynchronizer.py +32 -19
  14. DIRAC/ConfigurationSystem/Client/test/Test_PathFinder.py +41 -1
  15. DIRAC/ConfigurationSystem/private/RefresherBase.py +4 -2
  16. DIRAC/Core/Base/API.py +4 -7
  17. DIRAC/Core/Base/SQLAlchemyDB.py +1 -0
  18. DIRAC/Core/DISET/ServiceReactor.py +11 -3
  19. DIRAC/Core/DISET/private/BaseClient.py +1 -2
  20. DIRAC/Core/DISET/private/Transports/M2SSLTransport.py +9 -7
  21. DIRAC/Core/DISET/private/Transports/SSL/M2Utils.py +3 -1
  22. DIRAC/Core/LCG/GOCDBClient.py +5 -7
  23. DIRAC/Core/Security/DiracX.py +31 -17
  24. DIRAC/Core/Security/IAMService.py +5 -10
  25. DIRAC/Core/Security/Locations.py +27 -18
  26. DIRAC/Core/Security/ProxyInfo.py +9 -5
  27. DIRAC/Core/Security/VOMSService.py +2 -4
  28. DIRAC/Core/Security/m2crypto/X509Certificate.py +4 -6
  29. DIRAC/Core/Security/m2crypto/asn1_utils.py +17 -5
  30. DIRAC/Core/Security/test/test_diracx_token_from_pem.py +161 -0
  31. DIRAC/Core/Tornado/Client/ClientSelector.py +4 -1
  32. DIRAC/Core/Tornado/Server/TornadoService.py +1 -1
  33. DIRAC/Core/Utilities/CGroups2.py +328 -0
  34. DIRAC/Core/Utilities/ClassAd/ClassAdLight.py +4 -290
  35. DIRAC/Core/Utilities/DErrno.py +5 -309
  36. DIRAC/Core/Utilities/Extensions.py +10 -1
  37. DIRAC/Core/Utilities/File.py +1 -1
  38. DIRAC/Core/Utilities/Graphs/GraphData.py +1 -1
  39. DIRAC/Core/Utilities/Graphs/GraphUtilities.py +6 -1
  40. DIRAC/Core/Utilities/JDL.py +1 -195
  41. DIRAC/Core/Utilities/List.py +1 -124
  42. DIRAC/Core/Utilities/MySQL.py +103 -99
  43. DIRAC/Core/Utilities/Os.py +32 -1
  44. DIRAC/Core/Utilities/Platform.py +2 -107
  45. DIRAC/Core/Utilities/Proxy.py +0 -4
  46. DIRAC/Core/Utilities/ReturnValues.py +7 -252
  47. DIRAC/Core/Utilities/StateMachine.py +12 -178
  48. DIRAC/Core/Utilities/Subprocess.py +35 -14
  49. DIRAC/Core/Utilities/TimeUtilities.py +10 -253
  50. DIRAC/Core/Utilities/test/Test_JDL.py +0 -3
  51. DIRAC/Core/Utilities/test/Test_Profiler.py +20 -20
  52. DIRAC/Core/scripts/dirac_agent.py +1 -1
  53. DIRAC/Core/scripts/dirac_apptainer_exec.py +72 -46
  54. DIRAC/Core/scripts/dirac_configure.py +1 -3
  55. DIRAC/Core/scripts/dirac_install_db.py +24 -6
  56. DIRAC/Core/scripts/dirac_platform.py +1 -92
  57. DIRAC/DataManagementSystem/Agent/FTS3Agent.py +8 -7
  58. DIRAC/DataManagementSystem/Agent/RequestOperations/RemoveFile.py +7 -6
  59. DIRAC/DataManagementSystem/Client/FTS3Job.py +71 -34
  60. DIRAC/DataManagementSystem/DB/FTS3DB.py +7 -3
  61. DIRAC/DataManagementSystem/DB/FileCatalogComponents/DatasetManager/DatasetManager.py +1 -1
  62. DIRAC/DataManagementSystem/DB/FileCatalogDB.sql +9 -9
  63. DIRAC/DataManagementSystem/DB/FileCatalogWithFkAndPsDB.sql +9 -9
  64. DIRAC/DataManagementSystem/Utilities/DMSHelpers.py +6 -2
  65. DIRAC/DataManagementSystem/scripts/dirac_admin_allow_se.py +13 -8
  66. DIRAC/DataManagementSystem/scripts/dirac_admin_ban_se.py +13 -8
  67. DIRAC/DataManagementSystem/scripts/dirac_dms_create_moving_request.py +2 -0
  68. DIRAC/DataManagementSystem/scripts/dirac_dms_protocol_matrix.py +0 -1
  69. DIRAC/FrameworkSystem/Client/BundleDeliveryClient.py +2 -7
  70. DIRAC/FrameworkSystem/Client/ComponentInstaller.py +9 -4
  71. DIRAC/FrameworkSystem/Client/ProxyManagerClient.py +5 -2
  72. DIRAC/FrameworkSystem/Client/SystemAdministratorClientCLI.py +11 -6
  73. DIRAC/FrameworkSystem/ConfigTemplate.cfg +2 -0
  74. DIRAC/FrameworkSystem/DB/AuthDB.py +3 -3
  75. DIRAC/FrameworkSystem/DB/InstalledComponentsDB.py +4 -4
  76. DIRAC/FrameworkSystem/DB/ProxyDB.py +11 -3
  77. DIRAC/FrameworkSystem/DB/TokenDB.py +1 -1
  78. DIRAC/FrameworkSystem/Service/ProxyManagerHandler.py +8 -6
  79. DIRAC/FrameworkSystem/Utilities/MonitoringUtilities.py +2 -19
  80. DIRAC/FrameworkSystem/Utilities/TokenManagementUtilities.py +3 -2
  81. DIRAC/FrameworkSystem/Utilities/diracx.py +36 -14
  82. DIRAC/FrameworkSystem/private/authorization/AuthServer.py +2 -2
  83. DIRAC/FrameworkSystem/scripts/dirac_admin_update_pilot.py +18 -11
  84. DIRAC/FrameworkSystem/scripts/dirac_login.py +2 -2
  85. DIRAC/FrameworkSystem/scripts/dirac_proxy_init.py +7 -8
  86. DIRAC/Interfaces/API/Dirac.py +27 -15
  87. DIRAC/Interfaces/API/DiracAdmin.py +45 -17
  88. DIRAC/Interfaces/API/Job.py +9 -13
  89. DIRAC/Interfaces/scripts/dirac_admin_allow_site.py +12 -18
  90. DIRAC/Interfaces/scripts/dirac_admin_ban_site.py +12 -10
  91. DIRAC/Interfaces/scripts/dirac_admin_get_site_mask.py +4 -13
  92. DIRAC/Interfaces/scripts/dirac_admin_reset_job.py +3 -6
  93. DIRAC/Interfaces/scripts/dirac_wms_job_parameters.py +0 -1
  94. DIRAC/MonitoringSystem/Client/Types/WMSHistory.py +4 -0
  95. DIRAC/MonitoringSystem/Client/WebAppClient.py +26 -0
  96. DIRAC/MonitoringSystem/ConfigTemplate.cfg +9 -0
  97. DIRAC/MonitoringSystem/DB/MonitoringDB.py +6 -25
  98. DIRAC/MonitoringSystem/Service/MonitoringHandler.py +0 -33
  99. DIRAC/MonitoringSystem/Service/WebAppHandler.py +599 -0
  100. DIRAC/MonitoringSystem/private/MainReporter.py +0 -3
  101. DIRAC/ProductionSystem/DB/ProductionDB.sql +4 -4
  102. DIRAC/ProductionSystem/scripts/dirac_prod_get.py +2 -2
  103. DIRAC/ProductionSystem/scripts/dirac_prod_get_all.py +2 -2
  104. DIRAC/ProductionSystem/scripts/dirac_prod_get_trans.py +2 -3
  105. DIRAC/RequestManagementSystem/Agent/RequestExecutingAgent.py +8 -6
  106. DIRAC/RequestManagementSystem/Agent/RequestOperations/ForwardDISET.py +2 -14
  107. DIRAC/RequestManagementSystem/Client/ReqClient.py +66 -13
  108. DIRAC/RequestManagementSystem/ConfigTemplate.cfg +6 -6
  109. DIRAC/RequestManagementSystem/DB/RequestDB.py +10 -5
  110. DIRAC/RequestManagementSystem/DB/test/RMSTestScenari.py +2 -0
  111. DIRAC/RequestManagementSystem/private/RequestValidator.py +40 -46
  112. DIRAC/ResourceStatusSystem/Client/SiteStatus.py +4 -2
  113. DIRAC/ResourceStatusSystem/Command/FreeDiskSpaceCommand.py +3 -1
  114. DIRAC/ResourceStatusSystem/DB/ResourceManagementDB.py +8 -8
  115. DIRAC/ResourceStatusSystem/DB/ResourceStatusDB.py +2 -2
  116. DIRAC/ResourceStatusSystem/Utilities/CSHelpers.py +2 -31
  117. DIRAC/ResourceStatusSystem/scripts/dirac_rss_set_status.py +30 -12
  118. DIRAC/Resources/Catalog/RucioFileCatalogClient.py +195 -1
  119. DIRAC/Resources/Catalog/test/Test_RucioFileCatalogClient.py +181 -0
  120. DIRAC/Resources/Computing/AREXComputingElement.py +25 -8
  121. DIRAC/Resources/Computing/BatchSystems/Condor.py +126 -108
  122. DIRAC/Resources/Computing/BatchSystems/SLURM.py +5 -1
  123. DIRAC/Resources/Computing/BatchSystems/test/Test_SLURM.py +46 -0
  124. DIRAC/Resources/Computing/ComputingElement.py +1 -1
  125. DIRAC/Resources/Computing/HTCondorCEComputingElement.py +44 -44
  126. DIRAC/Resources/Computing/InProcessComputingElement.py +4 -2
  127. DIRAC/Resources/Computing/LocalComputingElement.py +1 -18
  128. DIRAC/Resources/Computing/SSHBatchComputingElement.py +1 -17
  129. DIRAC/Resources/Computing/SSHComputingElement.py +1 -18
  130. DIRAC/Resources/Computing/SingularityComputingElement.py +19 -5
  131. DIRAC/Resources/Computing/test/Test_HTCondorCEComputingElement.py +67 -49
  132. DIRAC/Resources/Computing/test/Test_PoolComputingElement.py +2 -1
  133. DIRAC/Resources/IdProvider/CheckInIdProvider.py +13 -0
  134. DIRAC/Resources/IdProvider/IdProviderFactory.py +11 -3
  135. DIRAC/Resources/MessageQueue/StompMQConnector.py +1 -1
  136. DIRAC/Resources/Storage/GFAL2_StorageBase.py +24 -15
  137. DIRAC/Resources/Storage/OccupancyPlugins/WLCGAccountingHTTPJson.py +1 -3
  138. DIRAC/Resources/Storage/StorageBase.py +4 -2
  139. DIRAC/Resources/Storage/StorageElement.py +6 -7
  140. DIRAC/StorageManagementSystem/DB/StorageManagementDB.sql +2 -2
  141. DIRAC/TransformationSystem/Agent/TaskManagerAgentBase.py +10 -16
  142. DIRAC/TransformationSystem/Agent/TransformationAgent.py +22 -1
  143. DIRAC/TransformationSystem/Agent/TransformationCleaningAgent.py +16 -16
  144. DIRAC/TransformationSystem/Client/TaskManager.py +2 -4
  145. DIRAC/TransformationSystem/Client/Transformation.py +6 -7
  146. DIRAC/TransformationSystem/Client/TransformationClient.py +21 -11
  147. DIRAC/TransformationSystem/Client/Utilities.py +9 -0
  148. DIRAC/TransformationSystem/DB/TransformationDB.py +11 -14
  149. DIRAC/TransformationSystem/DB/TransformationDB.sql +9 -9
  150. DIRAC/TransformationSystem/Service/TransformationManagerHandler.py +0 -333
  151. DIRAC/TransformationSystem/Utilities/ReplicationCLIParameters.py +3 -3
  152. DIRAC/TransformationSystem/Utilities/TransformationInfo.py +7 -5
  153. DIRAC/TransformationSystem/scripts/dirac_production_runjoblocal.py +2 -4
  154. DIRAC/TransformationSystem/test/Test_TransformationInfo.py +22 -15
  155. DIRAC/TransformationSystem/test/Test_replicationTransformation.py +5 -6
  156. DIRAC/Workflow/Modules/test/Test_Modules.py +5 -0
  157. DIRAC/WorkloadManagementSystem/Agent/JobAgent.py +38 -26
  158. DIRAC/WorkloadManagementSystem/Agent/JobCleaningAgent.py +12 -8
  159. DIRAC/WorkloadManagementSystem/Agent/PilotSyncAgent.py +4 -3
  160. DIRAC/WorkloadManagementSystem/Agent/PushJobAgent.py +13 -13
  161. DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py +18 -14
  162. DIRAC/WorkloadManagementSystem/Agent/StalledJobAgent.py +18 -51
  163. DIRAC/WorkloadManagementSystem/Agent/StatesAccountingAgent.py +41 -1
  164. DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_JobAgent.py +45 -4
  165. DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_JobCleaningAgent.py +7 -9
  166. DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_PushJobAgent.py +1 -0
  167. DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_SiteDirector.py +9 -2
  168. DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_StalledJobAgent.py +4 -5
  169. DIRAC/WorkloadManagementSystem/Client/DownloadInputData.py +9 -9
  170. DIRAC/WorkloadManagementSystem/Client/InputDataResolution.py +6 -6
  171. DIRAC/WorkloadManagementSystem/Client/JobMonitoringClient.py +10 -11
  172. DIRAC/WorkloadManagementSystem/Client/JobReport.py +1 -1
  173. DIRAC/WorkloadManagementSystem/Client/JobState/CachedJobState.py +3 -0
  174. DIRAC/WorkloadManagementSystem/Client/JobState/JobManifest.py +32 -261
  175. DIRAC/WorkloadManagementSystem/Client/JobState/JobState.py +6 -0
  176. DIRAC/WorkloadManagementSystem/Client/JobStateUpdateClient.py +3 -0
  177. DIRAC/WorkloadManagementSystem/Client/JobStatus.py +8 -152
  178. DIRAC/WorkloadManagementSystem/Client/PoolXMLSlice.py +12 -19
  179. DIRAC/WorkloadManagementSystem/Client/SandboxStoreClient.py +25 -38
  180. DIRAC/WorkloadManagementSystem/Client/WMSClient.py +2 -3
  181. DIRAC/WorkloadManagementSystem/Client/test/Test_Client_DownloadInputData.py +29 -0
  182. DIRAC/WorkloadManagementSystem/ConfigTemplate.cfg +4 -8
  183. DIRAC/WorkloadManagementSystem/DB/JobDB.py +89 -132
  184. DIRAC/WorkloadManagementSystem/DB/JobDB.sql +8 -8
  185. DIRAC/WorkloadManagementSystem/DB/JobDBUtils.py +18 -147
  186. DIRAC/WorkloadManagementSystem/DB/JobLoggingDB.py +19 -6
  187. DIRAC/WorkloadManagementSystem/DB/JobParametersDB.py +9 -9
  188. DIRAC/WorkloadManagementSystem/DB/PilotAgentsDB.py +16 -5
  189. DIRAC/WorkloadManagementSystem/DB/PilotAgentsDB.sql +3 -3
  190. DIRAC/WorkloadManagementSystem/DB/SandboxMetadataDB.py +44 -82
  191. DIRAC/WorkloadManagementSystem/DB/StatusUtils.py +125 -0
  192. DIRAC/WorkloadManagementSystem/DB/tests/Test_JobDB.py +1 -1
  193. DIRAC/WorkloadManagementSystem/DB/tests/Test_StatusUtils.py +28 -0
  194. DIRAC/WorkloadManagementSystem/Executor/JobSanity.py +5 -4
  195. DIRAC/WorkloadManagementSystem/Executor/JobScheduling.py +4 -0
  196. DIRAC/WorkloadManagementSystem/FutureClient/JobStateUpdateClient.py +75 -33
  197. DIRAC/WorkloadManagementSystem/JobWrapper/JobWrapper.py +22 -11
  198. DIRAC/WorkloadManagementSystem/JobWrapper/JobWrapperTemplate.py +9 -10
  199. DIRAC/WorkloadManagementSystem/JobWrapper/test/Test_JobWrapper.py +60 -10
  200. DIRAC/WorkloadManagementSystem/JobWrapper/test/Test_JobWrapperTemplate.py +4 -0
  201. DIRAC/WorkloadManagementSystem/Service/JobManagerHandler.py +33 -154
  202. DIRAC/WorkloadManagementSystem/Service/JobMonitoringHandler.py +5 -323
  203. DIRAC/WorkloadManagementSystem/Service/JobStateUpdateHandler.py +0 -16
  204. DIRAC/WorkloadManagementSystem/Service/PilotManagerHandler.py +6 -103
  205. DIRAC/WorkloadManagementSystem/Service/SandboxStoreHandler.py +7 -53
  206. DIRAC/WorkloadManagementSystem/Service/WMSAdministratorHandler.py +16 -79
  207. DIRAC/WorkloadManagementSystem/Service/WMSUtilities.py +4 -18
  208. DIRAC/WorkloadManagementSystem/Utilities/JobModel.py +28 -209
  209. DIRAC/WorkloadManagementSystem/Utilities/JobParameters.py +65 -3
  210. DIRAC/WorkloadManagementSystem/Utilities/JobStatusUtility.py +2 -64
  211. DIRAC/WorkloadManagementSystem/Utilities/ParametricJob.py +7 -171
  212. DIRAC/WorkloadManagementSystem/Utilities/PilotCStoJSONSynchronizer.py +73 -7
  213. DIRAC/WorkloadManagementSystem/Utilities/PilotWrapper.py +41 -11
  214. DIRAC/WorkloadManagementSystem/Utilities/RemoteRunner.py +16 -0
  215. DIRAC/WorkloadManagementSystem/Utilities/Utils.py +36 -1
  216. DIRAC/WorkloadManagementSystem/Utilities/jobAdministration.py +15 -0
  217. DIRAC/WorkloadManagementSystem/Utilities/test/Test_JobModel.py +1 -15
  218. DIRAC/WorkloadManagementSystem/Utilities/test/Test_ParametricJob.py +45 -128
  219. DIRAC/WorkloadManagementSystem/Utilities/test/Test_PilotWrapper.py +16 -0
  220. DIRAC/WorkloadManagementSystem/scripts/dirac_jobexec.py +7 -2
  221. DIRAC/WorkloadManagementSystem/scripts/dirac_wms_pilot_job_info.py +1 -1
  222. DIRAC/__init__.py +62 -60
  223. DIRAC/tests/Utilities/testJobDefinitions.py +22 -28
  224. {DIRAC-9.0.0a42.dist-info → dirac-9.0.7.dist-info}/METADATA +8 -5
  225. {DIRAC-9.0.0a42.dist-info → dirac-9.0.7.dist-info}/RECORD +229 -228
  226. {DIRAC-9.0.0a42.dist-info → dirac-9.0.7.dist-info}/WHEEL +1 -1
  227. {DIRAC-9.0.0a42.dist-info → dirac-9.0.7.dist-info}/entry_points.txt +0 -3
  228. DIRAC/Core/Utilities/test/Test_List.py +0 -150
  229. DIRAC/Core/Utilities/test/Test_Time.py +0 -88
  230. DIRAC/Resources/Computing/PilotBundle.py +0 -70
  231. DIRAC/TransformationSystem/scripts/dirac_transformation_archive.py +0 -30
  232. DIRAC/TransformationSystem/scripts/dirac_transformation_clean.py +0 -30
  233. DIRAC/TransformationSystem/scripts/dirac_transformation_remove_output.py +0 -30
  234. DIRAC/WorkloadManagementSystem/Utilities/test/Test_JobManager.py +0 -58
  235. {DIRAC-9.0.0a42.dist-info → dirac-9.0.7.dist-info/licenses}/LICENSE +0 -0
  236. {DIRAC-9.0.0a42.dist-info → dirac-9.0.7.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -145,13 +145,10 @@ dirac-status-component = DIRAC.FrameworkSystem.scripts.dirac_status_component:ma
145
145
  dirac-stop-component = DIRAC.FrameworkSystem.scripts.dirac_stop_component:main [server]
146
146
  dirac-sys-sendmail = DIRAC.FrameworkSystem.scripts.dirac_sys_sendmail:main [admin]
147
147
  dirac-transformation-add-files = DIRAC.TransformationSystem.scripts.dirac_transformation_add_files:main [admin]
148
- dirac-transformation-archive = DIRAC.TransformationSystem.scripts.dirac_transformation_archive:main [admin]
149
- dirac-transformation-clean = DIRAC.TransformationSystem.scripts.dirac_transformation_clean:main [admin]
150
148
  dirac-transformation-cli = DIRAC.TransformationSystem.scripts.dirac_transformation_cli:main [admin]
151
149
  dirac-transformation-get-files = DIRAC.TransformationSystem.scripts.dirac_transformation_get_files:main [admin]
152
150
  dirac-transformation-information = DIRAC.TransformationSystem.scripts.dirac_transformation_information:main [admin]
153
151
  dirac-transformation-recover-data = DIRAC.TransformationSystem.scripts.dirac_transformation_recover_data:main [admin]
154
- dirac-transformation-remove-output = DIRAC.TransformationSystem.scripts.dirac_transformation_remove_output:main [admin]
155
152
  dirac-transformation-replication = DIRAC.TransformationSystem.scripts.dirac_transformation_replication:main [admin]
156
153
  dirac-transformation-update-derived = DIRAC.TransformationSystem.scripts.dirac_transformation_update_derived:main [admin]
157
154
  dirac-transformation-verify-outputdata = DIRAC.TransformationSystem.scripts.dirac_transformation_verify_outputdata:main [admin]
@@ -1,150 +0,0 @@
1
- ########################################################################
2
- # Author: Krzysztof.Ciba@NOSPAMgmail.com
3
- # Date: 2011/01/17 08:17:58
4
- ########################################################################
5
-
6
- """.. module:: ListTestCase
7
-
8
- Test cases for DIRAC.Core.Utilities.List module.
9
-
10
- """
11
- import unittest
12
-
13
- # sut
14
- from DIRAC.Core.Utilities import List
15
-
16
-
17
- ########################################################################
18
- class ListTestCase(unittest.TestCase):
19
- """py:class ListTestCase
20
- Test case for DIRAC.Core.Utilities.List module.
21
- """
22
-
23
- def testUniqueElements(self):
24
- """uniqueElements tests"""
25
- # empty list
26
- aList = []
27
- self.assertEqual(List.uniqueElements(aList), [])
28
- # redundant elements
29
- aList = [1, 1, 2, 3]
30
- self.assertEqual(List.uniqueElements(aList), [1, 2, 3])
31
-
32
- def testAppendUnique(self):
33
- """appendUnique tests"""
34
- # empty
35
- aList = []
36
- List.appendUnique(aList, None)
37
- self.assertEqual(aList, [None])
38
- # redundant element
39
- aList = [1, 2, 3]
40
- List.appendUnique(aList, 1)
41
- self.assertEqual(aList, [1, 2, 3])
42
- # all unique
43
- aList = [1, 2]
44
- List.appendUnique(aList, 3)
45
- self.assertEqual(aList, [1, 2, 3])
46
-
47
- def testRandomize(self):
48
- """randomize tests"""
49
- # empty list
50
- aList = []
51
- randList = List.randomize(aList)
52
- self.assertEqual(randList, [])
53
- # non empty
54
- aList = ["1", "2", "3"]
55
- randList = List.randomize(aList)
56
- self.assertEqual(len(aList), len(randList))
57
- for x in aList:
58
- self.assertEqual(x in randList, True)
59
- for x in randList:
60
- self.assertEqual(x in aList, True)
61
-
62
- def testPop(self):
63
- """pop tests"""
64
- # empty list
65
- aList = []
66
- x = List.pop(aList, 1)
67
- self.assertEqual(aList, [])
68
- self.assertEqual(x, None)
69
- # pop
70
- aList = [1, 2, 3]
71
- x = List.pop(aList, 2)
72
- self.assertEqual(x, 2)
73
- self.assertEqual(aList, [1, 3])
74
-
75
- def testStringListToString(self):
76
- """stringListToString tests"""
77
- # empty list
78
- aList = []
79
- aStr = List.stringListToString(aList)
80
- self.assertEqual(aStr, "")
81
- # not string elements (should it raise an exception???)
82
- aList = ["a", 1]
83
- aStr = List.stringListToString(aList)
84
- self.assertEqual(aStr, "'a','1'")
85
- # normal list
86
- aList = ["a", "b", "c"]
87
- aStr = List.stringListToString(aList)
88
- self.assertEqual(aStr, "'a','b','c'")
89
-
90
- def testIntListToString(self):
91
- """intListToString"""
92
- # empty list
93
- aList = []
94
- aStr = List.intListToString(aList)
95
- self.assertEqual(aStr, "")
96
- # int list
97
- aList = [1, 2, 3]
98
- aStr = List.intListToString(aList)
99
- self.assertEqual(aStr, "1,2,3")
100
- # mixture elements (should it raise an exception???)
101
- aList = ["1", 2, 3]
102
- aStr = List.intListToString(aList)
103
- self.assertEqual(aStr, "1,2,3")
104
-
105
- def testFromChar(self):
106
- """fromChar tests"""
107
- # empty string
108
- aStr = ""
109
- self.assertEqual(List.fromChar(aStr, "-"), [])
110
- # wrong sep (should it raise an exception???)
111
- aStr = "a:b:c"
112
- self.assertEqual(List.fromChar(aStr, "-"), ["a:b:c"])
113
- # norman behavior
114
- aStr = "a:b:c"
115
- self.assertEqual(List.fromChar(aStr, ":"), ["a", "b", "c"])
116
- # only sep
117
- aStr = ","
118
- self.assertEqual(List.fromChar(aStr, ","), [])
119
- # too many separators
120
- aStr = "a,,b,,c,,,"
121
- self.assertEqual(List.fromChar(aStr, ","), ["a", "b", "c"])
122
-
123
- def testBreakListIntoChunks(self):
124
- """breakListIntoChunks tests"""
125
- # empty list
126
- aList = []
127
- self.assertEqual(List.breakListIntoChunks(aList, 5), [])
128
- # negative number of chunks
129
- try:
130
- List.breakListIntoChunks([], -2)
131
- except Exception as val:
132
- self.assertEqual(isinstance(val, RuntimeError), True)
133
- self.assertEqual(str(val), "chunkSize cannot be less than 1")
134
-
135
- # normal behavior
136
- aList = list(range(10))
137
- self.assertEqual(List.breakListIntoChunks(aList, 5), [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]])
138
- # and once again this time with a rest
139
- aList = list(range(10))
140
- self.assertEqual(List.breakListIntoChunks(aList, 4), [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9]])
141
- # almost empty list, too many chunks
142
- aList = [1]
143
- self.assertEqual(List.breakListIntoChunks(aList, 2), [[1]])
144
-
145
-
146
- # test suite execution
147
- if __name__ == "__main__":
148
- TESTLOADER = unittest.TestLoader()
149
- SUITE = TESTLOADER.loadTestsFromTestCase(ListTestCase)
150
- unittest.TextTestRunner(verbosity=3).run(SUITE)
@@ -1,88 +0,0 @@
1
- """ Test class for plugins
2
- """
3
- # imports
4
- import unittest
5
-
6
- # sut
7
- from DIRAC.Core.Utilities.TimeUtilities import timeThis
8
-
9
-
10
- class logClass:
11
- def __init__(self):
12
- self._systemName = "aSystemName"
13
- self._subName = "sSubName"
14
-
15
-
16
- @timeThis
17
- def myMethod():
18
- print("boh")
19
-
20
-
21
- class myClass:
22
- def __init__(self):
23
- self.log = logClass()
24
-
25
- @timeThis
26
- def myMethodInAClass(self):
27
- print("boh")
28
-
29
-
30
- class myBetterClass:
31
- def __init__(self):
32
- self.log = logClass()
33
- self.log._subName = "anotherSubName"
34
-
35
- @timeThis
36
- def myMethodInAClass(self):
37
- print("boh")
38
-
39
-
40
- class myEvenBetterClass:
41
- def __init__(self):
42
- self.log = logClass()
43
- self.transString = "this is a transString"
44
-
45
- @timeThis
46
- def myMethodInAClass(self, a, b=None):
47
- print("boh")
48
-
49
-
50
- class TimeTestCase(unittest.TestCase):
51
- """Base class for the Agents test cases"""
52
-
53
- def setUp(self):
54
- pass
55
-
56
- def tearDown(self):
57
- pass
58
-
59
-
60
- class TimeSuccess(TimeTestCase):
61
- def test_timeThis(self):
62
- self.assertIsNone(myMethod())
63
- self.assertIsNone(myClass().myMethodInAClass())
64
- self.assertIsNone(myBetterClass().myMethodInAClass())
65
- a1 = ["aa", "bb"]
66
- a2 = "bb"
67
- self.assertIsNone(myEvenBetterClass().myMethodInAClass(a1, b=a2))
68
- a1 = "aa"
69
- a2 = {"a": "aa", "b": "bb"}
70
- self.assertIsNone(myEvenBetterClass().myMethodInAClass(a1, b=a2))
71
- a1 = "aa"
72
- a2 = {"a": "aa", "b": "bb"}
73
- self.assertIsNone(myEvenBetterClass().myMethodInAClass(a=a1, b=a2))
74
- a1 = "aa"
75
- a2 = {"a": "aa", "b": "bb", "c": "cc"}
76
- self.assertIsNone(myEvenBetterClass().myMethodInAClass(a=a2, b=a2))
77
-
78
-
79
- #############################################################################
80
- # Test Suite run
81
- #############################################################################
82
-
83
- if __name__ == "__main__":
84
- suite = unittest.defaultTestLoader.loadTestsFromTestCase(TimeTestCase)
85
- suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(TimeSuccess))
86
- testResult = unittest.TextTestRunner(verbosity=2).run(suite)
87
-
88
- # EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#
@@ -1,70 +0,0 @@
1
- """
2
- Collection of Utilities to handle pilot jobs
3
-
4
- """
5
- import os
6
- import base64
7
- import bz2
8
- import tempfile
9
-
10
-
11
- def bundleProxy(executableFile, proxy):
12
- """Create a self extracting archive bundling together an executable script and a proxy"""
13
-
14
- compressedAndEncodedProxy = base64.b64encode(bz2.compress(proxy.dumpAllToString()["Value"])).decode()
15
- with open(executableFile, "rb") as fp:
16
- compressedAndEncodedExecutable = base64.b64encode(bz2.compress(fp.read(), 9)).decode()
17
-
18
- bundle = """#!/usr/bin/env python
19
- # Wrapper script for executable and proxy
20
- import os
21
- import tempfile
22
- import sys
23
- import stat
24
- import base64
25
- import bz2
26
- import shutil
27
-
28
- try:
29
- workingDirectory = tempfile.mkdtemp(suffix='_wrapper', prefix='TORQUE_')
30
- os.chdir(workingDirectory)
31
-
32
- # Decode and decompress the proxy
33
- with open('proxy', "wb") as proxy_file:
34
- proxy_file.write(bz2.decompress(base64.b64decode("{compressedAndEncodedProxy}")))
35
-
36
- # Decode and decompress the executable
37
- with open('{executable}', "wb") as executable_file:
38
- executable_file.write(bz2.decompress(base64.b64decode("{compressedAndEncodedExecutable}")))
39
-
40
- os.chmod('proxy', stat.S_IRUSR | stat.S_IWUSR)
41
- os.chmod('{executable}', stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
42
- os.environ["X509_USER_PROXY"] = os.path.join(workingDirectory, 'proxy')
43
- except Exception as x:
44
- print("Error:", x, file=sys.stderr)
45
- sys.exit(-1)
46
-
47
- cmd = "./{executable}"
48
- print('Executing:', cmd)
49
- sys.stdout.flush()
50
- os.system(cmd)
51
-
52
- shutil.rmtree(workingDirectory)
53
- """.format(
54
- compressedAndEncodedProxy=compressedAndEncodedProxy,
55
- compressedAndEncodedExecutable=compressedAndEncodedExecutable,
56
- executable=os.path.basename(executableFile),
57
- )
58
-
59
- return bundle
60
-
61
-
62
- def writeScript(script, writeDir=None):
63
- """
64
- Write script into a temporary unique file under provided writeDir
65
- """
66
- fd, name = tempfile.mkstemp(suffix="_pilotWrapper.py", prefix="DIRAC_", dir=writeDir)
67
- pilotWrapper = os.fdopen(fd, "w")
68
- pilotWrapper.write(script)
69
- pilotWrapper.close()
70
- return name
@@ -1,30 +0,0 @@
1
- #!/usr/bin/env python
2
- """
3
- Archive a transformation
4
- """
5
- from DIRAC.Core.Base.Script import Script
6
-
7
-
8
- @Script()
9
- def main():
10
- # Registering arguments will automatically add their description to the help menu
11
- Script.registerArgument(["transID: transformation ID"])
12
- _, args = Script.parseCommandLine()
13
-
14
- transIDs = [int(arg) for arg in args]
15
-
16
- from DIRAC.TransformationSystem.Agent.TransformationCleaningAgent import TransformationCleaningAgent
17
-
18
- agent = TransformationCleaningAgent(
19
- "Transformation/TransformationCleaningAgent",
20
- "Transformation/TransformationCleaningAgent",
21
- "dirac-transformation-archive",
22
- )
23
- agent.initialize()
24
-
25
- for transID in transIDs:
26
- agent.archiveTransformation(transID)
27
-
28
-
29
- if __name__ == "__main__":
30
- main()
@@ -1,30 +0,0 @@
1
- #!/usr/bin/env python
2
- """
3
- Clean a tranformation
4
- """
5
- from DIRAC.Core.Base.Script import Script
6
-
7
-
8
- @Script()
9
- def main():
10
- # Registering arguments will automatically add their description to the help menu
11
- Script.registerArgument(["transID: transformation ID"])
12
- _, args = Script.parseCommandLine()
13
-
14
- from DIRAC.TransformationSystem.Agent.TransformationCleaningAgent import TransformationCleaningAgent
15
-
16
- transIDs = [int(arg) for arg in args]
17
-
18
- agent = TransformationCleaningAgent(
19
- "Transformation/TransformationCleaningAgent",
20
- "Transformation/TransformationCleaningAgent",
21
- "dirac-transformation-clean",
22
- )
23
- agent.initialize()
24
-
25
- for transID in transIDs:
26
- agent.cleanTransformation(transID)
27
-
28
-
29
- if __name__ == "__main__":
30
- main()
@@ -1,30 +0,0 @@
1
- #!/usr/bin/env python
2
- """
3
- Remove the outputs produced by a transformation
4
- """
5
- from DIRAC.Core.Base.Script import Script
6
-
7
-
8
- @Script()
9
- def main():
10
- # Registering arguments will automatically add their description to the help menu
11
- Script.registerArgument(["transID: transformation ID"])
12
- _, args = Script.parseCommandLine()
13
-
14
- transIDs = [int(arg) for arg in args]
15
-
16
- from DIRAC.TransformationSystem.Agent.TransformationCleaningAgent import TransformationCleaningAgent
17
-
18
- agent = TransformationCleaningAgent(
19
- "Transformation/TransformationCleaningAgent",
20
- "Transformation/TransformationCleaningAgent",
21
- "dirac-transformation-remove-output",
22
- )
23
- agent.initialize()
24
-
25
- for transID in transIDs:
26
- agent.removeTransformationOutput(transID)
27
-
28
-
29
- if __name__ == "__main__":
30
- main()
@@ -1,58 +0,0 @@
1
- """ unit test (pytest) of JobManager service
2
- """
3
-
4
- from unittest.mock import MagicMock
5
- import pytest
6
-
7
- from DIRAC import gLogger
8
-
9
- gLogger.setLevel("DEBUG")
10
-
11
- from DIRAC.WorkloadManagementSystem.Service.JobPolicy import (
12
- RIGHT_DELETE,
13
- RIGHT_KILL,
14
- )
15
-
16
- # sut
17
- from DIRAC.WorkloadManagementSystem.Service.JobManagerHandler import JobManagerHandlerMixin
18
-
19
- # mocks
20
- jobPolicy_mock = MagicMock()
21
- jobDB_mock = MagicMock()
22
- jobDB_mock.getJobsAttributes.return_value = {"OK": True, "Value": {}}
23
-
24
-
25
- @pytest.mark.parametrize(
26
- "jobIDs_list, right, lists, filteredJobsList, expected_res, expected_value",
27
- [
28
- ([], RIGHT_KILL, ([], [], [], []), [], True, []),
29
- ([], RIGHT_DELETE, ([], [], [], []), [], True, []),
30
- (1, RIGHT_KILL, ([], [], [], []), [], True, []),
31
- (1, RIGHT_KILL, ([1], [], [], []), [], True, []),
32
- ([1, 2], RIGHT_KILL, ([], [], [], []), [], True, []),
33
- ([1, 2], RIGHT_KILL, ([1], [], [], []), [], True, []),
34
- (1, RIGHT_KILL, ([1], [], [], []), [1], True, [1]),
35
- ([1, 2], RIGHT_KILL, ([1], [], [], []), [1], True, [1]),
36
- ([1, 2], RIGHT_KILL, ([1], [2], [], []), [1], True, [1]),
37
- ([1, 2], RIGHT_KILL, ([1], [2], [], []), [], True, []),
38
- ([1, 2], RIGHT_KILL, ([1, 2], [], [], []), [1, 2], True, [1, 2]),
39
- ],
40
- )
41
- def test___kill_delete_jobs(mocker, jobIDs_list, right, lists, filteredJobsList, expected_res, expected_value):
42
- mocker.patch(
43
- "DIRAC.WorkloadManagementSystem.Service.JobManagerHandler.filterJobStateTransition",
44
- return_value={"OK": True, "Value": filteredJobsList},
45
- )
46
-
47
- JobManagerHandlerMixin.log = gLogger
48
- JobManagerHandlerMixin.jobPolicy = jobPolicy_mock
49
- JobManagerHandlerMixin.jobDB = jobDB_mock
50
- JobManagerHandlerMixin.taskQueueDB = MagicMock()
51
-
52
- jobPolicy_mock.evaluateJobRights.return_value = lists
53
-
54
- jm = JobManagerHandlerMixin()
55
-
56
- res = jm._kill_delete_jobs(jobIDs_list, right)
57
- assert res["OK"] == expected_res
58
- assert res["Value"] == expected_value