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
70b9655e
Commit
70b9655e
authored
3 years ago
by
Albert Gil
Browse files
Options
Downloads
Patches
Plain Diff
Testsuite - Improve tets3.2 replacing spawn/expect with run_command
Bug 10810 Signed-off-by:
Scott Jackson
<
scottmo@schedmd.com
>
parent
362d63f5
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/test3.2
+6
-88
6 additions, 88 deletions
testsuite/expect/test3.2
with
6 additions
and
88 deletions
testsuite/expect/test3.2
+
6
−
88
View file @
70b9655e
...
@@ -76,35 +76,8 @@ proc check_part_down { part_name } {
...
@@ -76,35 +76,8 @@ proc check_part_down { part_name } {
#
#
# Identify a partition and its state
# Identify a partition and its state
#
#
spawn $scontrol show part
set part_name [default_partition]
expect {
set part_old_state [get_partition_param $part_name "State"]
-re "PartitionName=($re_word_str)" {
if {[string compare $part_name ""] == 0} {
set part_name $expect_out(1,string)
}
exp_continue
}
timeout {
fail "scontrol not responding"
}
eof {
wait
}
}
spawn $scontrol show part $part_name
expect {
-re "State=($re_word_str) " {
set part_old_state $expect_out(1,string)
exp_continue
}
timeout {
fail "scontrol not responding"
}
eof {
wait
}
}
#
#
# Validate current partition information
# Validate current partition information
...
@@ -137,32 +110,8 @@ if {$job_runnable == 0} {
...
@@ -137,32 +110,8 @@ if {$job_runnable == 0} {
#
#
# Change that partition's state
# Change that partition's state
#
#
spawn $scontrol update PartitionName=$part_name State=$part_new_state
run_command -fail "$scontrol update PartitionName=$part_name State=$part_new_state"
expect {
set read_state [get_partition_param $part_name "State"]
timeout {
fail "scontrol not responding"
}
eof {
wait
}
}
#
# Validate partition's new state
#
spawn $scontrol show partition $part_name
expect {
-re "State=($re_word_str) " {
set read_state $expect_out(1,string)
exp_continue
}
timeout {
fail "scontrol not responding"
}
eof {
wait
}
}
subtest {[string compare $read_state $part_new_state] == 0} "scontrol should be able to change the partition state"
subtest {[string compare $read_state $part_new_state] == 0} "scontrol should be able to change the partition state"
#
#
...
@@ -175,37 +124,6 @@ if {$job_runnable == 1} {
...
@@ -175,37 +124,6 @@ if {$job_runnable == 1} {
#
#
# Return that partition's state to its old value
# Return that partition's state to its old value
#
#
spawn $scontrol update PartitionName=$part_name State=$part_old_state
run_command -fail "$scontrol update PartitionName=$part_name State=$part_old_state"
expect {
set read_state [get_partition_param $part_name "State"]
-re "slurm_update error: Invalid user id" {
exp_continue
}
-re "slurm_update error:" {
log_error "scontrol update error"
exp_continue
}
timeout {
fail "scontrol not responding"
}
eof {
wait
}
}
#
# Record that partition's state
#
spawn $scontrol show partition $part_name
expect {
-re "State=($re_word_str) " {
set read_state $expect_out(1,string)
exp_continue
}
timeout {
fail "scontrol not responding"
}
eof {
wait
}
}
subtest {[string compare $read_state $part_old_state] == 0} "scontrol should be able to change the partition state"
subtest {[string compare $read_state $part_old_state] == 0} "scontrol should be able to change the partition state"
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