aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite_dfilter/group_bytes_ipv6.py
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2018-05-03 12:05:12 -0700
committerGerald Combs <gerald@wireshark.org>2018-05-04 22:44:32 +0000
commit7591ed848e862d6f6f91d7398a1b98c4e5dea0fa (patch)
tree91da5400332fb46fe94246b746a59c943314142d /test/suite_dfilter/group_bytes_ipv6.py
parent8db1616ec382ca8eca3c6059fdfa32378a7918fb (diff)
Test: Add dftest to our tests.
Move the dfilter tests and captures from tools to test. Change-Id: I2e6a6cc1d383c985ba07c76c93ae1c57d3c8f84c Reviewed-on: https://code.wireshark.org/review/27339 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'test/suite_dfilter/group_bytes_ipv6.py')
-rw-r--r--test/suite_dfilter/group_bytes_ipv6.py104
1 files changed, 104 insertions, 0 deletions
diff --git a/test/suite_dfilter/group_bytes_ipv6.py b/test/suite_dfilter/group_bytes_ipv6.py
new file mode 100644
index 0000000000..94237aa26c
--- /dev/null
+++ b/test/suite_dfilter/group_bytes_ipv6.py
@@ -0,0 +1,104 @@
+# Copyright (c) 2013 by Gilbert Ramirez <gram@alumni.rice.edu>
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+import dfiltertest
+
+class case_bytes_ipv6(dfiltertest.DFTestCase):
+ trace_file = "ipv6.pcap"
+
+ def test_eq_1(self):
+ dfilter = "ipv6.dst == ff05::9999"
+ self.assertDFilterCount(dfilter, 1)
+
+ def test_eq_2(self):
+ dfilter = "ipv6.dst == ff05::9990"
+ self.assertDFilterCount(dfilter, 0)
+
+ def test_ne_1(self):
+ dfilter = "ipv6.dst != ff05::9990"
+ self.assertDFilterCount(dfilter, 1)
+
+ def test_ne_2(self):
+ dfilter = "ipv6.dst != ff05::9999"
+ self.assertDFilterCount(dfilter, 0)
+
+ def test_gt_1(self):
+ dfilter = "ipv6.dst > ff05::0000"
+ self.assertDFilterCount(dfilter, 1)
+
+ def test_gt_2(self):
+ dfilter = "ipv6.dst > ff05::9999"
+ self.assertDFilterCount(dfilter, 0)
+
+ def test_ge_1(self):
+ dfilter = "ipv6.dst >= ff05::9999"
+ self.assertDFilterCount(dfilter, 1)
+
+ def test_ge_2(self):
+ dfilter = "ipv6.dst >= ff05::a000"
+ self.assertDFilterCount(dfilter, 0)
+
+ def test_lt_1(self):
+ dfilter = "ipv6.dst < ff05::a000"
+ self.assertDFilterCount(dfilter, 1)
+
+ def test_lt_2(self):
+ dfilter = "ipv6.dst < ff05::9999"
+ self.assertDFilterCount(dfilter, 0)
+
+ def test_le_1(self):
+ dfilter = "ipv6.dst <= ff05::9999"
+ self.assertDFilterCount(dfilter, 1)
+
+ def test_le_2(self):
+ dfilter = "ipv6.dst <= ff05::9998"
+ self.assertDFilterCount(dfilter, 0)
+
+ def test_cidr_eq_1(self):
+ dfilter = "ipv6.dst == ff05::9999/128"
+ self.assertDFilterCount(dfilter, 1)
+
+ def test_cidr_eq_2(self):
+ dfilter = "ipv6.dst == ff05::0/64"
+ self.assertDFilterCount(dfilter, 1)
+
+ def test_cidr_eq_3(self):
+ dfilter = "ipv6.dst == ff05::ffff/112"
+ self.assertDFilterCount(dfilter, 1)
+
+ def test_cidr_eq_4(self):
+ dfilter = "ipv6.dst == ff04::0/64"
+ self.assertDFilterCount(dfilter, 0)
+
+ def test_cidr_ne_1(self):
+ dfilter = "ipv6.dst != ff05::9999/128"
+ self.assertDFilterCount(dfilter, 0)
+
+ def test_cidr_ne_2(self):
+ dfilter = "ipv6.dst != ff05::0/64"
+ self.assertDFilterCount(dfilter, 0)
+
+ def test_cidr_ne_3(self):
+ dfilter = "ipv6.dst != ff05::ffff/112"
+ self.assertDFilterCount(dfilter, 0)
+
+ def test_cidr_ne_4(self):
+ dfilter = "ipv6.dst != ff04::00/64"
+ self.assertDFilterCount(dfilter, 1)
+
+ def test_slice_1(self):
+ dfilter = "ipv6.dst[14:2] == 99:99"
+ self.assertDFilterCount(dfilter, 1)
+
+ def test_slice_2(self):
+ dfilter = "ipv6.dst[14:2] == 00:00"
+ self.assertDFilterCount(dfilter, 0)
+
+ def test_slice_3(self):
+ dfilter = "ipv6.dst[15:1] == 99"
+ self.assertDFilterCount(dfilter, 1)
+
+ def test_slice_4(self):
+ dfilter = "ipv6.dst[15:1] == 00"
+ self.assertDFilterCount(dfilter, 0)