-
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 parent/hierarchy support
Problem: There is no coverage for the new redfishpower parent/hierarchy support. Add coverage in t0034-redfishpower.t and add test device files t/etc/redfishpower-parents-2-levels.dev and t/etc/redfishpower-parents-3-levels.dev.
- Loading branch information
Showing
4 changed files
with
484 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,50 @@ | ||
# Variant of redfishpower-cray-r272z30.dev that covers use of setplugs | ||
# configuration with a parent. Node0 is the parent of Node[1-15] | ||
specification "redfishpower-parents-2-levels" { | ||
timeout 60 | ||
|
||
script login { | ||
expect "redfishpower> " | ||
send "auth USER:PASS\n" | ||
expect "redfishpower> " | ||
send "setheader Content-Type:application/json\n" | ||
expect "redfishpower> " | ||
send "setplugs Node0 0\n" | ||
expect "redfishpower> " | ||
send "setplugs Node[1-15] [1-15] Node0\n" | ||
expect "redfishpower> " | ||
send "setstatpath redfish/v1/Systems/Self\n" | ||
expect "redfishpower> " | ||
send "setonpath redfish/v1/Systems/Self/Actions/ComputerSystem.Reset {\"ResetType\":\"On\"}\n" | ||
expect "redfishpower> " | ||
send "setoffpath redfish/v1/Systems/Self/Actions/ComputerSystem.Reset {\"ResetType\":\"ForceOff\"}\n" | ||
expect "redfishpower> " | ||
send "setcyclepath redfish/v1/Systems/Self/Actions/ComputerSystem.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,60 @@ | ||
# Variant of redfishpower-cray-r272z30.dev that covers use of setplugs | ||
# configuration with parents. | ||
# Node0 is the parent of Node[1-3] | ||
# Node1 is the parent of Node[4-7] | ||
# Node2 is the parent of Node[8-11] | ||
# Node3 is the parent of Node[12-15] | ||
specification "redfishpower-parents-3-levels" { | ||
timeout 60 | ||
|
||
script login { | ||
expect "redfishpower> " | ||
send "auth USER:PASS\n" | ||
expect "redfishpower> " | ||
send "setheader Content-Type:application/json\n" | ||
expect "redfishpower> " | ||
send "setplugs Node0 0\n" | ||
expect "redfishpower> " | ||
send "setplugs Node[1-3] [1-3] Node0\n" | ||
expect "redfishpower> " | ||
send "setplugs Node[4-7] [4-7] Node1\n" | ||
expect "redfishpower> " | ||
send "setplugs Node[8-11] [8-11] Node2\n" | ||
expect "redfishpower> " | ||
send "setplugs Node[12-15] [12-15] Node3\n" | ||
expect "redfishpower> " | ||
send "setstatpath redfish/v1/Systems/Self\n" | ||
expect "redfishpower> " | ||
send "setonpath redfish/v1/Systems/Self/Actions/ComputerSystem.Reset {\"ResetType\":\"On\"}\n" | ||
expect "redfishpower> " | ||
send "setoffpath redfish/v1/Systems/Self/Actions/ComputerSystem.Reset {\"ResetType\":\"ForceOff\"}\n" | ||
expect "redfishpower> " | ||
send "setcyclepath redfish/v1/Systems/Self/Actions/ComputerSystem.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> " | ||
} | ||
} |
Oops, something went wrong.