-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
redfishpower: support test mode #143
Conversation
Problem: There is some inconsistent tabbing. Fix it!
Problem: In several functions curl API calls are not "grouped" together. They are oddly called at different points in the function even though it is not necessary. This is likely due to early development and cleanup was forgotten. Group the curl API calls together so the code is a little cleaner.
Problem: The commands "stat", "on", "off", and "cycle" are hard coded everywhere. This isn't good programming practice. Create macros CMD_STAT, CMD_ON, CMD_OFF, and CMD_CYCLE instead of hard coding it everywhere.
Problem: As redfishpower gets more complex, testing of the actual redfishpower co-process instead of the simulated one under t/simulators will become important. Add a test-mode into redfishpower via a --test-mode option. The test mode essentially disables all internal curl API calls so no actual network communication is done. All network calls are just assumed to work immediately. The power status of all hosts is tracked after off/on/cycle calls are made. Fixes chaos#131
Problem: Redfishpower now has a test mode, but it is not being used. Use it in t0029-redfish.t.
Problem: Redfishpower now has a --test-mode option, so the redfishpower simulator is no longer needed. Remove the redfishpower simulator from t/simulators.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! This will be better.
Did you see the simulator and dev script in #127? Just wanted to make sure you saw what was proposed there as it was intended to be kind of a design proposal, but not important for this PR!
Ahhh didn't see the tweaks you made there. Yeah, next step will be to come up with the exact config design we wanna use. |
FYI throwing up some fixups as I'm trying to figure out what is wrong with distcheck on CI. I think it's mostly related to the distcheck not finding the redfishpower binary. |
de35633
to
021c327
Compare
Problem: The t0029-redfish.t test now uses the redfishpower --test-mode option, not the redfishpower simulator. This requires 'make distcheck' to build redfishpower. Set the DISTCHECK_CONFIGURE_FLAGS environment variable to ensure distcheck builds redfishpower.
021c327
to
9a44768
Compare
I proposed a set of commands, implemented them in the simulator and added a test with a faux el cap config. It probably means having a hash of plugs rather than a hash of hosts, with plug->host optionally pointing to a host taken from -h (by configured index), and in the common / legacy case the plug name == the host name. But all the set commands are targetted at plugs by design. |
Problem: As redfishpower gets more complex, testing of the actual redfishpower co-process instead of the simulated one under t/simulators will become important.
Add a test-mode into redfishpower via a --test-mode option. The test mode essentially disables all internal curl API calls so no actual network communication is done. All network calls are just assumed to work immediately. The power status of all hosts is tracked after off/on/cycle calls are made.