@@ -74,7 +74,7 @@ lappend check_functions "exclusive_job_consumables"
7474proc exclusive_host_usage_setup {} {
7575 global ts_config CHECK_FIRST_FOREIGN_SYSTEM_USER
7676 global exclusive_hosts
77- global exclusive_host_usage_complex_backup
77+ global exclusive_host_usage_complex_backup exclusive_host_usage_host_backup
7878
7979 if {$ts_config(source_dir) == "none"} {
8080 ts_log_config "source directory is set to \"none\" - cannot run test"
@@ -92,9 +92,19 @@ proc exclusive_host_usage_setup {} {
9292 set_complex tmp_complex
9393
9494 # set host complex attributes
95- set host_config(complex_values) "excl=true,jexcl=true"
96- set_exechost host_config [lindex $exclusive_hosts 0]
97- set_exechost host_config [lindex $exclusive_hosts 1]
95+ set hosts [concat [lindex $exclusive_hosts 0] [lindex $exclusive_hosts 1]]
96+ foreach host $hosts {
97+ # backup existing complex values
98+ get_exechost eh_backup $host
99+ set exclusive_host_usage_host_backup($host) $eh_backup(complex_values)
100+
101+ # set new ones
102+ add_or_replace_array_param host_config exclusive_host_usage_host_backup "complex_values" "excl" "true"
103+ add_or_replace_array_param host_config host_config "complex_values" "jexcl" "true"
104+ set_exechost host_config $host
105+ }
106+ # beginning with 9.1.0 we need to increase slots on host level
107+ setup_host_slots_for_binding $hosts
98108
99109 # add pes
100110 set pe(slots) "100"
@@ -128,7 +138,7 @@ proc exclusive_host_usage_setup {} {
128138
129139proc exclusive_host_usage_cleanup {} {
130140 global ts_config
131- global exclusive_host_usage_complex_backup
141+ global exclusive_host_usage_complex_backup exclusive_host_usage_host_backup
132142 global exclusive_hosts
133143
134144 delete_all_jobs
@@ -147,21 +157,16 @@ proc exclusive_host_usage_cleanup {} {
147157 del_pe "round_robin"
148158 del_pe "fill_up"
149159
150- # remove host complex attributes
151- set host_config(complex_values) "NONE"
152- set_exechost host_config [lindex $exclusive_hosts 0]
153- set_exechost host_config [lindex $exclusive_hosts 1]
160+ # restore exec hosts
161+ cleanup_host_slots_for_binding
162+ host_restore_complex_values exclusive_host_usage_host_backup
154163
155164 # remove exclusive complex
156165 reset_complex exclusive_host_usage_complex_backup
157166 unset exclusive_host_usage_complex_backup
158167
159168 # unset our test's global variables
160- foreach var "exclusive_hosts" {
161- if {[info exists $var]} {
162- unset $var
163- }
164- }
169+ unset -nocomplain exclusive_hosts exclusive_host_usage_complex_backup exclusive_host_usage_host_backup
165170}
166171
167172proc do_exclusive_usage_test { first_is_exclusive {pe_name ""} {rqs_test 0} } {
0 commit comments