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

Make testing more rigorous in terms of testing for WCKey values being set

parent fd7b4079
No related branches found
No related tags found
No related merge requests found
......@@ -533,6 +533,36 @@ proc test_assoc_enforced { } {
return $assoc_enforced
}
################################################################
#
# Proc: test_track_wckey
#
# Purpose: Determine if we track workload characterization keys.
# This is based upon the value of TrackWCKey in the slurm.conf.
#
# Returns value of TrackWCKey
#
################################################################
proc test_track_wckey { } {
global scontrol number
log_user 0
set track_wckey 0
spawn $scontrol show config
expect {
-re "TrackWCKey *= ($number)" {
set track_wckey $expect_out(1,string)
exp_continue
}
eof {
wait
}
}
log_user 1
return $track_wckey
}
################################################################
# Proc: test_wiki_sched
#
......
......@@ -46,6 +46,10 @@ if { [test_account_storage] == 0 } {
send_user "\nWARNING: This test can't be run without a usable AccountStorageType\n"
exit 0
}
if { [test_track_wckey] == 0} {
send_user "\nWARNING: This test can't be run without TrackWCKey being set\n"
exit 0
}
if { [string compare [check_accounting_admin_level] "Administrator"] } {
send_user "\nWARNING: This test can't be run without being an Accounting administrator.\nUse sacctmgr mod user \$USER_NAME set admin=admin.\n"
......@@ -133,7 +137,6 @@ expect {
# Spawn a job via salloc using this wckey
#
set job_id 0
set have_wckey 0
set matches 0
set timeout $max_job_delay
spawn $salloc -N1 --account=$test_acct --wckey=$wk
......@@ -145,14 +148,9 @@ expect {
exp_continue
}
-re "WCKey=$wk" {
incr have_wckey
incr matches
exp_continue
}
-re "WCKey=" {
incr have_wckey
exp_continue
}
timeout {
send_user "\nFAILURE: salloc not responding\n"
set exit_code 1
......@@ -161,11 +159,6 @@ expect {
wait
}
}
if {$have_wckey == 0} {
send_user "\nWARNING: TrackWCKey is disabled, can not continue test\n"
exec $sacctmgr -i delete account $test_acct
exit $exit_code
}
spawn $sacct -j $job_id --fields=wckey
expect {
......
......@@ -220,6 +220,7 @@ if { [test_account_storage] == 0 } {
send_user "\nWARNING: This test can't be run without a usable AccountStorageType\n"
exit 0
}
set track_wckey [test_track_wckey]
if { [string compare [check_accounting_admin_level] "Administrator"] } {
send_user "\nWARNING: This test can't be run without being an Accounting administrator.\nUse sacctmgr mod user \$USER_NAME admin=admin.\n"
......@@ -1435,7 +1436,11 @@ expect {
# Same as above, but without DefaultWCKey= or WCKeys=
-re "($usr - $us3:$dac='$nm3':$al='$ala':$fs=$fs3:$gm=$gm3:$gc=$gc3:$gj=$gj3:$gn=$gn3:$gs=$gs3:$gw=$gw3:$mp=$mm3:$mu=$mc3:$mj=$mj3:$mnj=$mn3:$ms=$ms3:$md=$mw3:$qs='$qs2')" {
send_user "\nmatch 5b\n"
incr matches
if {$track_wckey == 0} {
incr matches
} else {
send_user "\nFAILURE: Missing DefaultWCKey or WCKeys\n"
}
exp_continue
}
......@@ -1473,7 +1478,11 @@ expect {
# Same as above but without DefaultWCKey= or WCKeys=
-re "($usr - $us1:$dac='$nm2':$fs=$fs1:$gm=$gm1:$gc=$gc1:$gj=$gj1:$gn=$gn1:$gs=$gs1:$gw=$gw1:$mp=$mm1:$mu=$mc1:$mj=$mj1:$mnj=$mn1:$ms=$ms1:$md=$mw1:$qs='$qs2')" {
send_user "\nmatch 10b\n"
incr matches
if {$track_wckey == 0} {
incr matches
} else {
send_user "\nFAILURE: Missing DefaultWCKey or WCKeys\n"
}
exp_continue
}
......@@ -1486,7 +1495,11 @@ expect {
# Same as above but without DefaultWCKey= or WCKeys=
-re "($usr - $us2:$dac='$nm2':$al='$alo':$fs=$fs2:$gm=$gm2:$gc=$gc2:$gj=$gj2:$gn=$gn2:$gs=$gs2:$gw=$gw2:$mp=$mm2:$mu=$mc2:$mj=$mj2:$mnj=$mn2:$ms=$ms2:$md=$mw2:$qs='$qs2')" {
send_user "\nmatch 11b\n"
incr matches
if {$track_wckey == 0} {
incr matches
} else {
send_user "\nFAILURE: Missing DefaultWCKey or WCKeys\n"
}
exp_continue
}
......
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