Skip to content
Snippets Groups Projects
Commit e6d31f47 authored by Joseph P. Donaghy's avatar Joseph P. Donaghy
Browse files

Inagural check in of sinfo cpu verifications.

parent a13606f1
No related branches found
No related tags found
No related merge requests found
......@@ -127,6 +127,7 @@ EXTRA_DIST = \
test4.9 \
test4.10 \
test4.11 \
test4.12 \
test5.1 \
test5.2 \
test5.3 \
......
......@@ -371,6 +371,7 @@ EXTRA_DIST = \
test4.9 \
test4.10 \
test4.11 \
test4.12 \
test5.1 \
test5.2 \
test5.3 \
......
......@@ -236,6 +236,7 @@ test4.9 Check sinfo formating options (--format option and SINFO_FORMAT
test4.10 Confirm that sinfo reports a proper version number (--version
option).
test4.11 Test down node reason display (--list-reasons option).
test4.12 Test cpu total and allocation numbers.
test5.# Testing of squeue options.
......
#!/usr/bin/expect
############################################################################
# Purpose: Test of SLURM functionality
# Test of sinfo cpu total and allocated
#
# 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) 2009 Lawrence Livermore National Security.
# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
# Written by Joseph Donaghy <donaghy1@llnl.gov>
# CODE-OCEC-09-009. All rights reserved.
#
# This file is part of SLURM, a resource management program.
# For details, see <https://computing.llnl.gov/linux/slurm/>.
# 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 "4.12"
set file_in "test$test_id.in"
set exit_code 0
set pnumsc 0
set pnumsi 0
set aprocsc 0
set aprocsi 0
print_header $test_id
#
# Submit two jobs to work with
#
make_bash_script $file_in "
srun -N1 hostname
sleep 20
"
#
# Issue scontrol to find processor count
#
set timeout $max_job_delay
set sctmatches 0
spawn $sbatch $file_in
spawn $scontrol show part
expect {
-re " TotalCPUs=($number)" {
set pnumsc $expect_out(1,string)
send_user "\nscontrol reports $pnumsc procs\n"
incr sctmatches
exp_continue
}
timeout {
send_user "\nFAILURE: scontrol not responding\n"
set exit_code 1
}
eof {
wait
}
}
if {$sctmatches != 1} {
send_user "\nFAILURE: Unexpected output $sctmatches\n"
set exit_code 1
}
set scamatches 0
spawn $scontrol show node
expect {
-re "AllocProcs=($number)" {
set aprocsc $expect_out(1,string)
send_user "\nscontrol reports $aprocsc allocated procs\n"
incr scamatches
exp_continue
}
timeout {
send_user "\nFAILURE: scontrol not responding\n"
set exit_code 1
}
eof {
wait
}
}
if {$scamatches != 1} {
send_user "\nFAILURE: Unexpected output $scamatches\n"
set exit_code 1
}
set simatches 0
spawn $sinfo -o %C
expect {
-re "($number).$number.$number.($number)" {
set aprocsi $expect_out(1,string)
set pnumsi $expect_out(1,string)
send_user "\nsinfo reports $aprocsi allocated procs\n"
send_user "\nsinfo reports $pnumsi procs\n"
incr simatches
exp_continue
}
timeout {
send_user "\nFAILURE: scontrol not responding\n"
set exit_code 1
}
eof {
wait
}
}
if {$simatches != 1} {
send_user "\nFAILURE: Unexpected output $simatches\n"
set exit_code 1
}
if {$pnumsc == $pnumsi} {
send_user "\nGOOD: Reported procs are a match at $pnumsc\n"
} else {
send_user "\nFAILURE: PROCS numbers not the same\n"
set exit_code 1
}
if {$aprocsc == $aprocsi} {
send_user "\nGOOD: Allocated Procs are a match at $aprocsc\n"
} else {
send_user "\nFAILURE: Allocated Procs not the same\n"
set exit_code 1
}
if {$exit_code == 0} {
send_user "\nSUCCESS\n"
}
exit $exit_code
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