Skip to content
Snippets Groups Projects
Commit 2a241056 authored by Morris Jette's avatar Morris Jette
Browse files

Merge branch 'master' of github.com:schedmd/slurm

parents 21276086 e64fa99f
No related branches found
No related tags found
No related merge requests found
...@@ -136,7 +136,8 @@ expect { ...@@ -136,7 +136,8 @@ expect {
if {[test_using_slurmdbd]} { if {[test_using_slurmdbd]} {
# Add test Account # Add test Account
set acct_added 0 set acct_added 0
spawn $sacctmgr add -i account $test_acct set cluster [get_cluster_name]
spawn $sacctmgr add -i account $test_acct cluster=$cluster
expect { expect {
-re "Adding Account" { -re "Adding Account" {
set acct_added 1 set acct_added 1
......
...@@ -52,17 +52,35 @@ set acct_req(cluster) $cluster ...@@ -52,17 +52,35 @@ set acct_req(cluster) $cluster
set user_req(account) $account set user_req(account) $account
set user_req(cluster) $cluster set user_req(cluster) $cluster
exec $bin_rm -f $sql_query $sql_query_rem
# DON'T MESS WITH THIS UNLESS YOU REALLY UNDERSTAND WHAT YOU ARE DOING!!!!!
# THIS COULD SERIOUSLY MESS UP YOUR DATABASE IF YOU ALTER THIS INCORRECTLY
# JUST A FRIENDLY REMINDER ;)
# Insert a job that has no end time and is still in running state
set file [open $sql_query "w"]
puts $file "insert into job_table (jobid, associd, wckey, wckeyid, uid, gid, `partition`, blockid, cluster, account, eligible, submit, start, end, suspended, name, track_steps, state, comp_code, priority, req_cpus, tres_alloc, nodelist, kill_requid, qos, deleted) values"
puts $file "('65536', '6', 'test21-36wckey', '1', '1002', '1002', 'debug', '', '$cluster', '$account', 1199170800, 1199170800, 1199170800, 0, '0', 'test21.32_job1', '0', '1', '0', '2', 2, '1=2', 'test21.36_node', '0', '0', '0')"
puts $file "on duplicate key update id=LAST_INSERT_ID(id), eligible=VALUES(eligible), submit=VALUES(submit), start=VALUES(start), end=VALUES(end), associd=VALUES(associd), tres_alloc=VALUES(tres_alloc), wckey=VALUES(wckey), wckeyid=VALUES(wckeyid);"
close $file
# Make SQL file to remove the inserted job
set file [open $sql_query_rem "w"]
puts $file [format "%s%s%s" "truncate table \"" $cluster "_job_table\";"]
close $file
# Remove pre-existing items # Remove pre-existing items
proc cleanup { } { proc cleanup { } {
global cluster account user bin_rm sql_query sql_query_rem global cluster account user sql_query_rem
remove_cluster "$cluster" archive_load $sql_query_rem
remove_acct "" $account
remove_user "" "" $user remove_user "" "" $user
exec $bin_rm -f $sql_query $sql_query_rem remove_acct "" $account
remove_cluster "$cluster"
} }
proc endit { } { proc endit { } {
global exit_code global exit_code bin_rm sql_query sql_query_rem
cleanup cleanup
if {$exit_code == 0} { if {$exit_code == 0} {
...@@ -71,6 +89,8 @@ proc endit { } { ...@@ -71,6 +89,8 @@ proc endit { } {
send_user "\nFAILURE\n" send_user "\nFAILURE\n"
} }
exec $bin_rm -f $sql_query $sql_query_rem
exit $exit_code exit $exit_code
} }
...@@ -85,22 +105,6 @@ if {[test_using_slurmdbd] == 0} { ...@@ -85,22 +105,6 @@ if {[test_using_slurmdbd] == 0} {
# Remove pre-existing items # Remove pre-existing items
cleanup cleanup
# DON'T MESS WITH THIS UNLESS YOU REALLY UNDERSTAND WHAT YOU ARE DOING!!!!!
# THIS COULD SERIOUSLY MESS UP YOUR DATABASE IF YOU ALTER THIS INCORRECTLY
# JUST A FRIENDLY REMINDER ;)
# Insert a job that has no end time and is still in running state
set file [open $sql_query "w"]
puts $file "insert into job_table (jobid, associd, wckey, wckeyid, uid, gid, `partition`, blockid, cluster, account, eligible, submit, start, end, suspended, name, track_steps, state, comp_code, priority, req_cpus, tres_alloc, nodelist, kill_requid, qos, deleted) values"
puts $file "('65536', '6', 'test21-36wckey', '1', '1002', '1002', 'debug', '', '$cluster', '$account', 1199170800, 1199170800, 1199170800, 0, '0', 'test21.32_job1', '0', '1', '0', '2', 2, '1=2', 'test21.36_node', '0', '0', '0')"
puts $file "on duplicate key update id=LAST_INSERT_ID(id), eligible=VALUES(eligible), submit=VALUES(submit), start=VALUES(start), end=VALUES(end), associd=VALUES(associd), tres_alloc=VALUES(tres_alloc), wckey=VALUES(wckey), wckeyid=VALUES(wckeyid);"
close $file
# Make SQL file to remove the inserted job
set file [open $sql_query_rem "w"]
puts $file [format "%s%s%s" "truncate table \"" $cluster "_job_table\";"]
close $file
# Add Test Cluster # Add Test Cluster
if {[add_cluster $cluster [array get clus_req]]} { if {[add_cluster $cluster [array get clus_req]]} {
endit endit
......
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