@@ -439,6 +439,35 @@ def _test_no_updatable_custom_actions(base_conf, target_conf):
439439 )
440440
441441
442+ def _test_no_updatable_custom_actions_sequence (base_conf , target_conf ):
443+ base_conf ["HeadNode" ].update (
444+ {
445+ "CustomActions" : {
446+ "OnNodeConfigured" : {"Sequence" : [{"Script" : "test-to-edit.sh" , "Args" : ["1" , "2" ]}]},
447+ }
448+ }
449+ )
450+ target_conf ["HeadNode" ].update (
451+ {"CustomActions" : {"OnNodeConfigured" : {"Sequence" : [{"Script" : "test-to-edit.sh" , "Args" : ["2" ]}]}}}
452+ )
453+
454+ _check_patch (
455+ base_conf ,
456+ target_conf ,
457+ [
458+ Change (
459+ ["HeadNode" , "CustomActions" , "OnNodeConfigured" ],
460+ "Sequence" ,
461+ [{"Script" : "test-to-edit.sh" , "Args" : ["1" , "2" ]}],
462+ [{"Script" : "test-to-edit.sh" , "Args" : ["2" ]}],
463+ UpdatePolicy .UNSUPPORTED ,
464+ is_list = False ,
465+ ),
466+ ],
467+ UpdatePolicy .UNSUPPORTED ,
468+ )
469+
470+
442471def _test_updatable_custom_actions_attributes (base_conf , target_conf ):
443472 base_conf ["HeadNode" ].update (
444473 {"CustomActions" : {"OnNodeUpdated" : {"Script" : "test-to-edit.sh" , "Args" : ["1" , "2" ]}}}
@@ -491,6 +520,71 @@ def _test_updatable_custom_actions(base_conf, target_conf):
491520 )
492521
493522
523+ def _test_updatable_custom_actions_sequence_add (base_conf , target_conf ):
524+ target_conf ["HeadNode" ].update (
525+ {"CustomActions" : {"OnNodeUpdated" : {"Sequence" : [{"Script" : "test-to-remove.sh" }]}}}
526+ )
527+
528+ _check_patch (
529+ base_conf ,
530+ target_conf ,
531+ [
532+ Change (
533+ ["HeadNode" , "CustomActions" ],
534+ "OnNodeUpdated" ,
535+ "-" ,
536+ {"Sequence" : [{"Script" : "test-to-remove.sh" }]},
537+ UpdatePolicy .SUPPORTED ,
538+ is_list = False ,
539+ ),
540+ ],
541+ UpdatePolicy .SUPPORTED ,
542+ )
543+
544+
545+ def _test_updatable_custom_actions_sequence_change (base_conf , target_conf ):
546+ base_conf ["HeadNode" ].update ({"CustomActions" : {"OnNodeUpdated" : {"Sequence" : [{"Script" : "test-to-remove.sh" }]}}})
547+ target_conf ["HeadNode" ].update (
548+ {"CustomActions" : {"OnNodeUpdated" : {"Sequence" : [{"Script" : "another-script.sh" }]}}}
549+ )
550+
551+ _check_patch (
552+ base_conf ,
553+ target_conf ,
554+ [
555+ Change (
556+ ["HeadNode" , "CustomActions" , "OnNodeUpdated" ],
557+ "Sequence" ,
558+ [{"Script" : "test-to-remove.sh" }],
559+ [{"Script" : "another-script.sh" }],
560+ UpdatePolicy .SUPPORTED ,
561+ is_list = False ,
562+ ),
563+ ],
564+ UpdatePolicy .SUPPORTED ,
565+ )
566+
567+
568+ def _test_updatable_custom_actions_sequence_remove (base_conf , target_conf ):
569+ base_conf ["HeadNode" ].update ({"CustomActions" : {"OnNodeUpdated" : {"Sequence" : [{"Script" : "test-to-remove.sh" }]}}})
570+
571+ _check_patch (
572+ base_conf ,
573+ target_conf ,
574+ [
575+ Change (
576+ ["HeadNode" , "CustomActions" ],
577+ "OnNodeUpdated" ,
578+ {"Sequence" : [{"Script" : "test-to-remove.sh" }]},
579+ "-" ,
580+ UpdatePolicy .SUPPORTED ,
581+ is_list = False ,
582+ ),
583+ ],
584+ UpdatePolicy .SUPPORTED ,
585+ )
586+
587+
494588def _test_less_target_sections (base_conf , target_conf ):
495589 # Remove an ebs section in the target conf
496590 assert_that (_get_storage_by_name (target_conf , "ebs1" )).is_not_none ()
@@ -905,8 +999,12 @@ def _test_iam(base_conf, target_conf):
905999 _test_compute_resources ,
9061000 _test_queues ,
9071001 _test_no_updatable_custom_actions ,
1002+ _test_no_updatable_custom_actions_sequence ,
9081003 _test_updatable_custom_actions ,
9091004 _test_updatable_custom_actions_attributes ,
1005+ _test_updatable_custom_actions_sequence_add ,
1006+ _test_updatable_custom_actions_sequence_change ,
1007+ _test_updatable_custom_actions_sequence_remove ,
9101008 _test_storage ,
9111009 _test_iam ,
9121010 ],
0 commit comments