forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support L1 & L3 Config generation in SONiC (sonic-net#7637)
Why I did it This provides support for: PR sonic-net#7074. How I did it Extend sonic-config-engine/config_samples.py to provide support for l1 & l3
- Loading branch information
1 parent
ef2cd16
commit 3e9f6fb
Showing
9 changed files
with
1,313 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"DEVICE_METADATA": { | ||
"localhost" : { | ||
"hwsku" : "{{ DEVICE_METADATA.localhost.hwsku }}" | ||
} | ||
}, | ||
{% set ns = {'firstPrinted': False} -%} | ||
"PORT": { | ||
{%- for key, value in PORT.items() -%} | ||
{%- if ns.firstPrinted %},{% endif %} | ||
|
||
"{{ key }}": { | ||
{%- for keyPort, valuePort in value.items() %} | ||
|
||
{% if keyPort != "admin_status" %}"{{ keyPort }}": "{{ valuePort }}",{% endif %} | ||
{%- endfor %} | ||
|
||
"admin_status": "{{ value.admin_status|default("up") }}", | ||
"mtu": "9100" | ||
} | ||
{%- if ns.update({'firstPrinted': True}) %}{% endif -%} | ||
{%- endfor %} | ||
|
||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
"DEVICE_METADATA": { | ||
"localhost" : { | ||
"hwsku" : "{{ DEVICE_METADATA.localhost.hwsku }}" | ||
} | ||
}, | ||
{% set ns = {'firstPrinted': False} -%} | ||
"PORT": { | ||
{%- for key, value in PORT.items() -%} | ||
{%- if ns.firstPrinted %},{% endif %} | ||
|
||
"{{ key }}": { | ||
{%- for keyPort, valuePort in value.items() %} | ||
|
||
{% if keyPort != "admin_status" %}"{{ keyPort }}": "{{ valuePort }}",{% endif %} | ||
{%- endfor %} | ||
|
||
"admin_status": "{{ value.admin_status|default("up") }}", | ||
"mtu": "9100" | ||
} | ||
{%- if ns.update({'firstPrinted': True}) %}{% endif -%} | ||
{%- endfor %} | ||
|
||
}, | ||
"LOOPBACK_INTERFACE": { | ||
"Loopback0": {}, | ||
"Loopback0|10.1.0.1/32": {} | ||
}, | ||
"BGP_NEIGHBOR": {}, | ||
"DEVICE_NEIGHBOR": {}, | ||
"INTERFACE": { | ||
"Ethernet0": {}, | ||
"Ethernet1": {}, | ||
"Ethernet2": {}, | ||
"Ethernet3": {}, | ||
"Ethernet4": {}, | ||
"Ethernet5": {}, | ||
"Ethernet6": {}, | ||
"Ethernet7": {}, | ||
"Ethernet8": {}, | ||
"Ethernet9": {}, | ||
"Ethernet10": {}, | ||
"Ethernet11": {}, | ||
"Ethernet12": {}, | ||
"Ethernet13": {}, | ||
"Ethernet14": {}, | ||
"Ethernet15": {}, | ||
"Ethernet16": {}, | ||
"Ethernet17": {}, | ||
"Ethernet18": {}, | ||
"Ethernet19": {}, | ||
"Ethernet20": {}, | ||
"Ethernet21": {}, | ||
"Ethernet22": {}, | ||
"Ethernet23": {}, | ||
"Ethernet24": {}, | ||
"Ethernet25": {}, | ||
"Ethernet26": {}, | ||
"Ethernet27": {}, | ||
"Ethernet28": {}, | ||
"Ethernet29": {}, | ||
"Ethernet30": {}, | ||
"Ethernet31": {} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/sonic-config-engine/tests/l1-l3-sample-port-config.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# name lanes alias index speed | ||
Ethernet0 1296,1297,1298,1299 Ethernet0 0 100000 | ||
Ethernet1 1300,1301,1302,1303 Ethernet1 1 100000 | ||
Ethernet2 1288,1289,1290,1291 Ethernet2 2 100000 | ||
Ethernet3 1292,1293,1294,1295 Ethernet3 3 100000 | ||
Ethernet4 1280,1281,1282,1283 Ethernet4 4 100000 | ||
Ethernet5 1284,1285,1286,1287 Ethernet5 5 100000 | ||
Ethernet6 1032,1033,1034,1035 Ethernet6 6 100000 | ||
Ethernet7 1036,1037,1038,1039 Ethernet7 7 100000 | ||
Ethernet8 1024,1025,1026,1027 Ethernet8 8 100000 | ||
Ethernet9 1028,1029,1030,1031 Ethernet9 9 100000 | ||
Ethernet10 772,773,774,775 Ethernet10 10 100000 | ||
Ethernet11 768,769,770,771 Ethernet11 11 100000 | ||
Ethernet12 780,781,782,783 Ethernet12 12 100000 | ||
Ethernet13 776,777,778,779 Ethernet13 13 100000 | ||
Ethernet14 528,529,530,531 Ethernet14 14 100000 | ||
Ethernet15 532,533,534,535 Ethernet15 15 100000 | ||
Ethernet16 520,521,522,523 Ethernet16 16 100000 | ||
Ethernet17 524,525,526,527 Ethernet17 17 100000 | ||
Ethernet18 512,513,514,515 Ethernet18 18 100000 | ||
Ethernet19 516,517,518,519 Ethernet19 19 100000 | ||
Ethernet20 272,273,274,275 Ethernet20 20 100000 | ||
Ethernet21 276,277,278,279 Ethernet21 21 100000 | ||
Ethernet22 264,265,266,267 Ethernet22 22 100000 | ||
Ethernet23 268,269,270,271 Ethernet23 23 100000 | ||
Ethernet24 256,257,258,259 Ethernet24 24 100000 | ||
Ethernet25 260,261,262,263 Ethernet25 25 100000 | ||
Ethernet26 16,17,18,19 Ethernet26 26 100000 | ||
Ethernet27 20,21,22,23 Ethernet27 27 100000 | ||
Ethernet28 8,9,10,11 Ethernet28 28 100000 | ||
Ethernet29 12,13,14,15 Ethernet29 29 100000 | ||
Ethernet30 0,1,2,3 Ethernet30 30 100000 | ||
Ethernet31 4,5,6,7 Ethernet31 31 100000 |
Oops, something went wrong.