Skip to content
Snippets Groups Projects
Commit 4bfd67ea authored by Moe Jette's avatar Moe Jette
Browse files

check-in some more tests (before command is fully ready).

parent 08fc8139
No related branches found
No related tags found
No related merge requests found
...@@ -348,6 +348,8 @@ test17.1 Confirm sbatch usage option works (--usage option). ...@@ -348,6 +348,8 @@ test17.1 Confirm sbatch usage option works (--usage option).
test17.2 Confirm sbatch help option works (--help option). test17.2 Confirm sbatch help option works (--help option).
test17.3 Confirm that sbatch reports a proper version number test17.3 Confirm that sbatch reports a proper version number
(--version option). (--version option).
test17.4 Confirm that as sbatch job executes as the appropriate user and
group.
test18.# Testing of slaunch options. test18.# Testing of slaunch options.
......
#!/usr/bin/expect
############################################################################
# Purpose: Test of SLURM functionality
# Confirm that sattach usage option works (--usage option).
#
# 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) 2006 The Regents of the University of California.
# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
# Written by Morris Jette <jette1@llnl.gov>
# UCRL-CODE-217948.
#
# This file is part of SLURM, a resource management program.
# For details, see <http://www.llnl.gov/linux/slurm/>.
#
# 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.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
############################################################################
source ./globals
set test_id "16.1"
set exit_code 0
set matches 0
print_header $test_id
# DISABLE FOR NOW
send_user "\nFAILURE: sattach does not yet exist\n"
exit 0
#
# Report the sattach usage format
#
spawn $sattach --usage
expect {
-re "Usage: .*sattach.*" {
incr matches
exp_continue
}
timeout {
send_user "\nFAILURE: sattach not responding\n"
set exit_code 1
}
eof {
wait
}
}
if {$matches != 1} {
send_user "\nFAILURE: sattach failed to report usage format\n"
set exit_code 1
}
if {$exit_code == 0} {
send_user "\nSUCCESS\n"
}
exit $exit_code
#!/usr/bin/expect
############################################################################
# Purpose: Test of SLURM functionality
# Confirm that sattach help option works (--help option).
#
# 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) 2006 The Regents of the University of California.
# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
# Written by Morris Jette <jette1@llnl.gov>
# UCRL-CODE-217948.
#
# This file is part of SLURM, a resource management program.
# For details, see <http://www.llnl.gov/linux/slurm/>.
#
# 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.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
############################################################################
source ./globals
set test_id "16.2"
set exit_code 0
set matches 0
print_header $test_id
# DISABLE FOR NOW
send_user "\nFAILURE: sattach does not yet exist\n"
exit 0
#
# Report the sattach help message
#
spawn $sattach --help
expect {
-re "Usage:" {
incr matches
exp_continue
}
-re "Help options" {
incr matches
exp_continue
}
timeout {
send_user "\nFAILURE: sattach not responding\n"
set exit_code 1
}
eof {
wait
}
}
if {$matches != 2} {
send_user "\nFAILURE: sattach failed to report help message\n"
set exit_code 1
}
if {$exit_code == 0} {
send_user "\nSUCCESS\n"
}
exit $exit_code
#!/usr/bin/expect
############################################################################
# Purpose: Test of SLURM functionality
# Confirm that sattach reports a proper version number (--version
# option).
#
# 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) 2006 The Regents of the University of California.
# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
# Written by Morris Jette <jette1@llnl.gov>
# UCRL-CODE-217948.
#
# This file is part of SLURM, a resource management program.
# For details, see <http://www.llnl.gov/linux/slurm/>.
#
# 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.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
############################################################################
source ./globals
set test_id "16.3"
set exit_code 0
set version 0
print_header $test_id
# DISABLE FOR NOW
send_user "\nFAILURE: sattach does not yet exist\n"
exit 0
#
# Report the sattach version number
#
spawn $sattach --version
expect {
-re "(slurm ($number)\.($number)\.($number).*\n)" {
incr version
exp_continue
}
timeout {
send_user "\nFAILURE: sattach not responding\n"
set exit_code 1
exp_continue
}
eof {
wait
}
}
if {$version != 1} {
send_user "\nFAILURE: Did not get proper sattach version number\n"
set exit_code 1
}
if {$exit_code == 0} {
send_user "\nSUCCESS\n"
}
exit $exit_code
#!/usr/bin/expect
############################################################################
# Purpose: Test of SLURM functionality
# Confirm that as sbatch job executes as the appropriate user and
# group.
#
# 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) 2006 The Regents of the University of California.
# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
# Written by Morris Jette <jette1@llnl.gov>
# UCRL-CODE-217948.
#
# This file is part of SLURM, a resource management program.
# For details, see <http://www.llnl.gov/linux/slurm/>.
#
# 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.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
############################################################################
source ./globals
set test_id "17.4"
set exit_code 0
set file_in "test$test_id.input"
set file_out "test$test_id.output"
set login_grp_info ""
set job_id 0
set job_grp_info ""
set got_job_grps 0
set got_login_grps 0
print_header $test_id
# DISABLE FOR NOW
send_user "\nFAILURE: sbatch does not yet support --output option\n"
exit 0
#
# Execute 'id' to determine my user and group ID...
#
spawn $bin_id
expect {
-re "(uid=.*\n)" {
set login_grp_info $expect_out(1,string)
set got_login_grps 1
exp_continue
}
eof {
wait
}
}
if {$got_login_grps == 0} {
send_user "\nFAILURE: Unable to get user and group ID info\n"
exit 1
}
#
# Submit a slurm job that will execute 'id'
#
exec $bin_rm -f $file_in $file_out
set file [open $file_in "w"]
puts $file "
$bin_id
"
close $file
exec $bin_chmod 700 $file_in
spawn $sbatch -N1 -t1 --output=$file_out $file_in
expect {
-re "Submitted batch job ($number)" {
set job_id $expect_out(1,string)
exp_continue
}
timeout {
send_user "\nFAILURE: sbatch not responding\n"
set exit_code 1
exp_continue
}
eof {
wait
}
}
#
# Wait for job to complete
#
if {[wait_for_job $job_id "DONE"] != 0} {
send_user "\nFAILURE: waiting for job to complete\n"
set exit_code 1
}
#
# Check for desired output
#
if {[wait_for_file $file_out] == 0} {
spawn $bin_cat $file_out
expect {
-re "(uid=.*\n)" {
set job_grp_info $expect_out(1,string)
set got_job_grps 1
exp_continue
}
eof {
wait
}
}
}
if {$got_job_grps == 0} {
send_user "\nFAILURE: Did not get user info from slurm job\n"
exit 1
}
#
# Confirm the user id and group id in the slurm job matches that
# of the local 'id' execution.
#
if {[string compare $login_grp_info $job_grp_info] != 0} {
send_user "\nFAILURE: Login and sbatch user info mismatch\n"
set exit_code 1
}
if {$exit_code == 0} {
rm -f $file_in $file_out
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