Skip to content
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

Consolr dangerous asset behavior and unit tests #359

Merged

Conversation

william-richard
Copy link
Contributor

Fixed some bugs around how dangerous assets and statuses behave, and added unit tests.

@maddalab @byxorna @roymarantz @defect @sushruta @funzoneq

@william-richard william-richard force-pushed the will-consolr-allow-safe-actions-on-dangerous-assets branch from 18d3ef6 to ccf325e Compare August 14, 2015 19:20
william-richard pushed a commit that referenced this pull request Aug 14, 2015
@@ -0,0 +1 @@
coverage/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a new line please

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, was in the middle of fixing it when you commented.

@william-richard william-richard force-pushed the will-consolr-allow-safe-actions-on-dangerous-assets branch from ccf325e to f269ea4 Compare August 14, 2015 19:24
william-richard pushed a commit that referenced this pull request Aug 14, 2015

it 'does log clear' do
expect { @console.start({:tag => dangerous_maintenance_tag, :log => 'clear'}) }.to output("sel clear\nSUCCESS\n").to_stdout_from_any_process
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how come these log commands are considered safe and tested via that mechanism?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log takes an argument (list or clear). The others take booleans. I think we should change the way its structured, but this PR was already too big.

@roymarantz
Copy link
Contributor

This is amazing!!! and looks good to me, but reuse would be improved if:

  • the initialize method took and argument, which defaulted to consolr, of the program name
  • the start method was implemented something like
    def start options
    process_danger_options options # process the danger related options and save as instance variables

    the existing code to get the collins asset

    run asset
    
    end
    where #run(node) does the dangerous checks and executes the operation if it is allowed.

IMO this would allow people (me) to use this gem for other kinds of safe ipmi hacking. e.g. nagios check...

@william-richard william-richard force-pushed the will-consolr-allow-safe-actions-on-dangerous-assets branch from f269ea4 to d9c0a18 Compare August 14, 2015 21:47
william-richard pushed a commit that referenced this pull request Aug 14, 2015
@william-richard
Copy link
Contributor Author

@roymarantz - I like all those ideas, but I think I want to do them in future PRs. This one is already pretty big, and I don't want to change too much at once.

@@ -0,0 +1,4 @@
host: https://collins.dc.net
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best practice is to use example.com: https://tools.ietf.org/html/rfc2606#section-3

@funzoneq
Copy link
Contributor

other then the nitpick 👍

@william-richard william-richard force-pushed the will-consolr-allow-safe-actions-on-dangerous-assets branch from d9c0a18 to 1002633 Compare August 17, 2015 19:31
william-richard pushed a commit that referenced this pull request Aug 17, 2015
@william-richard william-richard force-pushed the will-consolr-allow-safe-actions-on-dangerous-assets branch from 1002633 to 502de88 Compare August 17, 2015 19:36
william-richard pushed a commit that referenced this pull request Aug 17, 2015
…n-dangerous-assets

Consolr dangerous asset behavior and unit tests
@william-richard william-richard merged commit 1440505 into master Aug 17, 2015
@william-richard william-richard deleted the will-consolr-allow-safe-actions-on-dangerous-assets branch August 17, 2015 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants