Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
89a0293f
Commit
89a0293f
authored
10 years ago
by
Danny Auble
Browse files
Options
Downloads
Patches
Plain Diff
Edits to make test work a little better and create the partition with idle
nodes instead of whatever was first in the system.
parent
7fa871b3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
testsuite/expect/test2.18
+45
-82
45 additions, 82 deletions
testsuite/expect/test2.18
with
45 additions
and
82 deletions
testsuite/expect/test2.18
+
45
−
82
View file @
89a0293f
...
...
@@ -34,7 +34,7 @@ source ./globals
set test_id "2.18"
set user_name ""
set node_name ""
set
host
_name
""
set
cluster
_name ""
set acct_good "test${test_id}_acct_good"
set acct_bad "test${test_id}_acct_bad"
set part_name "test${test_id}_part"
...
...
@@ -73,18 +73,15 @@ proc set_part_val {part_type part_val} {
}
}
proc
delete_part
{ } {
global scontrol sacctmgr part_name acct_good acct_bad exit_code
proc
cleanup
{ } {
global
scancel
scontrol sacctmgr part_name acct_good acct_bad exit_code
set del_part 0
spawn $sacctmgr -i delete account $acct_good $acct_bad
spawn $scancel -p $part_name
expect {
-re "Deleting accounts" {
set del_part 1
exp_continue
}
timeout {
send_user "
\n
FAILURE: s
acctmgr
is not responding\n"
send_user "FAILURE: s
cancel
is not responding\n"
set exit_code 1
}
eof {
...
...
@@ -92,6 +89,8 @@ proc delete_part { } {
}
}
send_user "Any error, except for unresponsiveness, from the previous scancel is expected and should be ignored.\n"
spawn $scontrol delete partition=$part_name
expect {
-re "error" {
...
...
@@ -109,16 +108,30 @@ proc delete_part { } {
}
}
return $del_part
spawn $sacctmgr -i delete account $acct_good $acct_bad
expect {
-re "Deleting accounts" {
set del_part 1
exp_continue
}
timeout {
send_user "\nFAILURE: sacctmgr is not responding\n"
set exit_code 1
}
eof {
wait
}
}
return $del_part
}
proc create_acct { acct } {
global sacctmgr exit_code user_name
global sacctmgr exit_code user_name
cluster_name
set create_acct 0
spawn $sacctmgr -i create account $acct
spawn $sacctmgr -i create account $acct
cluster=$cluster_name
expect {
-re "Adding Account" {
set create_acct 1
...
...
@@ -133,7 +146,7 @@ proc create_acct { acct } {
}
}
spawn $sacctmgr -i create user $user_name account=$acct
spawn $sacctmgr -i create user $user_name account=$acct
cluster=$cluster_name
expect {
timeout {
send_user "\nFAILURE: sacctmgr is not responding\n"
...
...
@@ -154,19 +167,14 @@ proc create_acct { acct } {
proc test_part { acct part acct_con } {
global srun
host_name
exit_code
global srun exit_code
set sub_job 0
spawn $srun -I -A $acct -p $part
hostnam
e
spawn $srun -I -A $acct -p $part
tru
e
expect {
-re "$host_name" {
set sub_job 1
exp_continue
}
-re "error" {
set sub_job 2
if { $acct_con == 1 && $sub_job == 2} {
if { $acct_con == 1 } {
send_user "\nThis error is expected\n"
} else {
send_user "\nFAILURE: This error should not have occured\n"
...
...
@@ -187,7 +195,7 @@ proc test_part { acct part acct_con } {
}
# Remove any vestigial accounts or partitions
delete_part
cleanup
spawn $bin_id -un
expect {
...
...
@@ -204,56 +212,24 @@ expect {
}
}
s
pawn hostname
expect {
s
et node_name [ get_idle_node_in_part $partition ]
set cluster_name [ get_cluster_name ]
-re "($alpha_numeric_under)" {
set host_name $expect_out(1,string)
exp_continue
}
timeout {
send_user "\nFAILURE: hostname is not responding\n"
set exit_code 1
}
eof {
wait
}
}
# NOTE: acct_good should always work and
# acct_bad should always cause an error
#
# Create good account
#
create_acct $acct_good
spawn $scontrol show node
expect {
-re "NodeName=($alpha_numeric_under)" {
set node_name $expect_out(1,string)
exp_continue
}
timeout {
send_user "\nFAILURE: scontrol is not responding\n"
set exit_code 1
}
eof {
wait
}
}
#
# Create bad account
#
create_acct $acct_bad
# Create partition
spawn $scontrol create partition=$part_name
expect {
-re "error" {
send_user "\nFAILURE: partition was not created\n"
set exit_code 1
}
timeout {
send_user "\nFAILURE: scontrol is not reponding\n"
set exit_code 1
}
eof {
wait
}
}
# Add nodes to partition
spawn $scontrol update partition=$part_name nodes=$node_name
spawn $scontrol create partition=$part_name nodes=$node_name
expect {
-re "error" {
send_user "\nFAILURE: partition was not created\n"
...
...
@@ -268,19 +244,6 @@ expect {
}
}
# NOTE: acct_good should always work and
# acct_bad should always cause an error
#
# Create good account
#
create_acct $acct_good
#
# Create bad account
#
create_acct $acct_bad
#
# Set Allow Account to good values
#
...
...
@@ -325,9 +288,9 @@ test_part $acct_good $part_name 0
test_part $acct_bad $part_name 1
sleep
2
sleep
5
# Delete partition and accounts
if {[
delete_part
] != 1} {
if {[
cleanup
] != 1} {
send_user "\nFAILURE: Account was not deleted\n"
set exit_code 1
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment