-
Notifications
You must be signed in to change notification settings - Fork 658
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
kdump-Remote-SSH-Configurations #3400
base: master
Are you sure you want to change the base?
kdump-Remote-SSH-Configurations #3400
Conversation
4597f36
to
bc212a5
Compare
d644841
to
90cf8f1
Compare
@venkatmahalingam Hi! we have updated the code. Please Help us review the Code PRs. Thanks |
@venkatmahalingam Hi! we have updated the code. Please Help us review the Code PRs. Thanks in advance, target is 202411 |
if current_status == 'false': | ||
click.echo("Remote feature is not enabled. Please enable the remote feature first.") | ||
return | ||
|
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 validation for SSH path?
if current_status == 'false': | ||
click.echo("Remote feature is not enabled. Please enable the remote feature first.") | ||
return | ||
|
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 validation for SSH key?
ssh_prv_key = get_kdump_config("ssh_path") | ||
click.echo("Kdump private key path: {}".format(ssh_prv_key)) | ||
|
||
if get_kdump_config("remote") == "false": |
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.
'else' condition is enough here.
@@ -1,10 +1,9 @@ | |||
import importlib |
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.
Clarify the reason for this removal.
result = runner.invoke(config.config.commands["kdump"].commands["enable"], obj=db) | ||
print(result.exit_code) |
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.
Clarify the reason for this removal.
with self.assertRaises(SystemExit) as sys_exit: | ||
sonic_kdump_config.read_ssh_string() | ||
self.assertEqual(sys_exit.exception.code, 1) | ||
|
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 test cases no negative scenarios i.e invalid ssh_key/ssh_path?
mock_read_ssh_string.return_value = 'user@ip_address' # Simulate reading existing SSH string | ||
|
||
# Call the function to test | ||
sonic_kdump_config.write_ssh_string('user@ip_address') |
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.
user@ip_address ? can we test with actual valid values?
"""Tests the function `read_ssh_path(...)` in script `sonic-kdump-config`.""" | ||
|
||
# Test successful case with valid SSH path | ||
mock_run_cmd.return_value = (0, ['/path/to/keys'], None) |
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.
/path/to/keys ? can we test with actual valid values?
What I did
Added remote kdump functionality using SSH in SONiC.
How I did it
I added two new commands and two options to configure the kdump remote ssh feature.
How to verify it
Upon kernel crash, kdump will transfer the crash report files to the ssh server.