1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
# Variant of redfishpower-cray-r272z30.dev that covers use of setplugs
# and setpath configuration
#
# Notes:
# - for easier grepping in tests, simplify paths
# - different paths for different chunks of nodes/plugs
# - no plug specific paths set for Node[10-15], will use defaults
# set via setstatpath, setonpath, etc.
specification "redfishpower-setpath" {
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-4] stat redfish/Group0\n"
expect "redfishpower> "
send "setpath Node[0-4] on redfish/Group0/Reset {\"ResetType\":\"On\"}\n"
expect "redfishpower> "
send "setpath Node[0-4] off redfish/Group0/Reset {\"ResetType\":\"ForceOff\"}\n"
expect "redfishpower> "
send "setpath Node[0-4] cycle redfish/Group0/Reset {\"ResetType\":\"ForceRestart\"}\n"
expect "redfishpower> "
send "setpath Node[5-9] stat redfish/Group1\n"
expect "redfishpower> "
send "setpath Node[5-9] on redfish/Group1/Reset {\"ResetType\":\"On\"}\n"
expect "redfishpower> "
send "setpath Node[5-9] off redfish/Group1/Reset {\"ResetType\":\"ForceOff\"}\n"
expect "redfishpower> "
send "setpath Node[5-9] cycle redfish/Group1/Reset {\"ResetType\":\"ForceRestart\"}\n"
expect "redfishpower> "
send "setstatpath redfish/Default\n"
expect "redfishpower> "
send "setonpath redfish/Default/Reset {\"ResetType\":\"On\"}\n"
expect "redfishpower> "
send "setoffpath redfish/Default/Reset {\"ResetType\":\"ForceOff\"}\n"
expect "redfishpower> "
send "setcyclepath redfish/Default/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> "
}
}
|