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.
[lldp]: Add verification IPv4 address on LLDP conf Jinja2 Template (s…
…onic-net#5699) Fix sonic-net#5812 LLDP conf Jinja2 Template does not verify IPv4 address and can use IPv6 version. This issue does not effect control LLDP daemon. Issue can be reproduced via `test_snmp_lldp` test. LLDP conf Jinja2 Template selects first item from the list of mgmt interfaces. TESTBED_1 LLDP conf ``` # cat /etc/lldpd.conf configure ports eth0 lldp portidsubtype local eth0 configure system ip management pattern FC00:3::32 configure system hostname dut-1 ``` TESTBED_2 LLDP conf ``` # cat /etc/lldpd.conf configure ports eth0 lldp portidsubtype local eth0 configure system ip management pattern 10.22.24.61 configure system hostname dut-2 ``` TESTBED_1 MGMT_INTERFACE ``` $ redis-cli -n 4 keys "*" | grep MGMT_INTERFACE MGMT_INTERFACE|eth0|10.22.24.53/23 MGMT_INTERFACE|eth0|FC00:3::32/64 ``` TESTBED_2 MGMT_INTERFACE ``` $ redis-cli -n 4 keys "*" | grep MGMT_INTERFACE MGMT_INTERFACE|eth0|FC00:3::32/64 MGMT_INTERFACE|eth0|10.22.24.61/23 ``` Signed-off-by: Petro Bratash <petrox.bratash@intel.com>
- Loading branch information
1 parent
9bf461a
commit 96f36ae
Showing
9 changed files
with
77 additions
and
8 deletions.
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
12 changes: 12 additions & 0 deletions
12
src/sonic-config-engine/tests/data/lldp/mgmt_iface_ipv4.json
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,12 @@ | ||
{ | ||
"DEVICE_METADATA": { | ||
"localhost": { | ||
"hostname": "switch-t0" | ||
} | ||
}, | ||
"MGMT_INTERFACE": { | ||
"eth0|10.0.0.100/24": { | ||
"gwaddr": "10.0.0.100" | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/sonic-config-engine/tests/data/lldp/mgmt_iface_ipv4_and_ipv6.json
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,15 @@ | ||
{ | ||
"DEVICE_METADATA": { | ||
"localhost": { | ||
"hostname": "switch-t0" | ||
} | ||
}, | ||
"MGMT_INTERFACE": { | ||
"eth0|10.0.0.100/24": { | ||
"gwaddr": "10.0.0.100" | ||
}, | ||
"eth0|2603:10e2:0:2902::8/64": { | ||
"gwaddr": "2603:10e2:0:2902::8" | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/sonic-config-engine/tests/data/lldp/mgmt_iface_ipv6.json
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,12 @@ | ||
{ | ||
"DEVICE_METADATA": { | ||
"localhost": { | ||
"hostname": "switch-t0" | ||
} | ||
}, | ||
"MGMT_INTERFACE": { | ||
"eth0|2603:10e2:0:2902::8/64": { | ||
"gwaddr": "2603:10e2:0:2902::8" | ||
} | ||
} | ||
} |
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
src/sonic-config-engine/tests/sample_output/py2/lldp_conf/lldpd-ipv6-iface.conf
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,2 @@ | ||
configure system hostname switch-t0 | ||
pause |
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
src/sonic-config-engine/tests/sample_output/py3/lldp_conf/lldpd-ipv6-iface.conf
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,2 @@ | ||
configure system hostname switch-t0 | ||
pause |
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