#!/usr/bin/env expect ############################################################################ # Purpose: Test hetjob step output file labling and different commands/args ############################################################################ # Copyright (C) 2017 SchedMD LLC. # Written by Morris Jette # CODE-OCEC-09-009. All rights reserved. # # 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 exit_code 0 set file_out test${test_id}.output set het_job_id 0 if {[test_hetjob_step] == 0} { skip "Heterogeneous steps not currently supported" } set nb_nodes [get_node_cnt_in_part] if {$nb_nodes < 2} { skip "Need 2 or more nodes in default partition" } exec $bin_rm -f $file_out set timeout $max_job_delay set srun_pid [spawn $srun -t1 -n1 -l -o $file_out --mpi=none $bin_echo one : -n1 $bin_echo two] expect { timeout { log_error "srun not responding" slow_kill $srun_pid set exit_code 1 } eof { wait } } if {[wait_for_file $file_out] == 0} { set matches 0 spawn $bin_sort $file_out expect { -re "0: one" { incr matches exp_continue } -re "1: two" { incr matches exp_continue } eof { wait } } if {$matches != 2} { fail "srun output file contents invalid" } } else { fail "File not found ($file_out)" } if {$exit_code == 0} { exec $bin_rm -f $file_out } else { fail "Test failed due to previous errors (\$exit_code = $exit_code)" }