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

Minor patches to test suite

parent 3c55e946
No related branches found
No related tags found
No related merge requests found
...@@ -36,6 +36,7 @@ source ./globals ...@@ -36,6 +36,7 @@ source ./globals
set test_id "1.59" set test_id "1.59"
set exit_code 0 set exit_code 0
set file_in "test$test_id.input"
set num_nodes 3 set num_nodes 3
set node_count 0 set node_count 0
set task_count 0 set task_count 0
...@@ -53,7 +54,7 @@ if {[string compare [switch_type] "elan"] == 0} { ...@@ -53,7 +54,7 @@ if {[string compare [switch_type] "elan"] == 0} {
send_user "\nWARNING: This test incompatible with Elan switch\n" send_user "\nWARNING: This test incompatible with Elan switch\n"
exit $exit_code exit $exit_code
} }
#find out if we have enough nodes to test functionality # find out if we have enough nodes to test functionality
set partition [default_partition] set partition [default_partition]
spawn $scontrol show partition $partition spawn $scontrol show partition $partition
expect { expect {
...@@ -84,8 +85,16 @@ set node2 0 ...@@ -84,8 +85,16 @@ set node2 0
set node3 0 set node3 0
set node4 0 set node4 0
#
# Build input script file
#
make_bash_script $file_in "
export PS1=\"$prompt\"
$bin_bash --norc
"
set timeout $max_job_delay set timeout $max_job_delay
spawn $salloc -N$num_nodes -v bash set salloc_pid [spawn $salloc -N$num_nodes -v -t1 ./$file_in]
expect { expect {
-re "salloc: Granted job allocation ($number)" { -re "salloc: Granted job allocation ($number)" {
set job_id $expect_out(1,string) set job_id $expect_out(1,string)
...@@ -96,13 +105,14 @@ expect { ...@@ -96,13 +105,14 @@ expect {
} }
timeout { timeout {
send_user "\nFAILURE: srun not responding\n" send_user "\nFAILURE: srun not responding\n"
kill_srun slow_kill $salloc_pid
set exit_code 1 set exit_code 1
} }
eof { eof {
wait wait
} }
} }
exec $bin_rm -f $file_in
if {$job_id == 0} { if {$job_id == 0} {
send_user "\nFAILURE: salloc failure\n" send_user "\nFAILURE: salloc failure\n"
exit 1 exit 1
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#include "src/sshare/sshare.h" #include "src/sshare/sshare.h"
/* set up some fake system */ /* set up some fake system */
void *acct_db_conn = NULL;
uint32_t cluster_cpus = 50; uint32_t cluster_cpus = 50;
int long_flag = 1; int long_flag = 1;
int exit_code = 0; int exit_code = 0;
......
...@@ -213,9 +213,10 @@ proc sinfo_test_2 { node proc_cnt total_procs } { ...@@ -213,9 +213,10 @@ proc sinfo_test_2 { node proc_cnt total_procs } {
# allocate a set of nodes (node_cnt) and the quit right after # allocate a set of nodes (node_cnt) and the quit right after
proc allocate_and_quit { node proc_cnt total_procs } { proc allocate_and_quit { node proc_cnt total_procs } {
global salloc scontrol sinfo number alpha_numeric_under global bin_bash salloc scontrol sinfo number alpha_numeric_under
global prompt select_type procs_per_node global prompt select_type procs_per_node test_id bin_rm
set file_in "test$test_id.input"
set job_id 0 set job_id 0
set num_alloc 0 set num_alloc 0
set block "" set block ""
...@@ -223,7 +224,12 @@ proc allocate_and_quit { node proc_cnt total_procs } { ...@@ -223,7 +224,12 @@ proc allocate_and_quit { node proc_cnt total_procs } {
set timeout 60 set timeout 60
set idle_cpus [expr $total_procs - $proc_cnt] set idle_cpus [expr $total_procs - $proc_cnt]
set mypid [spawn $salloc -w $node -N 1 -t 5 -n $proc_cnt bash] make_bash_script $file_in "
export PS1=\"$prompt\"
$bin_bash --norc
"
set mypid [spawn $salloc -w $node -N 1 -t 5 -n $proc_cnt ./$file_in]
expect { expect {
-re "Granted job allocation ($number)" { -re "Granted job allocation ($number)" {
set job_id $expect_out(1,string) set job_id $expect_out(1,string)
...@@ -268,6 +274,7 @@ proc allocate_and_quit { node proc_cnt total_procs } { ...@@ -268,6 +274,7 @@ proc allocate_and_quit { node proc_cnt total_procs } {
wait wait
} }
} }
exec $bin_rm -f $file_in
return $rc return $rc
} }
......
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