test: make 'double' tests rely on icmp instead of ntp.
authorDario Lombardo <lomato@gmail.com>
Wed, 24 Oct 2018 12:02:27 +0000 (14:02 +0200)
committerAnders Broman <a.broman58@gmail.com>
Thu, 25 Oct 2018 04:09:44 +0000 (04:09 +0000)
'double' tests have been disabled in aa03833 due to format change
in ntp fields.

Change-Id: Id3ab0a736c164bb7fdfed7b5da8856b512308978
Reviewed-on: https://code.wireshark.org/review/30366
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
test/captures/icmp.pcapng.gz [new file with mode: 0644]
test/suite_dfilter/group_double.py

diff --git a/test/captures/icmp.pcapng.gz b/test/captures/icmp.pcapng.gz
new file mode 100644 (file)
index 0000000..653b9e5
Binary files /dev/null and b/test/captures/icmp.pcapng.gz differ
index c5e867629069f5d33b35038f4659095231d7260c..4275a712bebe5d24cfc5cc7d72dc2e99da61abef 100644 (file)
@@ -6,63 +6,62 @@ import unittest
 
 from suite_dfilter import dfiltertest
 
-@unittest.skip("Need to find a replacement to NTP for those tests")
 class case_double(dfiltertest.DFTestCase):
 
-    trace_file = "ntp.pcap"
+    trace_file = "icmp.pcapng.gz"
 
     def test_eq_1(self):
-        dfilter = "ntp.rootdelay == 0.0626983642578125"
+        dfilter = "icmp.resptime == 492.204"
         self.assertDFilterCount(dfilter, 1)
 
     def test_eq_2(self):
-        dfilter = "ntp.rootdelay == 0.0626"
+        dfilter = "icmp.resptime == 492.205"
         self.assertDFilterCount(dfilter, 0)
 
     def test_gt_1(self):
-        dfilter = "ntp.rootdelay > 1.0626"
-        self.assertDFilterCount(dfilter, 0)
+        dfilter = "icmp.resptime > 492"
+        self.assertDFilterCount(dfilter, 1)
 
     def test_gt_2(self):
-        dfilter = "ntp.rootdelay >  0.0626983642578125"
-        self.assertDFilterCount(dfilter, 0)
+        dfilter = "icmp.resptime > 492.203"
+        self.assertDFilterCount(dfilter, 1)
 
     def test_gt_3(self):
-        dfilter = "ntp.rootdelay >  0.0026"
-        self.assertDFilterCount(dfilter, 1)
+        dfilter = "icmp.resptime > 493"
+        self.assertDFilterCount(dfilter, 0)
 
     def test_ge_1(self):
-        dfilter = "ntp.rootdelay >= 1.0026"
+        dfilter = "icmp.resptime >= 493"
         self.assertDFilterCount(dfilter, 0)
 
     def test_ge_2(self):
-        dfilter = "ntp.rootdelay >=  0.0626983642578125"
+        dfilter = "icmp.resptime >= 492"
         self.assertDFilterCount(dfilter, 1)
 
     def test_ge_3(self):
-        dfilter = "ntp.rootdelay >=  0.0026"
+        dfilter = "icmp.resptime >= 492.204"
         self.assertDFilterCount(dfilter, 1)
 
     def test_lt_1(self):
-        dfilter = "ntp.rootdelay < 1.0026"
+        dfilter = "icmp.resptime < 493"
         self.assertDFilterCount(dfilter, 1)
 
     def test_lt_2(self):
-        dfilter = "ntp.rootdelay <  0.0626983642578125"
+        dfilter = "icmp.resptime < 492"
         self.assertDFilterCount(dfilter, 0)
 
     def test_lt_3(self):
-        dfilter = "ntp.rootdelay <  0.0026"
+        dfilter = "icmp.resptime < 492.204"
         self.assertDFilterCount(dfilter, 0)
 
     def test_le_1(self):
-        dfilter = "ntp.rootdelay <= 1.0026"
+        dfilter = "icmp.resptime <= 492.204"
         self.assertDFilterCount(dfilter, 1)
 
     def test_le_2(self):
-        dfilter = "ntp.rootdelay <=  0.0626983642578125"
+        dfilter = "icmp.resptime <= 493"
         self.assertDFilterCount(dfilter, 1)
 
     def test_le_3(self):
-        dfilter = "ntp.rootdelay <=  0.0026"
+        dfilter = "icmp.resptime <= 492"
         self.assertDFilterCount(dfilter, 0)