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
36fc3f3d
Commit
36fc3f3d
authored
4 years ago
by
Scott Jackson
Committed by
Albert Gil
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Testsuite - Fix 4.13 avoiding false failures due freemem and cpusload
Refactored test to use run_command/subtests. Bug 9645
parent
0d069b61
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/test4.13
+21
-130
21 additions, 130 deletions
testsuite/expect/test4.13
with
21 additions
and
130 deletions
testsuite/expect/test4.13
+
21
−
130
View file @
36fc3f3d
...
...
@@ -42,7 +42,7 @@ array set node_info {
CPULoad cpusload
CoresPerSocket cores
TmpDisk disk
Features
features
AvailableFeatures
features
FreeMem freemem
Gres gres
NodeAddr nodeaddr
...
...
@@ -67,161 +67,52 @@ array set part_info {
RootOnly root
}
if {![is_super_user]} {
skip "This test can't be run without being a super user of the cluster"
}
proc cleanup { } {
global scontrol test_part
spawn $scontrol delete partitionname=$test_part
expect {
timeout {
log_error "scontrol is not responding"
}
eof {
wait
}
}
}
if {![is_super_user]} {
skip "This test can't be run without being a super user of the cluster"
run_command "$scontrol delete partitionname=$test_part"
}
log_info "=== Testing Node Information ==="
set
first_option 1
set
nodes_dict [get_nodes $test_node]
foreach option [array names node_info] {
if {$first_option == 1} {
set first_option 0
} else {
log_user 0
}
spawn $scontrol show node $test_node
expect {
-re "\\m$option=($re_word_str)\\M" {
set node_sinfo_vals($node_info($option)) $expect_out(1,string)
exp_continue
}
timeout {
fail "scontrol is not responding"
}
eof {
wait
}
}
log_user 1
set node_sinfo_vals($node_info($option)) [dict get $nodes_dict $test_node $option]
}
set first_option 1
foreach option [array names node_sinfo_vals] {
# Gres option (and potentially others) may include "(" and ")" as
# characters, they need to be escaped to be used as part of a regexp
set
regexp
[string map {\( \\( \) \\)} $node_sinfo_vals($option)]
set
val_re
[string map {\( \\( \) \\)} $node_sinfo_vals($option)]
set match 0
spawn $sinfo -n$test_node -O$option:256 -h
expect {
-nocase -re "$regexp" {
set match 1
exp_continue
}
timeout {
fail "sinfo is not responding"
}
eof {
wait
}
}
if {$match != 1} {
log_error "Node information $option output does not match sinfo output. Looking for value: $option = $node_sinfo_vals($option)"
set exit_code 1
set output [string trim [run_command_output -fail "$sinfo -n$test_node -O$option:256 -h"]]
if {$option eq "cpusload" || $option eq "freemem"} {
# CPULoad and FreeMem can change from one system call to another
subtest [regexp {\d+(?:\.\d+)?} $output] "Verify node $option field" "Expected a number but observed $output"
} else {
subtest [regexp -nocase $val_re $output] "Verify node $option field" "Expected $val_re but observed $output"
}
}
#
# Add test partition
#
spawn $scontrol create partitionname=$test_part nodes=$test_node
expect {
timeout {
fail "scontrol is not responding"
}
eof {
wait
}
}
set match 0
spawn $scontrol show partitionname=$test_part
expect {
-re "PartitionName=$test_part" {
set match 1
exp_continue
}
timeout {
fail "scontrol is not responding"
}
eof {
wait
}
}
if {$match != 1} {
run_command -fail "$scontrol create partitionname=$test_part nodes=$test_node"
set output [run_command_output -fail "$scontrol show partitionname=$test_part"]
if {![regexp "PartitionName=$test_part" $output]} {
fail "Test partition was not created"
}
log_info "=== Testing Partition Information ==="
set
first_option 1
set
parts_dict [get_partitions $test_part]
foreach option [array names part_info] {
set part_sinfo_vals($part_info($option)) "UNKNOWN"
set match 0
if {$first_option == 1} {
set first_option 0
} else {
log_user 0
}
spawn $scontrol show partition $test_part
expect {
-re "\\m$option=($re_word_str)\\M" {
set part_sinfo_vals($part_info($option)) \
$expect_out(1,string)
exp_continue
}
timeout {
fail "scontrol is not responding"
}
eof {
wait
}
}
log_user 1
set part_sinfo_vals($part_info($option)) [dict get $parts_dict $test_part $option]
}
set first_option 1
foreach option [array names part_sinfo_vals] {
set match 0
spawn $sinfo -p$test_part -O$option -h
expect {
-nocase -re "$part_sinfo_vals($option)" {
set match 1
exp_continue
}
timeout {
fail "sinfo is not responding"
}
eof {
wait
}
}
if {$match != 1} {
log_error "Partition information $option output does not match sinfo output. Looking for value: $option = $part_sinfo_vals($option)"
set exit_code 1
}
}
if {$exit_code != 0} {
fail "Test failed due to previous errors (\$exit_code = $exit_code)"
set output [string trim [run_command_output -fail "$sinfo -p$test_part -O$option -h"]]
subtest [regexp -nocase $part_sinfo_vals($option) $output] "Verify partition $option field" "Expected $part_sinfo_vals($option) but observed $output"
}
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