@@ -110,3 +110,346 @@ def test_modify_agent_control_scan_config_missing_config_raises(self):
110110 "fb6451bf-ec5a-45a8-8bab-5cf4b862e51b" ,
111111 config = None , # missing config
112112 )
113+
114+ def test_modify_agent_control_scan_config_config_not_mapping_raises (self ):
115+ with self .assertRaises (RequiredArgument ):
116+ self .gmp .modify_agent_control_scan_config (
117+ "fb6451bf-ec5a-45a8-8bab-5cf4b862e51b" , config = 123
118+ )
119+
120+ def test_modify_agent_control_scan_config_agent_control_not_mapping_raises (
121+ self ,
122+ ):
123+ cfg = {
124+ "agent_control" : "oops-not-a-mapping" ,
125+ "agent_script_executor" : {
126+ "bulk_size" : 2 ,
127+ "bulk_throttle_time_in_ms" : 300 ,
128+ "indexer_dir_depth" : 100 ,
129+ "scheduler_cron_time" : ["0 */12 * * *" ],
130+ },
131+ "heartbeat" : {"interval_in_seconds" : 300 , "miss_until_inactive" : 1 },
132+ }
133+ with self .assertRaises (RequiredArgument ):
134+ self .gmp .modify_agent_control_scan_config (
135+ "fb6451bf-ec5a-45a8-8bab-5cf4b862e51b" , config = cfg
136+ )
137+
138+ def test_modify_agent_control_scan_config_scheduler_empty_list_raises (self ):
139+ cfg = {
140+ "agent_control" : {
141+ "retry" : {
142+ "attempts" : 6 ,
143+ "delay_in_seconds" : 60 ,
144+ "max_jitter_in_seconds" : 10 ,
145+ }
146+ },
147+ "agent_script_executor" : {
148+ "bulk_size" : 2 ,
149+ "bulk_throttle_time_in_ms" : 300 ,
150+ "indexer_dir_depth" : 100 ,
151+ "scheduler_cron_time" : [],
152+ },
153+ "heartbeat" : {"interval_in_seconds" : 300 , "miss_until_inactive" : 1 },
154+ }
155+ with self .assertRaises (RequiredArgument ):
156+ self .gmp .modify_agent_control_scan_config (
157+ "fb6451bf-ec5a-45a8-8bab-5cf4b862e51b" , config = cfg
158+ )
159+
160+ def test_modify_agent_control_scan_config_scheduler_with_empty_item_raises (
161+ self ,
162+ ):
163+ cfg = {
164+ "agent_control" : {
165+ "retry" : {
166+ "attempts" : 6 ,
167+ "delay_in_seconds" : 60 ,
168+ "max_jitter_in_seconds" : 10 ,
169+ }
170+ },
171+ "agent_script_executor" : {
172+ "bulk_size" : 2 ,
173+ "bulk_throttle_time_in_ms" : 300 ,
174+ "indexer_dir_depth" : 100 ,
175+ "scheduler_cron_time" : ["" , " " ],
176+ },
177+ "heartbeat" : {"interval_in_seconds" : 300 , "miss_until_inactive" : 1 },
178+ }
179+ with self .assertRaises (RequiredArgument ):
180+ self .gmp .modify_agent_control_scan_config (
181+ "fb6451bf-ec5a-45a8-8bab-5cf4b862e51b" , config = cfg
182+ )
183+
184+ def test_modify_agent_control_scan_config_missing_agent_control_raises (
185+ self ,
186+ ):
187+ cfg = {
188+ # "agent_control": missing
189+ "agent_script_executor" : {
190+ "bulk_size" : 2 ,
191+ "bulk_throttle_time_in_ms" : 300 ,
192+ "indexer_dir_depth" : 100 ,
193+ "scheduler_cron_time" : ["0 */12 * * *" ],
194+ },
195+ "heartbeat" : {"interval_in_seconds" : 300 , "miss_until_inactive" : 1 },
196+ }
197+ with self .assertRaises (RequiredArgument ):
198+ self .gmp .modify_agent_control_scan_config (
199+ "fb6451bf-ec5a-45a8-8bab-5cf4b862e51b" , config = cfg
200+ )
201+
202+ def test_modify_agent_control_scan_config_missing_retry_block_raises (self ):
203+ cfg = {
204+ "agent_control" : {
205+ # "retry": {}
206+ },
207+ "agent_script_executor" : {
208+ "bulk_size" : 2 ,
209+ "bulk_throttle_time_in_ms" : 300 ,
210+ "indexer_dir_depth" : 100 ,
211+ "scheduler_cron_time" : ["0 */12 * * *" ],
212+ },
213+ "heartbeat" : {"interval_in_seconds" : 300 , "miss_until_inactive" : 1 },
214+ }
215+ with self .assertRaises (RequiredArgument ):
216+ self .gmp .modify_agent_control_scan_config (
217+ "fb6451bf-ec5a-45a8-8bab-5cf4b862e51b" , config = cfg
218+ )
219+
220+ def test_modify_agent_control_scan_config_missing_retry_attempts_raises (
221+ self ,
222+ ):
223+ cfg = {
224+ "agent_control" : {
225+ "retry" : {
226+ # "attempts": 6,
227+ "delay_in_seconds" : 60 ,
228+ "max_jitter_in_seconds" : 10 ,
229+ }
230+ },
231+ "agent_script_executor" : {
232+ "bulk_size" : 2 ,
233+ "bulk_throttle_time_in_ms" : 300 ,
234+ "indexer_dir_depth" : 100 ,
235+ "scheduler_cron_time" : ["0 */12 * * *" ],
236+ },
237+ "heartbeat" : {"interval_in_seconds" : 300 , "miss_until_inactive" : 1 },
238+ }
239+ with self .assertRaises (RequiredArgument ):
240+ self .gmp .modify_agent_control_scan_config (
241+ "fb6451bf-ec5a-45a8-8bab-5cf4b862e51b" , config = cfg
242+ )
243+
244+ def test_modify_agent_control_scan_config_missing_retry_delay_raises (self ):
245+ cfg = {
246+ "agent_control" : {
247+ "retry" : {
248+ "attempts" : 6 ,
249+ # "delay_in_seconds": 60,
250+ "max_jitter_in_seconds" : 10 ,
251+ }
252+ },
253+ "agent_script_executor" : {
254+ "bulk_size" : 2 ,
255+ "bulk_throttle_time_in_ms" : 300 ,
256+ "indexer_dir_depth" : 100 ,
257+ "scheduler_cron_time" : ["0 */12 * * *" ],
258+ },
259+ "heartbeat" : {"interval_in_seconds" : 300 , "miss_until_inactive" : 1 },
260+ }
261+ with self .assertRaises (RequiredArgument ):
262+ self .gmp .modify_agent_control_scan_config (
263+ "fb6451bf-ec5a-45a8-8bab-5cf4b862e51b" , config = cfg
264+ )
265+
266+ def test_modify_agent_control_scan_config_missing_retry_max_jitter_raises (
267+ self ,
268+ ):
269+ cfg = {
270+ "agent_control" : {
271+ "retry" : {
272+ "attempts" : 6 ,
273+ "delay_in_seconds" : 60 ,
274+ # "max_jitter_in_seconds": 10,
275+ }
276+ },
277+ "agent_script_executor" : {
278+ "bulk_size" : 2 ,
279+ "bulk_throttle_time_in_ms" : 300 ,
280+ "indexer_dir_depth" : 100 ,
281+ "scheduler_cron_time" : ["0 */12 * * *" ],
282+ },
283+ "heartbeat" : {"interval_in_seconds" : 300 , "miss_until_inactive" : 1 },
284+ }
285+ with self .assertRaises (RequiredArgument ):
286+ self .gmp .modify_agent_control_scan_config (
287+ "fb6451bf-ec5a-45a8-8bab-5cf4b862e51b" , config = cfg
288+ )
289+
290+ def test_modify_agent_control_scan_config_missing_agent_script_executor_raises (
291+ self ,
292+ ):
293+ cfg = {
294+ "agent_control" : {
295+ "retry" : {
296+ "attempts" : 6 ,
297+ "delay_in_seconds" : 60 ,
298+ "max_jitter_in_seconds" : 10 ,
299+ }
300+ },
301+ # "agent_script_executor": missing
302+ "heartbeat" : {"interval_in_seconds" : 300 , "miss_until_inactive" : 1 },
303+ }
304+ with self .assertRaises (RequiredArgument ):
305+ self .gmp .modify_agent_control_scan_config (
306+ "fb6451bf-ec5a-45a8-8bab-5cf4b862e51b" , config = cfg
307+ )
308+
309+ def test_modify_agent_control_scan_config_missing_bulk_size_raises (self ):
310+ cfg = {
311+ "agent_control" : {
312+ "retry" : {
313+ "attempts" : 6 ,
314+ "delay_in_seconds" : 60 ,
315+ "max_jitter_in_seconds" : 10 ,
316+ }
317+ },
318+ "agent_script_executor" : {
319+ # "bulk_size": 2,
320+ "bulk_throttle_time_in_ms" : 300 ,
321+ "indexer_dir_depth" : 100 ,
322+ "scheduler_cron_time" : ["0 */12 * * *" ],
323+ },
324+ "heartbeat" : {"interval_in_seconds" : 300 , "miss_until_inactive" : 1 },
325+ }
326+ with self .assertRaises (RequiredArgument ):
327+ self .gmp .modify_agent_control_scan_config (
328+ "fb6451bf-ec5a-45a8-8bab-5cf4b862e51b" , config = cfg
329+ )
330+
331+ def test_modify_agent_control_scan_config_missing_bulk_throttle_time_in_ms_raises (
332+ self ,
333+ ):
334+ cfg = {
335+ "agent_control" : {
336+ "retry" : {
337+ "attempts" : 6 ,
338+ "delay_in_seconds" : 60 ,
339+ "max_jitter_in_seconds" : 10 ,
340+ }
341+ },
342+ "agent_script_executor" : {
343+ "bulk_size" : 2 ,
344+ # "bulk_throttle_time_in_ms": 300,
345+ "indexer_dir_depth" : 100 ,
346+ "scheduler_cron_time" : ["0 */12 * * *" ],
347+ },
348+ "heartbeat" : {"interval_in_seconds" : 300 , "miss_until_inactive" : 1 },
349+ }
350+ with self .assertRaises (RequiredArgument ):
351+ self .gmp .modify_agent_control_scan_config (
352+ "fb6451bf-ec5a-45a8-8bab-5cf4b862e51b" , config = cfg
353+ )
354+
355+ def test_modify_agent_control_scan_config_missing_indexer_dir_depth_raises (
356+ self ,
357+ ):
358+ cfg = {
359+ "agent_control" : {
360+ "retry" : {
361+ "attempts" : 6 ,
362+ "delay_in_seconds" : 60 ,
363+ "max_jitter_in_seconds" : 10 ,
364+ }
365+ },
366+ "agent_script_executor" : {
367+ "bulk_size" : 2 ,
368+ "bulk_throttle_time_in_ms" : 300 ,
369+ # "indexer_dir_depth": 100,
370+ "scheduler_cron_time" : ["0 */12 * * *" ],
371+ },
372+ "heartbeat" : {"interval_in_seconds" : 300 , "miss_until_inactive" : 1 },
373+ }
374+ with self .assertRaises (RequiredArgument ):
375+ self .gmp .modify_agent_control_scan_config (
376+ "fb6451bf-ec5a-45a8-8bab-5cf4b862e51b" , config = cfg
377+ )
378+
379+ def test_modify_agent_control_scan_config_missing_heartbeat_block_raises (
380+ self ,
381+ ):
382+ cfg = {
383+ "agent_control" : {
384+ "retry" : {
385+ "attempts" : 6 ,
386+ "delay_in_seconds" : 60 ,
387+ "max_jitter_in_seconds" : 10 ,
388+ }
389+ },
390+ "agent_script_executor" : {
391+ "bulk_size" : 2 ,
392+ "bulk_throttle_time_in_ms" : 300 ,
393+ "indexer_dir_depth" : 100 ,
394+ "scheduler_cron_time" : ["0 */12 * * *" ],
395+ },
396+ # "heartbeat": missing
397+ }
398+ with self .assertRaises (RequiredArgument ):
399+ self .gmp .modify_agent_control_scan_config (
400+ "fb6451bf-ec5a-45a8-8bab-5cf4b862e51b" , config = cfg
401+ )
402+
403+ def test_modify_agent_control_scan_config_missing_heartbeat_interval_raises (
404+ self ,
405+ ):
406+ cfg = {
407+ "agent_control" : {
408+ "retry" : {
409+ "attempts" : 6 ,
410+ "delay_in_seconds" : 60 ,
411+ "max_jitter_in_seconds" : 10 ,
412+ }
413+ },
414+ "agent_script_executor" : {
415+ "bulk_size" : 2 ,
416+ "bulk_throttle_time_in_ms" : 300 ,
417+ "indexer_dir_depth" : 100 ,
418+ "scheduler_cron_time" : ["0 */12 * * *" ],
419+ },
420+ "heartbeat" : {
421+ # "interval_in_seconds": 300,
422+ "miss_until_inactive" : 1 ,
423+ },
424+ }
425+ with self .assertRaises (RequiredArgument ):
426+ self .gmp .modify_agent_control_scan_config (
427+ "fb6451bf-ec5a-45a8-8bab-5cf4b862e51b" , config = cfg
428+ )
429+
430+ def test_modify_agent_control_scan_config_missing_heartbeat_miss_until_inactive_raises (
431+ self ,
432+ ):
433+ cfg = {
434+ "agent_control" : {
435+ "retry" : {
436+ "attempts" : 6 ,
437+ "delay_in_seconds" : 60 ,
438+ "max_jitter_in_seconds" : 10 ,
439+ }
440+ },
441+ "agent_script_executor" : {
442+ "bulk_size" : 2 ,
443+ "bulk_throttle_time_in_ms" : 300 ,
444+ "indexer_dir_depth" : 100 ,
445+ "scheduler_cron_time" : ["0 */12 * * *" ],
446+ },
447+ "heartbeat" : {
448+ "interval_in_seconds" : 300 ,
449+ # "miss_until_inactive": 1,
450+ },
451+ }
452+ with self .assertRaises (RequiredArgument ):
453+ self .gmp .modify_agent_control_scan_config (
454+ "fb6451bf-ec5a-45a8-8bab-5cf4b862e51b" , config = cfg
455+ )
0 commit comments