From 572dcb8c4b5d7de423466301d9f07d60d91f39a2 Mon Sep 17 00:00:00 2001 From: muhammadalihussnain Date: Thu, 17 Apr 2025 17:13:41 +0500 Subject: [PATCH 1/2] changed the string and path to valid values --- scripts/hostcfgd | 2 +- tests/hostcfgd/hostcfgd_test.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/hostcfgd b/scripts/hostcfgd index cd3c2967..21f22886 100644 --- a/scripts/hostcfgd +++ b/scripts/hostcfgd @@ -1141,7 +1141,7 @@ 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": "", # New feature: SSH key, default value + "ssh_string": "root@127.0.0.1", # New feature: SSH key, default value "ssh_path": "" # New feature: SSH path, default value } diff --git a/tests/hostcfgd/hostcfgd_test.py b/tests/hostcfgd/hostcfgd_test.py index 330a528b..c32ea612 100644 --- a/tests/hostcfgd/hostcfgd_test.py +++ b/tests/hostcfgd/hostcfgd_test.py @@ -217,8 +217,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', '']), # Covering ssh_string - call(['sonic-kdump-config', '--ssh_path', '']) # 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) From 0a2c9646acd4ee4c7c6da460c19a25735de02a38 Mon Sep 17 00:00:00 2001 From: muhammadalihussnain Date: Thu, 17 Apr 2025 17:50:12 +0500 Subject: [PATCH 2/2] changes to def path and string --- scripts/hostcfgd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/hostcfgd b/scripts/hostcfgd index 21f22886..44f687ca 100644 --- a/scripts/hostcfgd +++ b/scripts/hostcfgd @@ -1142,7 +1142,7 @@ class KdumpCfg(object): "num_dumps": "3", "remote": "false", # New feature: remote, default is "false" "ssh_string": "root@127.0.0.1", # New feature: SSH key, default value - "ssh_path": "" # New feature: SSH path, default value + "ssh_path": "/root/.ssh/id_rsa" # New feature: SSH path, default value } def load(self, kdump_table):