mirror of
https://github.com/linux-system-roles/network.git
synced 2026-01-23 10:25:28 +00:00
test IPv6 DNS when static IPv6 is configured
When static IPv6 is configured, configuring IPv6 DNS will not raise any validation error. Add unit test to verify that. Signed-off-by: Wen Liang <liangwen12year@gmail.com>
This commit is contained in:
parent
b0c8195843
commit
774242fb63
1 changed files with 30 additions and 0 deletions
|
|
@ -3664,6 +3664,36 @@ class TestValidator(Python26CompatTestCase):
|
|||
0,
|
||||
)
|
||||
|
||||
def test_ipv6_dns_with_static_ipv6_configuration(self):
|
||||
"""
|
||||
Test that configuring IPv6 DNS is allowed when static IPv6 is configured.
|
||||
"""
|
||||
validator = network_lsr.argument_validator.ArgValidator_ListConnections()
|
||||
ipv6_dns_with_static_ipv6_configuration = [
|
||||
{
|
||||
"name": "test_ipv6_dns",
|
||||
"type": "ethernet",
|
||||
"ip": {
|
||||
"dhcp4": False,
|
||||
"auto6": False,
|
||||
"dns": ["2001:db8::20"],
|
||||
"address": ["2001:db8::2/32"],
|
||||
},
|
||||
}
|
||||
]
|
||||
# the connection index is 0 because there is only one connection profile
|
||||
# defined here
|
||||
connection_index = 0
|
||||
|
||||
self.assertEqual(
|
||||
validator.validate_connection_one(
|
||||
"nm",
|
||||
validator.validate(ipv6_dns_with_static_ipv6_configuration),
|
||||
connection_index,
|
||||
),
|
||||
None,
|
||||
)
|
||||
|
||||
def test_ipv6_dns_options_without_ipv6_config(self):
|
||||
"""
|
||||
Test that configuring IPv6 DNS options is not allowed when IPv6 is disabled.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue