mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-28 05:11:25 -07:00
To ipv6 network (#48572)
* Add to_ipv6_subnet function * Use the correct function for subnet * Corrected code style and tests * Corrected testcase assertion 64 bits make 8 octets, or 4 hextets * Import from correct module directly
This commit is contained in:
parent
5ed9d819ab
commit
8de00e3e1c
4 changed files with 43 additions and 5 deletions
|
@ -26,8 +26,9 @@ import pytest
|
|||
from ansible.module_utils.network.common.utils import to_list, sort_list
|
||||
from ansible.module_utils.network.common.utils import dict_diff, dict_merge
|
||||
from ansible.module_utils.network.common.utils import conditional, Template
|
||||
from ansible.module_utils.network.common.utils import to_masklen, to_netmask, to_subnet, to_ipv6_network
|
||||
from ansible.module_utils.network.common.utils import is_masklen, is_netmask
|
||||
from ansible.module_utils.common.network import (
|
||||
to_masklen, to_netmask, to_subnet, to_ipv6_network, to_ipv6_subnet, is_masklen, is_netmask
|
||||
)
|
||||
|
||||
|
||||
def test_to_list():
|
||||
|
@ -204,3 +205,9 @@ def test_to_ipv6_network():
|
|||
assert '2001:db8::' == to_ipv6_network('2001:db8::')
|
||||
assert '2001:0db8:85a3::' == to_ipv6_network('2001:0db8:85a3:0000:0000:8a2e:0370:7334')
|
||||
assert '2001:0db8:85a3::' == to_ipv6_network('2001:0db8:85a3:0:0:8a2e:0370:7334')
|
||||
|
||||
|
||||
def test_to_ipv6_subnet():
|
||||
assert '2001:db8::' == to_ipv6_subnet('2001:db8::')
|
||||
assert '2001:0db8:85a3:4242::' == to_ipv6_subnet('2001:0db8:85a3:4242:0000:8a2e:0370:7334')
|
||||
assert '2001:0db8:85a3:4242::' == to_ipv6_subnet('2001:0db8:85a3:4242:0:8a2e:0370:7334')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue