diff --git a/testsuite/expect/Makefile.am b/testsuite/expect/Makefile.am index 550c81fe8d1dcf498127c40c109faea1e3f7655d..21b7d9f9094183bd6d8d45b3a70956c11593ae2d 100644 --- a/testsuite/expect/Makefile.am +++ b/testsuite/expect/Makefile.am @@ -139,6 +139,7 @@ EXTRA_DIST = \ test2.17 \ test2.18 \ test2.19 \ + test2.20 \ test3.1 \ test3.2 \ test3.3 \ diff --git a/testsuite/expect/Makefile.in b/testsuite/expect/Makefile.in index a4540320244eb879e3723f4e8cdccc5e3dd4599b..42ebd70290709e470a7e2fbc7146bb4a5c33968f 100644 --- a/testsuite/expect/Makefile.in +++ b/testsuite/expect/Makefile.in @@ -519,6 +519,7 @@ EXTRA_DIST = \ test2.17 \ test2.18 \ test2.19 \ + test2.20 \ test3.1 \ test3.2 \ test3.3 \ diff --git a/testsuite/expect/README b/testsuite/expect/README index a46fea9357727a1fef94f2513c51eaef86eb92fb..9503bb29b2cec0c7f4a64ba1f6a852f630e6a841 100644 --- a/testsuite/expect/README +++ b/testsuite/expect/README @@ -235,6 +235,7 @@ test2.16 Validate scontrol displays and updates Allow/Deny accounts. test2.17 Validate scontrol displays and updates Allow/Deny Qos. test2.18 Validate that Allow/Deny accounts are enforced. test2.19 Validate that Allow/Deny Qos are enforced. +test2.20 Validate scontrol show hostnames. test3.# Testing of scontrol options (best run as SlurmUser or root). diff --git a/testsuite/expect/test2.20 b/testsuite/expect/test2.20 new file mode 100755 index 0000000000000000000000000000000000000000..e2d623470885b15eac8083c78ae3e0f6b610e94c --- /dev/null +++ b/testsuite/expect/test2.20 @@ -0,0 +1,111 @@ +#!/usr/bin/expect +############################################################################ +# Purpose: Test of SLURM functionality +# Validate scontrol show hostnames. +# +# 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) 2013 SchedMD LLC +# Written by Morris Jette +# +# This file is part of SLURM, a resource management program. +# For details, see <http://slurm.schedmd.com/>. +# 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 "2.20" +set exit_code 0 + +print_header $test_id + +# +# test single bracket hostnames +# +set matches 0 +spawn $scontrol show hostnames rack\[0-3\] +expect { + -re "rack0" { + incr matches + exp_continue + } + -re "rack1" { + incr matches + exp_continue + } + -re "rack2" { + incr matches + exp_continue + } + -re "rack3" { + incr matches + exp_continue + } + timeout { + send_user "\nFAILURE: scontrol not responding\n" + set exit_code 1 + } + eof { + wait + } +} +if {$matches != 4} { + send_user "\nFAILURE: show hostnames failure ($matches != 4)\n" + set exit_code 1 +} + +# +# test double bracket hostnames +# +set matches 0 +spawn $scontrol show hostnames rack\[0-1\]_blade\[0-1\] +expect { + -re "rack0_blade0" { + incr matches + exp_continue + } + -re "rack0_blade1" { + incr matches + exp_continue + } + -re "rack1_blade0" { + incr matches + exp_continue + } + -re "rack1_blade1" { + incr matches + exp_continue + } + timeout { + send_user "\nFAILURE: scontrol not responding\n" + set exit_code 1 + } + eof { + wait + } +} +if {$matches != 4} { + send_user "\nFAILURE: show hostnames failure ($matches != 4)\n" + set exit_code 1 +} + +if {$exit_code == 0} { + send_user "\nSUCCESS\n" +} +exit $exit_code