mirror of
https://github.com/linux-system-roles/network.git
synced 2026-01-23 18:35:13 +00:00
refactor IPv6 DNS test when IPv6 is disabled
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
This commit is contained in:
parent
db10fc2035
commit
1112bc2664
1 changed files with 5 additions and 4 deletions
|
|
@ -3626,12 +3626,12 @@ class TestValidator(unittest.TestCase):
|
|||
0,
|
||||
)
|
||||
|
||||
def test_ipv6_dns_without_ipv6_config(self):
|
||||
def test_ipv6_dns_with_ipv6_disabled(self):
|
||||
"""
|
||||
Test that configuring IPv6 DNS is not allowed when IPv6 is disabled.
|
||||
"""
|
||||
validator = network_lsr.argument_validator.ArgValidator_ListConnections()
|
||||
ipv6_dns_without_ipv6_config = [
|
||||
ipv6_dns_with_ipv6_disabled = [
|
||||
{
|
||||
"name": "test_ipv6_dns",
|
||||
"type": "ethernet",
|
||||
|
|
@ -3642,11 +3642,12 @@ class TestValidator(unittest.TestCase):
|
|||
},
|
||||
}
|
||||
]
|
||||
self.assertRaises(
|
||||
self.assertRaisesRegexp(
|
||||
ValidationError,
|
||||
"IPv6 needs to be enabled to support IPv6 nameservers.",
|
||||
validator.validate_connection_one,
|
||||
"nm",
|
||||
validator.validate(ipv6_dns_without_ipv6_config),
|
||||
validator.validate(ipv6_dns_with_ipv6_disabled),
|
||||
0,
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue