aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2018-05-11 12:19:07 +0200
committerAnders Broman <a.broman58@gmail.com>2018-05-12 06:29:55 +0000
commit5ec2265d2f1a3fbfc1c0a78421a9c4df86ac553e (patch)
tree2442c9c4eb384423465d364b34cbfefa446193a1 /test
parentb217c8fea14731ea638e8312c78d02d7900752fa (diff)
test: add test for resolved addresses
Tests that the documented "-z hosts,ipv4" filter actually works and that the resolved addresses table is correct (it implicitly tests that the definition of WS_INET_ADDRSTRLEN in wsutil/inet_addr.h is sane). Change-Id: If7babe665ea5ecb37e38078a9809c88873cb323c Ping-Bug: 14667 Reviewed-on: https://code.wireshark.org/review/27454 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/suite_nameres.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/suite_nameres.py b/test/suite_nameres.py
index 6552703372..3efa8be3d7 100644
--- a/test/suite_nameres.py
+++ b/test/suite_nameres.py
@@ -83,3 +83,30 @@ class case_name_resolution(subprocesstest.SubprocessTestCase):
# nameres.hosts_file_handling: True
# Profile: Custom
check_name_resolution(self, True, False, True, True, 'custom-4-2-2-2')
+
+ def test_hosts_any(self):
+ self.runProcess((config.cmd_tshark,
+ '-r', dns_icmp_pcapng,
+ '-qz', 'hosts',
+ ),
+ env=config.test_env)
+ self.assertTrue(self.grepOutput('174.137.42.65\twww.wireshark.org'))
+ self.assertTrue(self.grepOutput('fe80::6233:4bff:fe13:c558\tCrunch.local'))
+
+ def test_hosts_ipv4(self):
+ self.runProcess((config.cmd_tshark,
+ '-r', dns_icmp_pcapng,
+ '-qz', 'hosts,ipv4',
+ ),
+ env=config.test_env)
+ self.assertTrue(self.grepOutput('174.137.42.65\twww.wireshark.org'))
+ self.assertFalse(self.grepOutput('fe80::6233:4bff:fe13:c558\tCrunch.local'))
+
+ def test_hosts_ipv6(self):
+ self.runProcess((config.cmd_tshark,
+ '-r', dns_icmp_pcapng,
+ '-qz', 'hosts,ipv6',
+ ),
+ env=config.test_env)
+ self.assertTrue(self.grepOutput('fe80::6233:4bff:fe13:c558\tCrunch.local'))
+ self.assertFalse(self.grepOutput('174.137.42.65\twww.wireshark.org'))