Skip to content

Commit 01518cd

Browse files
authored
Kdump Remote ssh yang enhancements (#19540)
Why I did it Added support for Kdump remote SSH feature in existing sonic-kdump.yang How I did it Modified sonic-kdump.yang file to add support for ssh , ssh_connection and ssh_path strings How to verify it Updated yang model with required changes for feature
1 parent 8295675 commit 01518cd

File tree

4 files changed

+64
-6
lines changed

4 files changed

+64
-6
lines changed

src/sonic-yang-models/doc/Configuration.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,10 @@ The configuration is applied globally for each ECMP and LAG on a switch.
13701370
"config": {
13711371
"enabled": "true",
13721372
"num_dumps": "3",
1373-
"memory": "0M-2G:256M,2G-4G:256M,4G-8G:384M,8G-:448M"
1373+
"memory": "0M-2G:256M,2G-4G:256M,4G-8G:384M,8G-:448M",
1374+
"remote": "true",
1375+
"ssh_string": "username@ipaddress",
1376+
"ssh_path": "a/b/c"
13741377
}
13751378
}
13761379
}

src/sonic-yang-models/tests/yang_model_tests/tests/kdump.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@
1515
"KDUMP_WITH_INVALID_MEMORY": {
1616
"desc": "Configuring kdump config with invalid memory config.",
1717
"eStr": ["pattern", "does not satisfy"]
18+
},
19+
"KDUMP_WITH_VALID_REMOTE_VALUES": {
20+
"desc": "Configuring the kdump with valid remote ssh values."
1821
}
1922
}

src/sonic-yang-models/tests/yang_model_tests/tests_config/kdump.json

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
"config": {
66
"enabled": "true",
77
"num_dumps": "3",
8-
"memory": "0M-2G:256M,2G-4G:256M,4G-8G:384M,8G-:448M"
8+
"memory": "0M-2G:256M,2G-4G:256M,4G-8G:384M,8G-:448M",
9+
"remote": "true",
10+
"ssh_string" : "[email protected]",
11+
"ssh_path": "/home/ali/.ssh/id_rsa"
912
}
1013
}
1114
}
@@ -16,7 +19,10 @@
1619
"config": {
1720
"enabled": "true",
1821
"num_dumps": "9",
19-
"memory": "512M"
22+
"memory": "512M",
23+
"remote": "true",
24+
"ssh_string" : "[email protected]",
25+
"ssh_path": "/home/ali/.ssh/id_rsa"
2026
}
2127
}
2228
}
@@ -27,7 +33,10 @@
2733
"config": {
2834
"enabled": "false",
2935
"num_dumps": "1",
30-
"memory": "512M"
36+
"memory": "512M",
37+
"remote": "true",
38+
"ssh_string" : "[email protected]",
39+
"ssh_path": "/home/ali/.ssh/id_rsa"
3140
}
3241
}
3342
}
@@ -38,7 +47,10 @@
3847
"config": {
3948
"enabled": "true",
4049
"num_dumps": "100",
41-
"memory": "0M-2G:256M,2G-4G:256M,4G-8G:384M,8G-:448M"
50+
"memory": "0M-2G:256M,2G-4G:256M,4G-8G:384M,8G-:448M",
51+
"remote": "true",
52+
"ssh_string" : "[email protected]",
53+
"ssh_path": "/home/ali/.ssh/id_rsa"
4254
}
4355
}
4456
}
@@ -49,7 +61,25 @@
4961
"config": {
5062
"enabled": "true",
5163
"num_dumps": "3",
52-
"memory": "666"
64+
"memory": "666",
65+
"remote": "true",
66+
"ssh_string" : "[email protected]",
67+
"ssh_path": "/home/ali/.ssh/id_rsa"
68+
}
69+
}
70+
}
71+
},
72+
73+
"KDUMP_WITH_VALID_REMOTE_VALUES": {
74+
"sonic-kdump:sonic-kdump": {
75+
"sonic-kdump:KDUMP": {
76+
"config": {
77+
"enabled": "true",
78+
"num_dumps": "3",
79+
"memory": "0M-2G:256M,2G-4G:256M,4G-8G:384M,8G-:448M",
80+
"remote": "true",
81+
"ssh_string" : "[email protected]",
82+
"ssh_path": "/home/ali/.ssh/id_rsa"
5383
}
5484
}
5585
}

src/sonic-yang-models/yang-models/sonic-kdump.yang

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,28 @@ module sonic-kdump {
5454
description
5555
"Maximum number of Kernel Core files Stored";
5656
}
57+
leaf remote {
58+
type boolean;
59+
description
60+
"Enable or Disable the Kdump remote ssh mechanism";
61+
}
62+
63+
leaf ssh_string {
64+
type string {
65+
pattern "([a-zA-Z0-9._%+-]+@([a-zA-Z0-9.-]+|[0-9]{1,3}(\\.[0-9]{1,3}){3}))";
66+
}
67+
description "Remote ssh connection string";
68+
69+
}
70+
71+
leaf ssh_path {
72+
type string {
73+
pattern "(/([a-zA-Z0-9._-]+|\\.)+)+";
74+
}
75+
description "Remote ssh private key path";
76+
77+
}
78+
5779
}
5880
}
5981
}

0 commit comments

Comments
 (0)