-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
t: cover redfishpower plug substitution
Problem: There is no coverage for the new redfishpower plug substitution in paths. Add basic coverage in t0034-redfishpower.t and add test device files t/etc/redfishpower-plugsub.dev and t/etc/redfishpower-plugsub-blades.dev.
- Loading branch information
Showing
4 changed files
with
255 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Variant of redfishpower-cray-r272z30.dev that covers use of plug | ||
# substitution and the assumption of blades. | ||
# | ||
# Notes: | ||
# - hypothetical blades go through Node0 | ||
# - for easier grepping in tests, simplify paths | ||
specification "redfishpower-plugsub-blades" { | ||
timeout 60 | ||
|
||
script login { | ||
expect "redfishpower> " | ||
send "auth USER:PASS\n" | ||
expect "redfishpower> " | ||
send "setheader Content-Type:application/json\n" | ||
expect "redfishpower> " | ||
send "setplugs Node[0-15] [0-15]\n" | ||
expect "redfishpower> " | ||
send "setplugs Blade[0-3] 0\n" | ||
expect "redfishpower> " | ||
send "setstatpath redfish/Default-{{plug}}/Stat\n" | ||
expect "redfishpower> " | ||
send "setonpath redfish/Default-{{plug}}/Reset {\"ResetType\":\"On\"}\n" | ||
expect "redfishpower> " | ||
send "setoffpath redfish/Default-{{plug}}/Reset {\"ResetType\":\"ForceOff\"}\n" | ||
expect "redfishpower> " | ||
send "setcyclepath redfish/Default-{{plug}}/Reset {\"ResetType\":\"ForceRestart\"}\n" | ||
expect "redfishpower> " | ||
send "settimeout 60\n" | ||
expect "redfishpower> " | ||
} | ||
script logout { | ||
send "quit\n" | ||
} | ||
script status_all { | ||
send "stat\n" | ||
foreachnode { | ||
expect "([^\n:]+): ([^\n]+\n)" | ||
setplugstate $1 $2 on="^on\n" off="^off\n" | ||
} | ||
expect "redfishpower> " | ||
} | ||
script on_ranged { | ||
send "on %s\n" | ||
expect "redfishpower> " | ||
} | ||
script off_ranged { | ||
send "off %s\n" | ||
expect "redfishpower> " | ||
} | ||
script cycle_ranged { | ||
send "cycle %s\n" | ||
expect "redfishpower> " | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Variant of redfishpower-cray-r272z30.dev that covers use of plug | ||
# substitution. | ||
# | ||
# Notes: | ||
# - for easier grepping in tests, simplify paths | ||
# - different paths for different chunks of nodes/plugs | ||
# - no plug specific paths set for Node[8-15], will use defaults | ||
# set via setstatpath, setonpath, etc. | ||
specification "redfishpower-plugsub" { | ||
timeout 60 | ||
|
||
script login { | ||
expect "redfishpower> " | ||
send "auth USER:PASS\n" | ||
expect "redfishpower> " | ||
send "setheader Content-Type:application/json\n" | ||
expect "redfishpower> " | ||
send "setplugs Node[0-15] [0-15]\n" | ||
expect "redfishpower> " | ||
send "setpath Node[0-7] stat redfish/Group0\n" | ||
expect "redfishpower> " | ||
send "setpath Node[0-7] on redfish/Group0-{{plug}}/Reset {\"ResetType\":\"On\"}\n" | ||
expect "redfishpower> " | ||
send "setpath Node[0-7] off redfish/Group0-{{plug}}/Reset {\"ResetType\":\"ForceOff\"}\n" | ||
expect "redfishpower> " | ||
send "setpath Node[0-7] cycle redfish/Group0-{{plug}}/Reset {\"ResetType\":\"ForceRestart\"}\n" | ||
expect "redfishpower> " | ||
send "setstatpath redfish/Default\n" | ||
expect "redfishpower> " | ||
send "setonpath redfish/Default-{{plug}}/Reset {\"ResetType\":\"On\"}\n" | ||
expect "redfishpower> " | ||
send "setoffpath redfish/Default-{{plug}}/Reset {\"ResetType\":\"ForceOff\"}\n" | ||
expect "redfishpower> " | ||
send "setcyclepath redfish/Default-{{plug}}/Reset {\"ResetType\":\"ForceRestart\"}\n" | ||
expect "redfishpower> " | ||
send "settimeout 60\n" | ||
expect "redfishpower> " | ||
} | ||
script logout { | ||
send "quit\n" | ||
} | ||
script status_all { | ||
send "stat\n" | ||
foreachnode { | ||
expect "([^\n:]+): ([^\n]+\n)" | ||
setplugstate $1 $2 on="^on\n" off="^off\n" | ||
} | ||
expect "redfishpower> " | ||
} | ||
script on_ranged { | ||
send "on %s\n" | ||
expect "redfishpower> " | ||
} | ||
script off_ranged { | ||
send "off %s\n" | ||
expect "redfishpower> " | ||
} | ||
script cycle_ranged { | ||
send "cycle %s\n" | ||
expect "redfishpower> " | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters