sonic-buildimage/dockers/docker-dhcp-relay/cli-plugin-tests/mock_config.py
Yaqiang Zhu 284ba61a86
[dhcp-relay] Add dhcp_relay show cli (#13614)
Why I did it
Currently the show and clear cli of dhcp_relayis may cause confusion.

How I did it
Add doc for it: [doc] Add docs for dhcp_relay show/clear cli sonic-utilities#2649
Add dhcp_relay config cli and test cases.
show dhcp_relay ipv4 helper
show dhcp_relay ipv6 destination
show dhcp_relay ipv6 counters
sonic-clear dhcp_relay ipv6 counters

How to verify it
Unit test all passed
2023-03-06 10:48:25 -08:00

135 lines
3.3 KiB
Python

COMMON_TEST_DATA = [
[
"ipv6_with_header",
{
"config_db": {
"DHCP_RELAY": {
"Vlan1000": {
"dhcpv6_servers": [
"fc02:2000::1",
"fc02:2000::2"
],
"dhcpv6_option|rfc6939_support": "true"
}
}
}
},
],
[
"ipv6_without_header",
{
"config_db": {
"DHCP_RELAY": {
"Vlan1000": {
"dhcpv6_servers": [
"fc02:2000::1",
"fc02:2000::2"
],
"dhcpv6_option|rfc6939_support": "true"
}
}
}
},
],
[
"ipv4_with_header",
{
"config_db": {
"VLAN": {
"Vlan1000": {
"dhcp_servers": [
"192.0.0.1",
"192.0.0.2"
]
}
}
}
}
]
]
NEW_ADDED_TEST_DATA = [
[
"ipv6",
{
"config_db": {
"DHCP_RELAY": {
"Vlan1000": {
"dhcpv6_servers": [
"fc02:2000::1",
"fc02:2000::2"
],
"dhcpv6_option|rfc6939_support": "true"
}
}
}
},
],
[
"ipv4",
{
"config_db": {
"VLAN": {
"Vlan1000": {
"dhcp_servers": [
"192.0.0.1",
"192.0.0.2"
]
},
"Vlan1001": {
"vlanid": "1001"
}
}
}
}
]
]
MULTI_TEST_DATA = [
[
"ipv6",
{
"config_db": {
"DHCP_RELAY": {
"Vlan1000": {
"dhcpv6_servers": [
"fc02:2000::1",
"fc02:2000::2"
],
"dhcpv6_option|rfc6939_support": "true"
},
"Vlan1001": {
"dhcpv6_servers": [
"fc02:2000::3",
"fc02:2000::4"
],
"dhcpv6_option|rfc6939_support": "true"
}
}
}
},
],
[
"ipv4",
{
"config_db": {
"VLAN": {
"Vlan1000": {
"dhcp_servers": [
"192.0.0.1",
"192.0.0.2"
]
},
"Vlan1001": {
"vlanid": "1001",
"dhcp_servers": [
"192.0.0.3",
"192.0.0.4"
]
}
}
}
}
]
]