-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
Add -i
option to Msf::Ui::Console::CommandDispatcher::Session
mixin's sessions
command
#18885
Changes from all commits
5978073
1eea790
02713fc
287b072
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,12 +66,20 @@ | |
allow(session).to receive(:next_session=) | ||
end | ||
|
||
let(:new_session_id) { 2 } | ||
let(:new_session_id) { '2' } | ||
|
||
it 'backgrounds the session and switches to the new session' do | ||
subject.cmd_sessions('-i', new_session_id) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason why this test was changed, rather than a new one added for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Initially I thought since both use the same back-end, a single test would suffice. But now in hindsight, I feel we'd need two separate tests. Will add it👍 |
||
expect(session).to have_received(:interacting=).with(false) | ||
expect(session).to have_received(:next_session=).with(new_session_id.to_i) | ||
end | ||
|
||
let(:new_session_id) { '1' } | ||
|
||
it 'backgrounds the session and switches to the new session' do | ||
subject.cmd_sessions(new_session_id) | ||
expect(session).to have_received(:interacting=).with(false) | ||
expect(session).to have_received(:next_session=).with(new_session_id) | ||
expect(session).to have_received(:next_session=).with(new_session_id.to_i) | ||
end | ||
end | ||
end | ||
|
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.
Would it make sense to add in a Rex Parser here?:
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.
Since there's only one option needed here, for simplicity's sake I feel we don't need this. If we use this, we'll also have to separately handlesessions <id>
as done here. If there's plans of adding new options here, it'd make sense to use the rex parser. I'll happily add the rex parser if you still feel we should use it.Yup will add that👍