#!/usr/bin/env expect ############################################################################ # Purpose: Test of Slurm functionality # Test for the qalter --man option ############################################################################ # 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 file_in "test$test_id.input" set file_out "test$test_id.output" set exit_code 0 if {[file executable $qalter] == 0} { skip "$qalter does not exist" } if {[file executable $bin_perldoc] == 0} { skip "$bin_perldoc does not exist" } # If perl-doc isn't installed there is sometimes a useless perldoc script # waiting for you telling you it isn't installed. So we need to check for that. log_user 0 spawn $bin_perldoc expect { -re "You need to install the perl-doc" { skip "$bin_perldoc not installed" } eof { wait } } log_user 1 exec $bin_rm -f $file_in $file_out make_bash_script $file_in "$qalter --man >$file_out" exec ./$file_in set matches 0 spawn $bin_cat $file_out expect { -re "alter a job name" { incr matches exp_continue } eof { wait } } if {$matches != 1} { fail "qalter did not return the man pages ($matches != 1)" } if {$exit_code == 0} { exec $bin_rm -f $file_in $file_out } else { fail "Test failed due to previous errors (\$exit_code = $exit_code)" }