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
0cda6daf
Commit
0cda6daf
authored
9 years ago
by
Morris Jette
Browse files
Options
Downloads
Patches
Plain Diff
Harden test for node names without numeric suffix
parent
af7a6fd3
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/globals
+7
-1
7 additions, 1 deletion
testsuite/expect/globals
testsuite/expect/test1.83
+5
-0
5 additions, 0 deletions
testsuite/expect/test1.83
with
12 additions
and
1 deletion
testsuite/expect/globals
+
7
−
1
View file @
0cda6daf
...
@@ -2414,13 +2414,19 @@ proc make_bash_script { script_name script_contents } {
...
@@ -2414,13 +2414,19 @@ proc make_bash_script { script_name script_contents } {
#
#
# Purpose: Given a hostname, return it's numeric suffix
# Purpose: Given a hostname, return it's numeric suffix
#
#
# Returns: numerical suffix for input 'hostname'
# Returns: numerical suffix for input 'hostname'
or -1 if not a number
#
#
# Input: hostname -- hostname for which to return suffix
# Input: hostname -- hostname for which to return suffix
#
#
################################################################
################################################################
proc get_suffix { hostname } {
proc get_suffix { hostname } {
set host_len [string length $hostname]
set host_len [string length $hostname]
set host_inx [expr $host_len-1]
set host_char [string index $hostname $host_inx]
if {[string compare $host_char "0"] < 0 || [string compare $host_char "9"] > 0} {
return -1
}
for {set host_inx [expr $host_len-1]} {$host_inx >= 0} {incr host_inx -1} {
for {set host_inx [expr $host_len-1]} {$host_inx >= 0} {incr host_inx -1} {
set host_char [string index $hostname $host_inx]
set host_char [string index $hostname $host_inx]
if {[string compare $host_char "0"] < 0} { break }
if {[string compare $host_char "0"] < 0} { break }
...
...
This diff is collapsed.
Click to expand it.
testsuite/expect/test1.83
+
5
−
0
View file @
0cda6daf
...
@@ -143,6 +143,11 @@ set host_0_num [get_suffix $host_0_name]
...
@@ -143,6 +143,11 @@ set host_0_num [get_suffix $host_0_name]
set host_1_num [get_suffix $host_1_name]
set host_1_num [get_suffix $host_1_name]
set host_2_num [get_suffix $host_2_name]
set host_2_num [get_suffix $host_2_name]
if {$host_0_num == -1 || $host_1_num == -1 || $host_2_num == -1} {
send_user "\nWARNING: node names lack numeric suffix\n"
exit $exit_code
}
if {$host_1_num != [expr $host_0_num + 1]} {
if {$host_1_num != [expr $host_0_num + 1]} {
send_user "\nFAILURE: node sequence number not contiguous\n"
send_user "\nFAILURE: node sequence number not contiguous\n"
set exit_code 1
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