summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Flatz2022-06-20 17:20:46 +0200
committerDavid Flatz2022-06-20 17:22:24 +0200
commit72010f5b4d1aee57e1ace054b91ab579d630366d (patch)
treed4c85f20e7699d14666e30b53b3251ea374e59dd /test
parentfff47a5651778018c6b437519b9ab1a535aa3e1d (diff)
downloaditools-72010f5b4d1aee57e1ace054b91ab579d630366d.tar.gz
itools-72010f5b4d1aee57e1ace054b91ab579d630366d.tar.bz2
itools-72010f5b4d1aee57e1ace054b91ab579d630366d.zip
make is_private_ip resolve hostnames and check all resolved ips
Diffstat (limited to 'test')
-rwxr-xr-xtest/it.t7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/it.t b/test/it.t
index f4bf710..69b46b6 100755
--- a/test/it.t
+++ b/test/it.t
@@ -341,6 +341,13 @@ is(it::is_private_ip('fd12::1337:bab3:d00d'), true, "is_private_ip fc
is(it::is_private_ip('81.6.43.252'), false, "is_private_ip dunstkreis.ch ipv4");
is(it::is_private_ip('2a02:169:200:d::15'), false, "is_private_ip dunstkreis.ch ipv6");
is(it::is_private_ip('127.6.7.23'), true, "is_private_ip loopback ipv4");
+is(it::is_private_ip('169.254.6.9'), true, "is_private_ip 169.254/16 example");
+is(it::is_private_ip('gna.ch'), false, "is_private_ip gna.ch");
+is(it::is_private_ip('dunstkreis.ch'), false, "is_private_ip dunstkreis.ch");
+is(it::is_private_ip('loopback.gna.ch'), true, "is_private_ip loopback.gna.ch points to ::1");
+is(it::is_private_ip('cname.gna.ch'), true, "is_private_ip cname.gna.ch points to loopback.gna.ch");
+is(it::is_private_ip('pub4.gna.ch'), true, "is_private_ip pub4.gna.ch has public ipv4 but private ipv6");
+is(it::is_private_ip('pub6.gna.ch'), true, "is_private_ip pub6.gna.ch has private ipv6 and public ipv6");
# it::filter_keys tests