diff --git a/scripts/hostcfgd b/scripts/hostcfgd index 70ffc07c..b244f874 100644 --- a/scripts/hostcfgd +++ b/scripts/hostcfgd @@ -1141,8 +1141,8 @@ class KdumpCfg(object): "memory": "0M-2G:256M,2G-4G:320M,4G-8G:384M,8G-:448M", "num_dumps": "3", "remote": "false", # New feature: remote, default is "false" - "ssh_string": "user@localhost", # New feature: SSH key, default value - "ssh_path": "/a/b/c" # New feature: SSH path, default value + "ssh_string": "root@127.0.0.1", # New feature: SSH key, default value + "ssh_path": "/root/.ssh/id_rsa" # New feature: SSH path, default value } def load(self, kdump_table): diff --git a/tests/hostcfgd/hostcfgd_test.py b/tests/hostcfgd/hostcfgd_test.py index 880aee22..4e7c4be6 100644 --- a/tests/hostcfgd/hostcfgd_test.py +++ b/tests/hostcfgd/hostcfgd_test.py @@ -215,8 +215,8 @@ def test_kdump_event(self): call(['sonic-kdump-config', '--num_dumps', '3']), call(['sonic-kdump-config', '--memory', '0M-2G:256M,2G-4G:320M,4G-8G:384M,8G-:448M']), call(['sonic-kdump-config', '--remote', 'false']), # Covering remote - call(['sonic-kdump-config', '--ssh_string', 'user@localhost']), # Covering ssh_string - call(['sonic-kdump-config', '--ssh_path', '/a/b/c']) # Covering ssh_path + call(['sonic-kdump-config', '--ssh_string', 'root@127.0.0.1']), # Covering ssh_string + call(['sonic-kdump-config', '--ssh_path', '/root/.ssh/id_rsa']) # Covering ssh_path ] mocked_subprocess.check_call.assert_has_calls(expected, any_order=True) @@ -236,8 +236,8 @@ def test_kdump_load(self): call(['sonic-kdump-config', '--num_dumps', '3']), call(['sonic-kdump-config', '--memory', '0M-2G:256M,2G-4G:320M,4G-8G:384M,8G-:448M']), call(['sonic-kdump-config', '--remote', 'false']), # Covering remote - call(['sonic-kdump-config', '--ssh_string', 'user@localhost']), # Covering ssh_string - call(['sonic-kdump-config', '--ssh_path', '/a/b/c']) # Covering ssh_path + call(['sonic-kdump-config', '--ssh_string', 'root@127.0.0.1']), # Covering ssh_string + call(['sonic-kdump-config', '--ssh_path', '/root/.ssh/id_rsa']) # Covering ssh_path ] mocked_subprocess.check_call.assert_has_calls(expected, any_order=True)