-
Notifications
You must be signed in to change notification settings - Fork 897
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
Raise event on new user creation #18052
Conversation
Follow up to PR ManageIQ#17852 Fixes BZ https://bugzilla.redhat.com/show_bug.cgi?id=1602136
@miq-bot add_label gaprindashvili/yes |
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.
No tests?
Thanks @bdunne I was thinking it was covered from the previous PR |
Just need to fix the test, as the event is being created. |
3a93483
to
6db2cc0
Compare
Hmm, @bdunne I'm not sure I'm testing this correct. As the event is being created, but I'm not getting the test to work correctly. |
6db2cc0
to
03eaea8
Compare
@@ -403,6 +403,12 @@ def authenticate | |||
expect(-> { authenticate }).to change { User.where(:userid => '[email protected]').count }.from(0).to(1) | |||
end | |||
|
|||
it "logs the success" do | |||
allow($log).to receive(:info).with(/Event/) | |||
expect($log).to receive(:info).with(/User creation successful for User$/) |
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.
Should this expectation be on $audit_log
?
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.
Also, the $
at the end of the regex shouldn't be there since that won't be the end of the message, right?
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.
Also also, should we expect that there is an event queued?
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.
We get the following in evm.log
[----] I, [2018-10-16T15:16:17.864540 #10740:3fc38f840e30] INFO -- : MIQ(MiqQueue.put) Message id: [327], id: [], Zone: [Zone 1], Role: [], Server: [], MiqTask id: [], Ident: [generic], Target id: [], Instance id: [], Task id: [], Command: [MiqEvent.raise_evm_event], Timeout: [600], Priority: [100], State: [ready], Deliver On: [], Data: [], Args: [["MiqServer", 315], "user_created", {:event_details=>"User creation successful for User: Bob Builderson with ID: [email protected]"}]
note "user_created", {:event_details=>"User creation successful for User: Bob Builderson with ID: [email protected]"}]
Yes I should be expecting an event queue too, I'm not sure how to do that.
03eaea8
to
8d0bcd5
Compare
Just keeping the same as the other tests, is that correct? |
@juliancheal can you update where this PR stands. Did it need further reviewing. This is needed for an impending deadline. |
59c7c77
to
9b5bfbc
Compare
9b5bfbc
to
e8377ba
Compare
Checked commits juliancheal/manageiq@adb680d~...e8377ba with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 spec/models/authenticator/ldap_spec.rb
|
Raise event on new user creation (cherry picked from commit d952e08) https://bugzilla.redhat.com/show_bug.cgi?id=1602136
Hammer backport details:
|
Follow up to PR #17852
Fixes BZ https://bugzilla.redhat.com/show_bug.cgi?id=1602136