3535#___INFO__MARK_END__
3636
3737# define global variable in this namespace
38- global check_name
39- global check_category
40- global check_description
38+ global check_name
39+ global check_category
40+ global check_description
4141global check_needs
42- global check_functions
42+ global check_functions
4343global check_root_access_needs
4444global check_need_running_system
4545
@@ -53,16 +53,26 @@ set check_description(0) "General Slotwise Suspend on Subordinate test"
5353set check_description(100) "General Slotwise Suspend on Subordinate test on all architectures"
5454
5555# define test's dependencies
56- set check_needs "init_core_system"
56+ set check_needs "init_core_system"
5757
5858# setup and cleanup functions
59+ set check_setup_function "general_ssos_setup"
60+ set check_cleanup_function "general_ssos_cleanup"
5961set check_setup_level_function "general_ssos_level_setup"
6062set check_cleanup_level_function "general_ssos_level_cleanup"
6163
6264# define test's procedure order
6365set check_functions {}
6466lappend check_functions "general_ssos_test"
6567
68+ proc general_ssos_setup {} {
69+ setup_host_slots_for_binding
70+ }
71+
72+ proc general_ssos_cleanup {} {
73+ cleanup_host_slots_for_binding
74+ }
75+
6676proc general_ssos_level_setup {} {
6777 global CHECK_USER CHECK_HAVE_TDOM
6878 global CHECK_ACT_LEVEL
@@ -88,7 +98,7 @@ proc general_ssos_level_setup {} {
8898 # G.q H.q
8999 # / \
90100 # I.q J.q
91- #
101+ #
92102 # J.q must be created first, because it is referenced in H.q and must already
93103 # exist when H.q is created, and so on
94104 set ssos_config(queue_list) {}
@@ -156,7 +166,7 @@ proc general_ssos_level_setup {} {
156166
157167proc general_ssos_level_cleanup {} {
158168 get_current_cluster_config_array ts_config
159- global ssos_config
169+ global ssos_config
160170
161171 delete_all_jobs
162172 wait_for_end_of_all_jobs
@@ -166,12 +176,12 @@ proc general_ssos_level_cleanup {} {
166176 # and can therefore be deleted immediately. Then B.q and C.q can be deleted,
167177 # and so on.
168178 set ssos_config(queue_list) [lsort -increasing $ssos_config(queue_list)]
169-
179+
170180 foreach queue $ssos_config(queue_list) {
171- del_queue $queue "" 1 1
181+ del_queue $queue "" 1 1
172182 }
173183
174- unset ssos_config
184+ unset ssos_config
175185}
176186
177187
@@ -236,7 +246,7 @@ proc ssos_test_suspension_in_deepest_queue {host djob_list} {
236246 # submit job to "G.q"
237247 set arguments "$my_fix_settings -q G.q@$host $ts_config(product_root)/examples/jobs/sleeper.sh 1000"
238248 set g_job [submit_job $arguments]
239- # wait for job start on D.q, G.q and 2 x J.q
249+ # wait for job start on D.q, G.q and 2 x J.q
240250 lappend job_list $d_job
241251 lappend job_list $g_job
242252 lappend job_list $first_j_job
@@ -301,7 +311,7 @@ proc ssos_test_unsuspend_on_manual_suspend {host djob_list} {
301311 global my_fix_settings
302312 set error_text ""
303313 #
304- # Test #2
314+ # Test #2
305315 # Check if the task in J.q that is suspended by slotwise subordination gets
306316 # unsuspended when the job in queue D.q gets manually suspended, because the
307317 # number of running tasks in the subordination tree drops to 4 or lower.
@@ -326,7 +336,7 @@ proc ssos_test_unsuspend_on_manual_suspend {host djob_list} {
326336 if {$queueState != "s"} {
327337 append error_text "queue \"$queue\" reports state \"$queueState\" which should be suspended \"s\"!\n"
328338 }
329-
339+
330340 # job on D.q should be in state "s"
331341 get_job_state $d_job 0 task_info
332342 if {$task_info(0,state) != "S"} {
@@ -403,7 +413,7 @@ proc ssos_test_sequence_number_obeyance {host} {
403413 append error_text "queue \"$queue\" reports state \"$queueState\" which is not expected!\n"
404414 }
405415 }
406-
416+
407417 # Now submit 2 jobs to C.q
408418 ts_log_fine "Submitting two jobs to C.q"
409419 set arguments "$my_fix_settings -q C.q@$host $ts_config(product_root)/examples/jobs/sleeper.sh 1000"
@@ -425,7 +435,7 @@ proc ssos_test_sequence_number_obeyance {host} {
425435 set arguments "$my_fix_settings -q A.q@$host $ts_config(product_root)/examples/jobs/sleeper.sh 1000"
426436 set a_job [submit_job $arguments]
427437 wait_for_jobstart $a_job "test" 999 1 1
428-
438+
429439 # now check that c_job_1 is in state "S", all others must be in state "r"
430440 ts_log_fine "Expecting the younger job in C.q to be suspended, even if it's older than the"
431441 ts_log_fine "jobs in B.q, because C.q has the lower sequence number."
@@ -469,7 +479,7 @@ proc ssos_test_sequence_number_obeyance {host} {
469479 ts_log_fine "Scenario 3 successfully completed"
470480 }
471481 set error_text ""
472-
482+
473483 delete_all_jobs
474484 wait_for_end_of_all_jobs
475485}
@@ -483,13 +493,13 @@ proc issue_GE_3233 { host } {
483493 ts_log_fine ""
484494 ts_log_fine "Testing for Bug 3233 (leaving one job suspended)"
485495
486- # submit 4 120 second jobs in C.q
496+ # submit 4 120 second jobs in C.q
487497 set arguments "$my_fix_settings -q C.q@$host $ts_config(product_root)/examples/jobs/sleeper.sh 180"
488498 set c_queue_job_1 [submit_job $arguments]
489499 set c_queue_job_2 [submit_job $arguments]
490500 set c_queue_job_3 [submit_job $arguments]
491501 set c_queue_job_4 [submit_job $arguments]
492-
502+
493503 lappend job_list1 $c_queue_job_1
494504 lappend job_list1 $c_queue_job_2
495505 lappend job_list1 $c_queue_job_3
@@ -498,27 +508,27 @@ proc issue_GE_3233 { host } {
498508 foreach job $job_list1 {
499509 wait_for_jobstart $job "test" 60 1 1
500510 }
501-
502- # submit 6 20 second jobs in A.q
511+
512+ # submit 6 20 second jobs in A.q
503513 set arguments "$my_fix_settings -q A.q@$host $ts_config(product_root)/examples/jobs/sleeper.sh 10"
504514 set c_queue_job_1 [submit_job $arguments]
505515 set c_queue_job_2 [submit_job $arguments]
506516 set c_queue_job_3 [submit_job $arguments]
507517 set c_queue_job_4 [submit_job $arguments]
508518 set c_queue_job_5 [submit_job $arguments]
509519 set c_queue_job_6 [submit_job $arguments]
510-
520+
511521 lappend job_list2 $c_queue_job_1
512522 lappend job_list2 $c_queue_job_2
513523 lappend job_list2 $c_queue_job_3
514524 lappend job_list2 $c_queue_job_4
515525 lappend job_list2 $c_queue_job_5
516526 lappend job_list2 $c_queue_job_6
517-
527+
518528 foreach job $job_list2 {
519529 wait_for_jobstart $job "test" 60 0 1
520530 }
521-
531+
522532 # A.q jobs must suspend all jobs in C.q
523533
524534 # after all A.q jobs are finished all C.q jobs must be in running state
@@ -527,9 +537,9 @@ proc issue_GE_3233 { host } {
527537 }
528538
529539 # wait for system reacting
530- sleep 2
540+ sleep 2
531541
532- # bug is present when one job remains in in S state
542+ # bug is present when one job remains in in S state
533543 foreach job $job_list1 {
534544 get_job_state $job 0 task_info
535545 if {$task_info(0,state) != "r"} {
@@ -544,7 +554,7 @@ proc issue_GE_3233 { host } {
544554 ts_log_fine "Bug GE-3233 not found!"
545555 }
546556 set error_text ""
547-
557+
548558 delete_all_jobs
549559 wait_for_end_of_all_jobs
550560}
0 commit comments