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
d306f0b4
Commit
d306f0b4
authored
16 years ago
by
Joseph P. Donaghy
Browse files
Options
Downloads
Patches
Plain Diff
Add debug code and test for usage option.
parent
64ca3ead
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
testsuite/expect/README
+1
-1
1 addition, 1 deletion
testsuite/expect/README
testsuite/expect/test23.1
+139
-90
139 additions, 90 deletions
testsuite/expect/test23.1
with
140 additions
and
91 deletions
testsuite/expect/README
+
1
−
1
View file @
d306f0b4
...
...
@@ -532,6 +532,6 @@ test22.1 sreport cluster utilization report
test23.# Testing of sstat commands and options.
=================================================
test23.1 sstat -e, h, and V options
test23.1 sstat -e, h,
usage
and V options
test23.2 sstat --helpformat
test23.3 sstat -a, n, o, p, P, v options
This diff is collapsed.
Click to expand it.
testsuite/expect/test23.1
+
139
−
90
View file @
d306f0b4
#!/usr/bin/expect
############################################################################
# Purpose: Test of SLURM functionality
# Test sstat h, e, and V options.
# Test sstat h, e,
usage
and V options.
#
# Output: "TEST: #.#" followed by "SUCCESS" if test was successful, OR
# "FAILURE: ..." otherwise with an explanation of the failure, OR
...
...
@@ -52,109 +52,164 @@ print_header $test_id
proc sstat_job { soption } {
global sstat
set exit_code 0
set matches 0
set not_support 0
set debug 0
set exit_code 0
set matches 0
set not_support 0
send_user "sstat -$soption \n"
if { $soption == "e" || $soption == "-helpformat" } {
if { $soption == "h" || $soption == "-help" } {
spawn $sstat -$soption
expect {
-re "sstat...OPTION" {
incr matches
exp_continue
spawn $sstat -$soption
expect {
-re "AveCPU *AvePages *AveRSS *AveVMSize" {
if {$debug} {send_user "\nmatch1\n"}
incr matches
exp_continue
}
-re "JobID *MaxPages *MaxPagesNode *MaxPagesTask" {
if {$debug} {send_user "\nmatch2\n"}
incr matches
exp_continue
}
-re "MaxRSS *MaxRSSNode *MaxRSSTask *MaxVMSize" {
if {$debug} {send_user "\nmatch3\n"}
incr matches
exp_continue
}
-re "MaxVMSizeNode *MaxVMSizeTask *MinCPU *MinCPUNode" {
if {$debug} {send_user "\nmatch4\n"}
incr matches
exp_continue
}
-re "MinCPUTask *NTasks *SystemCPU *TotalCPU" {
if {$debug} {send_user "\nmatch5\n"}
incr matches
exp_continue
}
timeout {
send_user "\nFAILURE: sstat not responding\n"
set exit_code 1
}
eof {
wait
}
}
-re "Valid..OPTION" {
incr matches
exp_continue
}
-re "-e, --helpformat" {
incr matches
exp_continue
}
timeout {
send_user "\nFAILURE: sstat not responding\n"
if {$matches != 5} {
send_user "\nFAILURE: sstat -$soption failed ($matches)\n"
set exit_code 1
}
eof {
wait
return $matches
}
}
if {$matches != 3} {
send_user "\nFAILURE: sstat -$soption failed ($matches)\n"
set exit_code 1
}
return $matches
}
if { $soption == "h" || $soption == "-help" } {
if { $soption == "V" || $soption == "-version" } {
spawn $sstat -$soption
expect {
-re "slurm 1.4." {
incr matches
exp_continue
spawn $sstat -$soption
expect {
-re "sstat...OPTION" {
if {$debug} {send_user "\nmatch6\n"}
incr matches
exp_continue
}
-re "Valid..OPTION" {
if {$debug} {send_user "\nmatch7\n"}
incr matches
exp_continue
}
-re "-e, --helpformat" {
if {$debug} {send_user "\nmatch8\n"}
incr matches
exp_continue
}
timeout {
send_user "\nFAILURE: sstat not responding\n"
set exit_code 1
}
eof {
wait
}
}
timeout {
send_user "\nFAILURE: sstat not responding\n"
if {$matches != 3} {
send_user "\nFAILURE: sstat -$soption failed ($matches)\n"
set exit_code 1
}
eof {
wait
return $matches
}
}
if {$matches != 1} {
send_user "\nFAILURE: sstat -$soption failed ($matches)\n"
set exit_code 1
}
return $matches
}
if { $soption == "-usage" } {
if { $soption == "e" || $soption == "-helpformat" } {
spawn $sstat -$soption
expect {
-re "AveCPU *AvePages *AveRSS *AveVMSize" {
incr matches
exp_continue
}
-re "JobID *MaxPages *MaxPagesNode *MaxPagesTask" {
incr matches
exp_continue
spawn $sstat -$soption
expect {
-re "Usage: sstat .options. -j .job..stepid." {
if {$debug} {send_user "\nmatch9\n"}
incr matches
exp_continue
}
-re "Use --help for help" {
if {$debug} {send_user "\nmatch10\n"}
incr matches
exp_continue
}
timeout {
send_user "\nFAILURE: sstat not responding\n"
set exit_code 1
}
eof {
wait
}
}
-re "MaxRSS *MaxRSSNode *MaxRSSTask *MaxVMSize" {
incr matches
exp_continue
if {$matches != 2} {
send_user "\nFAILURE: sstat -$soption failed ($matches)\n"
set exit_code 1
}
-re "MaxVMSizeNode *MaxVMSizeTask *MinCPU *MinCPUNode" {
incr matches
exp_continue
return $matches
}
-re "MinCPUTask *NTasks *SystemCPU *TotalCPU" {
incr matches
exp_continue
if { $soption == "V" || $soption == "-version" } {
spawn $sstat -$soption
expect {
-re "slurm 1.4." {
if {$debug} {send_user "\nmatch11\n"}
incr matches
exp_continue
}
timeout {
send_user "\nFAILURE: sstat not responding\n"
set exit_code 1
}
eof {
wait
}
}
timeout {
send_user "\nFAILURE: sstat not responding\n"
if {$matches != 1} {
send_user "\nFAILURE: sstat -$soption failed ($matches)\n"
set exit_code 1
}
eof {
wait
return $matches
}
}
################################################################
set matches [sstat_job e ]
if {$matches != 5} {
send_user "\nFAILURE: sstat -
$soption
failed ($matches)\n"
send_user "\nFAILURE: sstat -
e
failed ($matches)\n"
set exit_code 1
} else {
send_user "\nsstat -e test GOOD!\n"
}
return $matches
}
set matches [sstat_job -helpformat ]
if {$matches != 5} {
send_user "\nFAILURE: sstat --helpformat failed ($matches)\n"
set exit_code 1
} else {
send_user "\nsstat --helpformat test GOOD!\n"
}
################################################################
set matches [sstat_job h ]
if {$matches != 3} {
...
...
@@ -172,6 +227,14 @@ if {$matches != 3} {
send_user "\nsstat --help test GOOD!\n"
}
set matches [sstat_job -usage ]
if {$matches != 2} {
send_user "\nFAILURE: sstat --usage failed ($matches)\n"
set exit_code 1
} else {
send_user "\nsstat --usage test GOOD!\n"
}
set matches [sstat_job V ]
if {$matches != 1} {
send_user "\nFAILURE: sstat -V failed ($matches)\n"
...
...
@@ -188,21 +251,7 @@ if {$matches != 1} {
send_user "\nsstat --version test GOOD!\n"
}
set matches [sstat_job e ]
if {$matches != 5} {
send_user "\nFAILURE: sstat -e failed ($matches)\n"
set exit_code 1
} else {
send_user "\nsstat -e test GOOD!\n"
}
set matches [sstat_job -helpformat ]
if {$matches != 5} {
send_user "\nFAILURE: sstat --helpformat failed ($matches)\n"
set exit_code 1
} else {
send_user "\nsstat --helpformat test GOOD!\n"
}
if {$exit_code == 0} {
send_user "\nSUCCESS\n"
...
...
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