diff --git a/testsuite/expect/Makefile.am b/testsuite/expect/Makefile.am index 99b9a90a3b500567beeac7fa440fec8f90f9b5c5..b13ab1a6bf0f1bac2c3f7190ca982337ed49fa6e 100644 --- a/testsuite/expect/Makefile.am +++ b/testsuite/expect/Makefile.am @@ -219,6 +219,7 @@ EXTRA_DIST = \ test8.7.prog.c \ test8.8 \ test8.9 \ + test8.10 \ test8.20 \ test8.21 \ test8.21.bash \ diff --git a/testsuite/expect/Makefile.in b/testsuite/expect/Makefile.in index 29173554293c83ea396d016430c9847098523055..97f5be46e4dffe01d63de935bafcaf318e0e5151 100644 --- a/testsuite/expect/Makefile.in +++ b/testsuite/expect/Makefile.in @@ -532,6 +532,7 @@ EXTRA_DIST = \ test8.7.prog.c \ test8.8 \ test8.9 \ + test8.10 \ test8.20 \ test8.21 \ test8.21.bash \ diff --git a/testsuite/expect/README b/testsuite/expect/README index af8964ba43cbdd91a25c8b2d36ca6176bd165a56..7fc48fc932237565121b742b8a5eb871ff4bc7c6 100644 --- a/testsuite/expect/README +++ b/testsuite/expect/README @@ -336,6 +336,8 @@ test8.8 Test result of marking smaller blocks in an error state. test8.9 Bluegene/Q only: Test to make sure if a nodeboard goes unavailable while another block is using it for passthrough to make sure the job using the block with passthrough fails. +test8.10 Bluegene/Q only: Test to make sure that the correct number of + nodes and tasks in a job and a step. test8.20 Bluegene/Q only: Test that job step allocations are a valid size and within the job's allocation test8.21 Bluegene/Q only: Test that multple job step allocations are diff --git a/testsuite/expect/test8.10 b/testsuite/expect/test8.10 new file mode 100755 index 0000000000000000000000000000000000000000..e76d7052e8d681bc54eb34c18143f857c8fb2dbb --- /dev/null +++ b/testsuite/expect/test8.10 @@ -0,0 +1,180 @@ +#!/usr/bin/expect +############################################################################ +# Purpose: Test of SLURM functionality +# Bluegene/Q only: Test to make sure that the correct number of +# nodes and tasks in a job and a step. +# +# Output: "TEST: #.#" followed by "SUCCESS" if test was successful, OR +# "FAILURE: ..." otherwise with an explanation of the failure, OR +# anything else indicates a failure mode that must be investigated. +############################################################################ +# Copyright (C) 2011 SchedMD LLC +# Written by Nathan Yee <nyee32@schedmd.com> +# +# This file is part of SLURM, a resource management program. +# For details, see <http://www.schedmd.com/slurmdocs/>. +# Please also read the included file: DISCLAIMER. +# +# SLURM is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) +# any later version. +# +# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License along +# with SLURM; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +############################################################################ +source ./globals + +set test_id "8.10" +set exit_code 0 +set file_in "test$test_id.input" +set job_id 0 + +print_header $test_id + +if {([test_bluegene] == 0) || [string compare [get_bluegene_type] "Q"]} { + send_user "\nWARNING: This test is only compatible with bluegene systems\n" + exit 1 +} + +#submit a step with 512 tasks +spawn $srun -n512 -v $bin_sleep 50 +expect { + -re "jobid ($number)" { + set job_id $expect_out(1,string) + send_user "\nGot job id $job_id\n" + } + timeout { + send_user "\nFAILURE: srun is not responding\n" + exit 1 + } + eof { + wait + } +} + +#wait for job to start +sleep 1 + +#Checks the job steps +set matches 0 +spawn $scontrol show step $job_id +expect { + -re "Nodes=($number)" { + set tmp1 $expect_out(1,string) + if {$tmp1!=32} { + send_user "\nFAILURE: NumNodes is not 32\n" + exit 1 + } else { + incr matches + } + exp_continue + } + -re "Tasks=($number)" { + set tmp2 $expect_out(1,string) + if {$tmp2!=512} { + send_user "\nFAILURE: NumCPUs is not 512\n" + exit 1 + } else { + incr matches + } + exp_continue + } + -re "not found" { + send_user "\nFAILURE: step was not found\n" + exit 1 + } + timeout { + send_user "\nFAILURE: scontrol not responding\n" + exit 1 + } + eof { + wait + } +} + +if {$matches !=0} { + send_user "\nNumber of nodes and tasks are correct\n" +} + +#submit allocation and runs job +set matches 0 +spawn $salloc -n512 $srun $bin_sleep +expect { + -re "Granted job allocation ($number)" { + set job_id $expect_out(1,string) + incr matches + } + timeout { + send_user "\nFAILURE: salloc is not responding\n" + exit 1 + } + eof { + wait + } +} + +if {$matches !=1} { + send_user "\nFAILURE: jobs were not submitted\n" + exit 1 +} + +#Checks job +set matches 0 +spawn $scontrol show job $job_id +expect { + -re "NumNodes=($number)" { + set tmp1 $expect_out(1,string) + if {$tmp1!=32} { + send_user "\nFAILURE: NumNodes is not 32\n" + exit 1 + } else { + incr matches + } + exp_continue + } + -re "NumCPUs=($number)" { + set tmp2 $expect_out(1,string) + if {$tmp2!=512} { + send_user "\nFAILURE: NumCPUs is not 512\n" + exit 1 + } else { + incr matches + } + exp_continue + } + -re "CPUs/Task=($number)" { + set tmp3 $expect_out(1,string) + if {$tmp3!=1} { + send_user "\nFAILURE: CPUs per Task is not 1\n" + exit 1 + } else { + incr matches + } + exp_continue + } + timeout { + send_user "\nFAILURE: scontrol not responding\n" + exit 1 + } + eof { + wait + } +} +if {$matches !=0} { + send_user "\nNumber of nodes and tasks are correct\n" +} + +if {$exit_code == 0} { + send_user "\nSUCCESS\n" +} else { + send_user "\nFAILURE\n" +} + +exit $exit_code