Skip to content
Snippets Groups Projects
Commit 810edc06 authored by Morris Jette's avatar Morris Jette
Browse files

Disable deadline test with default time limit

Disable a job deadline test with no input time limit if the default
partition has a default time limit.
parent 2fad3bcf
No related branches found
No related tags found
No related merge requests found
...@@ -325,6 +325,7 @@ Number of cores per socket. ...@@ -325,6 +325,7 @@ Number of cores per socket.
.TP .TP
\fBdefaulttime\fR \fBdefaulttime\fR
Default time for any job in the format "days\-hours:minutes:seconds". Default time for any job in the format "days\-hours:minutes:seconds".
.TP
\fBdisk\fR \fBdisk\fR
Size of temporary disk space per node in megabytes. Size of temporary disk space per node in megabytes.
.TP .TP
......
...@@ -3765,6 +3765,70 @@ proc get_partition_nodes {partition states} { ...@@ -3765,6 +3765,70 @@ proc get_partition_nodes {partition states} {
return $node_list return $node_list
} }
#####################################################################
#
# Proc: get_partition_default_time_limit
#
# Purpose: Get the default time limit in a given partition
#
# Input: partition - partition to default time limit of
#
# Returns: time limit in seconds, -1 if undefined or error
#
#####################################################################
proc get_partition_default_time_limit {partition} {
global sinfo number
if {[string length $partition] == 0} {
set partition [default_partition]
}
set secs 0
log_user 0
set sinfo_pid [spawn -noecho $sinfo -h -p $partition -O defaulttime -e]
expect {
-re "n/a" {
set secs -1
exp_continue
}
-re "($number)-($number):($number):($number)" {
set days [expr $expect_out(1,string) * 24 * 60 * 60]
set hours [expr $expect_out(2,string) * 60 * 60]
set mins [expr $expect_out(3,string) * 60]
set secs [expr $days + $hours + $mins + $expect_out(4,string)]
exp_continue
}
-re "($number):($number):($number)" {
set hours [expr $expect_out(1,string) * 60 * 60]
set mins [expr $expect_out(2,string) * 60]
set secs [expr $hours + $mins + $expect_out(3,string)]
exp_continue
}
-re "($number):($number)" {
set mins [expr $expect_out(1,string) * 60]
set secs [expr $mins + $expect_out(2,string)]
exp_continue
}
-re "($number)" {
set secs [expr $expect_out(1,string) * 60]
exp_continue
}
timeout {
send_user "\nFAILURE: sinfo not responding\n"
slow_kill $sinfo_pid
set exit_code 1
}
eof {
wait
}
}
log_user 1
return $secs
}
##################################################################### #####################################################################
# #
# Proc: get_node_cores # Proc: get_node_cores
......
...@@ -36,6 +36,13 @@ set job_id 0 ...@@ -36,6 +36,13 @@ set job_id 0
print_header $test_id print_header $test_id
set part_name [default_partition]
set default_time [get_partition_default_time_limit $part_name]
if { $default_time != -1} {
send_user "\nWARNING: This test is not compatible with default partition having a default time limit ($part_name $default_time)\n"
exit $exit_code
}
# #
# Spawn a job with a deadline and no time # Spawn a job with a deadline and no time
# #
......
...@@ -36,6 +36,13 @@ set job_id 0 ...@@ -36,6 +36,13 @@ set job_id 0
print_header $test_id print_header $test_id
set part_name [default_partition]
set default_time [get_partition_default_time_limit $part_name]
if { $default_time != -1} {
send_user "\nWARNING: This test is not compatible with default partition having a default time limit ($part_name $default_time)\n"
exit $exit_code
}
# #
# Spawn a batch job with a deadline and no time # Spawn a batch job with a deadline and no time
# #
......
...@@ -37,6 +37,13 @@ set job_id 0 ...@@ -37,6 +37,13 @@ set job_id 0
print_header $test_id print_header $test_id
set part_name [default_partition]
set default_time [get_partition_default_time_limit $part_name]
if { $default_time != -1} {
send_user "\nWARNING: This test is not compatible with default partition having a default time limit ($part_name $default_time)\n"
exit $exit_code
}
# #
# Build input script file # Build input script file
# #
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment