Skip to content
Snippets Groups Projects
Commit 2209288e authored by Danny Auble's avatar Danny Auble
Browse files

Additional tests for reservations added from Eric Lin (Group Bull)

parent 26c74966
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,7 @@ set test_id "3.11"
set file_in "test$test_id.input"
set exit_code 0
set res_name ""
set res_name_save ""
set user_name ""
set def_partition ""
set def_node ""
......@@ -75,15 +76,7 @@ proc create_res { res_params failure_expected } {
set ret_code 1
exp_continue
}
-re "Error" {
if {!$failure_expected} {
send_user "\nFAILURE: problem creating "
send_user "reservation with args: $res_params\n"
}
set ret_code 1
exp_continue
}
-re "error" {
-nocase "Error" {
if {!$failure_expected} {
send_user "\nFAILURE: problem creating "
send_user "reservation with args: $res_params\n"
......@@ -330,7 +323,7 @@ foreach test $goodtests {
}
}
spawn $scontrol show res
#
# TEST 2
# Create a reservation and update it in various ways
......@@ -517,6 +510,92 @@ if {$user_name != "root"} {
}
}
#
# TEST 5
# Test node reservation conflict
#
# Make the reservation
set ret_code [create_res "StartTime=now+60minutes Duration=60 Nodes=ALL user=$user_name" 0]
if {$ret_code != 0} {
send_user "\nFAILURE: Unable to create a valid reservation\n"
exit $ret_code
}
set res_name_save $res_name
# Test for node reservation conflict
set ret_code [create_res "StartTime=now+60minutes Duration=60 NodeCnt=1 user=$user_name" 1]
if {$ret_code == 0} {
send_user "\nFAILURE: Reservation $test did not fail but should have\n"
delete_res $res_name
exit 1
} else {
send_user "Expected error. You can turn that frown upside-down.\n"
}
# Delete the reservation
set ret_code [delete_res $res_name_save]
if {$ret_code != 0} {
exit $ret_code
}
#
# TEST 6
# Test time reservation conflict
#
# Make the reservation
set ret_code [create_res "StartTime=now+60minutes Duration=60 Nodes=ALL user=$user_name" 0]
if {$ret_code != 0} {
send_user "\nFAILURE: Unable to create a valid reservation\n"
exit $ret_code
}
set res_name_save $res_name
# Test for time reservation conflict (front overlap)
set ret_code [create_res "StartTime=now+30minutes Duration=60 Nodes=ALL user=$user_name" 1]
if {$ret_code == 0} {
send_user "\nFAILURE: Reservation $test did not fail but should have\n"
delete_res $res_name
exit 1
} else {
send_user "Expected error. You can turn that frown upside-down.\n"
}
# Delete the reservation
set ret_code [delete_res $res_name_save]
if {$ret_code != 0} {
exit $ret_code
}
# Make the reservation
set ret_code [create_res "StartTime=now+30minutes Duration=60 Nodes=ALL user=$user_name" 0]
if {$ret_code != 0} {
send_user "\nFAILURE: Unable to create a valid reservation\n"
exit $ret_code
}
set res_name_save $res_name
# Test for time reservation conflict (trail overlap)
set ret_code [create_res "StartTime=now+60minutes Duration=60 Nodes=ALL user=$user_name" 1]
if {$ret_code == 0} {
send_user "\nFAILURE: Reservation $test did not fail but should have\n"
delete_res $res_name
exit 1
} else {
send_user "Expected error. You can turn that frown upside-down.\n"
}
# Delete the reservation
set ret_code [delete_res $res_name_save]
if {$ret_code != 0} {
exit $ret_code
}
#
# Remove the temporary job script
exec $bin_rm -f $file_in
......
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