Skip to content
Snippets Groups Projects
Verified Commit 1b521567 authored by Oto Šťáva's avatar Oto Šťáva Committed by Vladimír Čunát
Browse files

renumber: test for arbitrary netmask

parent 22f55884
Branches
Tags
2 merge requests!1327Update manager branch with the newest changes from master,!1306renumber: get rid of netmask limitation, now support any netmask
......@@ -43,6 +43,10 @@ local function prepare_cache()
gen_rrset('a166-66.test.',
kres.type.A, kres.str2ip('166.66.42.123')),
nil, ffi.C.KR_RANK_SECURE + ffi.C.KR_RANK_AUTH))
assert(c:insert(
gen_rrset('a167-81.test.',
kres.type.A, kres.str2ip('167.81.254.221')),
nil, ffi.C.KR_RANK_SECURE + ffi.C.KR_RANK_AUTH))
assert(c:insert(
gen_rrset('aaaa-db8-1.test.',
kres.type.AAAA, {
......@@ -67,7 +71,8 @@ local function test_renumber()
'a10-3plus4.test.', kres.type.A, kres.rcode.NOERROR, {'10.3.0.1', '192.168.3.10'})
check_answer('known IPv4 range is remapped when matching second-defined rule',
'a166-66.test.', kres.type.A, kres.rcode.NOERROR, '127.0.42.123')
check_answer('known IPv4 range is remapped when matching a rule with netmask not on a byte boundary',
'a167-81.test.', kres.type.A, kres.rcode.NOERROR, {'127.0.30.221'})
check_answer('two AAAA records',
'aaaa-db8-1.test.', kres.type.AAAA, kres.rcode.NOERROR,
......@@ -89,6 +94,7 @@ renumber.config({
{'10.2.0.0/24', '192.168.2.0'},
{'10.4.0.0/24', '192.168.3.10!'},
{'166.66.0.0/16', '127.0.0.0'},
{'167.81.255.0/19', '127.0.0.0'},
{'2001:db8:1::/48', '2001:db8:2::'},
})
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment