Skip to content
Snippets Groups Projects
Commit 4481f98d authored by Joseph P. Donaghy's avatar Joseph P. Donaghy
Browse files

Added test for version option.

parent 1a4f8c72
No related branches found
No related tags found
No related merge requests found
......@@ -540,3 +540,4 @@ test23.3 sstat -a, n, o, p, P, v options
test24.# Testing of sshare/priority multifactor plugin.
=================================================
test24.1 multifactor plugin algo test
test24.2 sshare h, n, p, P, v, and V options.
#!/usr/bin/expect
############################################################################
# Purpose: Test of SLURM sshare functionality
# sshare h, n, p, P and V options.
# sshare h, n, p, P, v and V options.
#
# Output: "TEST: #.#" followed by "SUCCESS" if test was successful, OR
# "FAILURE: ..." otherwise with an explanation of the failure, OR
......@@ -310,6 +310,48 @@ proc sshare_opt { soption } {
}
if { $soption == "-version" || $soption == "V" } {
spawn $sshare -$soption
expect {
-re "SLURM accounting storage is disabled" {
set not_support 1
exp_continue
}
-re "You are not running a supported priority plugin" {
set not_support 2
exp_continue
}
-re "slurm 1.4.0-pre8" {
if {$debug} {send_user "\nmatch12\n"}
incr matches
exp_continue
}
timeout {
send_user "\nFAILURE: sshare not responding\n"
set exit_code 1
}
eof {
wait
}
}
if {$not_support == 1} {
send_user "\nWARNING: can not test without accounting enabled\n"
exit 0
}
if {$not_support == 2} {
send_user "\nWARNING: can not test without priority/multifactor plugin\n"
exit 0
}
if {$matches != 1} {
send_user "\nFAILURE: sshare -$soption failed ($matches)\n"
set exit_code 1
}
return $matches
}
}
################################################################
......@@ -380,6 +422,19 @@ if {$matches != 3} {
set exit_code 1
}
set matches [sshare_opt V ]
if {$matches != 1} {
send_user "\nFAILURE: sshare -v failed ($matches)\n"
set exit_code 1
}
set matches [sshare_opt -version ]
if {$matches != 1} {
send_user "\nFAILURE: sshare --verbose failed ($matches)\n"
set exit_code 1
}
if {$exit_code == 0} {
send_user "\nSUCCESS\n"
}
......
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