From 6cb0a98f363bedb86ff6b388aabd6477516dc6f5 Mon Sep 17 00:00:00 2001 From: Moe Jette <jette1@llnl.gov> Date: Fri, 3 Apr 2009 18:37:03 +0000 Subject: [PATCH] disable sprio test without priority/mulitfactor plugin --- testsuite/expect/globals | 4 ++ testsuite/expect/test25.1 | 88 ++++++++++++++++++++------------------- 2 files changed, 50 insertions(+), 42 deletions(-) diff --git a/testsuite/expect/globals b/testsuite/expect/globals index 9612cfda613..d26e4a64fec 100755 --- a/testsuite/expect/globals +++ b/testsuite/expect/globals @@ -199,6 +199,10 @@ cset super_user_set 0 proc cancel_job { job_id } { global scancel bin_sleep + if {$job_id == 0} { + return 1 + } + send_user "cancelling $job_id\n" exec $scancel -q $job_id exec $bin_sleep 1 diff --git a/testsuite/expect/test25.1 b/testsuite/expect/test25.1 index 8ad3d40fdab..09b21379c09 100755 --- a/testsuite/expect/test25.1 +++ b/testsuite/expect/test25.1 @@ -35,6 +35,7 @@ source ./globals set test_id "25.1" set exit_code 0 +set file_in "test$test_id.input" set timeout 60 print_header $test_id @@ -45,6 +46,15 @@ if { [test_account_storage] == 0 } { send_user "\nWARNING: This test can't be run without a usable AccountStorageType\n" exit 0 } +if { [string compare [priority_type] multifactor] } { + send_user "\nWARNING: This test can't be run without a usable PriorityType\n" + exit 0 +} + +# +# Build input script file +# +make_bash_script $file_in "$bin_sleep 600" ################################################################ # @@ -58,45 +68,31 @@ if { [test_account_storage] == 0 } { proc sub_job {} { - global number sbatch - set file_in test25.1.input - -# -# Build input script file -# -make_bash_script $file_in " -$sbatch sleep 5m -wait - -" - -# -# Spawn jobs -# -set job_id 0 + global exit_code file_in number sbatch test_id + set file_in test${test_id}.input - -spawn $sbatch $file_in -expect { - -re "Submitted batch job ($number)" { - set job_id $expect_out(1,string) - send_user "\nFOUND JobID to be $job_id\n" - exp_continue + set job_id 0 + spawn $sbatch --output=/dev/null --error=/dev/null $file_in + expect { + -re "Submitted batch job ($number)" { + set job_id $expect_out(1,string) + send_user "\nFOUND JobID to be $job_id\n" + exp_continue + } + timeout { + send_user "\nFAILURE: sbatch not responding\n" + set exit_code 1 + } + eof { + wait + } } - timeout { - send_user "\nFAILURE: sbatch not responding\n" + + if {$job_id == 0} { + send_user "\nFAILURE: did not get sbatch job_id\n" set exit_code 1 } - eof { - wait - } -} - -if {$job_id == 0} { - send_user "\nFAILURE: did not get sbatch job_id\n" - exit 1 -} -return $job_id + return $job_id } ################################################################ @@ -625,11 +621,20 @@ set jobid2 [sub_job] set jobid3 [sub_job] set jobid4 [sub_job] set jobid5 [sub_job] - send_user "\nFirst job ID is $jobid1\n" - send_user "\nSecond job ID is $jobid2\n" - send_user "\nThird job ID is $jobid3\n" - send_user "\nFourth job ID is $jobid4\n" - send_user "\nFifth job ID is $jobid5\n" +if {$exit_code != 0} { + [cancel_job $jobid1] + [cancel_job $jobid2] + [cancel_job $jobid3] + [cancel_job $jobid4] + [cancel_job $jobid5] + exit $exit_code +} +send_user "\nFirst job ID is $jobid1\n" +send_user "\nSecond job ID is $jobid2\n" +send_user "\nThird job ID is $jobid3\n" +send_user "\nFourth job ID is $jobid4\n" +send_user "\nFifth job ID is $jobid5\n" + # # Collect uid # @@ -771,8 +776,7 @@ cancel_job $jobid5 # Exit with code as appropriate # if {$exit_code == 0} { + exec $bin_rm -f $file_in send_user "\nSUCCESS\n" -} else { - send_user "\nFAILURE\n" } exit $exit_code -- GitLab