#!/usr/bin/env expect ############################################################################ # Purpose: Test of Slurm functionality # Validates that the JobAcctGatherFrequency value is enforced ############################################################################ # Copyright (C) 2013 SchedMD LLC # Written by Nathan Yee # # This file is part of Slurm, a resource management program. # For details, see . # 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 freq_val 0 set exit_code 0 if {[test_cray]} { set timeout 60 } if {[get_job_acct_freq] == 0} { skip "This test requires JobAcctGatherFrequency to be set" } if {[check_node_mem] == 0} { skip "This test requires that the nodes have memory" } # # set value of freq_val to JobAcctGatherFrequency # set freq_val [get_job_acct_freq] set sub_match 0 spawn $srun -v --mem=200 --acctg-freq=[expr $freq_val - 1] sleep 5 expect { -re "jobid" { set sub_match 1 exp_continue } timeout { log_error "srun is not responding" set exit_code 1 } eof { wait } } if {$sub_match != 1} { log_error "srun did not submit job" set exit_code 1 } set sub_match 0 spawn $srun -v --mem=200 --acctg-freq=[expr $freq_val + 10] sleep 5 expect { -re "Invalid accounting frequency" { log_debug "This error is expect do not worry" set sub_match 1 exp_continue } timeout { log_error "srun is not responding" set exit_code 1 } eof { wait } } if {$sub_match != 1} { fail "srun did not fail when it should have" } if {$exit_code != 0} { fail "Test failed due to previous errors (\$exit_code = $exit_code)" }