]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Add eight time test files with packet dates in 2038, 2039, 2106 and 2107
authorFrancois-Xavier Le Bail <[email protected]>
Thu, 21 Mar 2024 07:57:04 +0000 (08:57 +0100)
committerfxlb <[email protected]>
Fri, 27 Sep 2024 21:32:36 +0000 (21:32 +0000)
Each capture file contains one packet.

time_2038.pcap:    2038-01-01 00:00:00
time_2038_max.pcap:    2038-01-19 03:14:07
time_2038_overflow.pcap:   2038-01-19 03:14:08
time_2039.pcap:    2039-01-01 00:00:00
time_2106.pcap:    2106-01-01 00:00:00
time_2106_max.pcap:    2106-02-07 06:28:15
time_2106_overflow.pcapng: 2106-02-07 06:28:16
time_2107.pcapng:    2107-01-01 00:00:00

The packet time when > 2038-01-19T03:14:07Z cannot be correctly printed
if time_t size is 32 bits (overflow).
Some tests are run only if HAVE_TIME_T_64 is set. it depends on the
output of "./tcpdump --time-t-size" (32 or 64).

A 32-bit unsigned time_t goes until 2106-02-07T06:28:15Z.
All values above require a pcapng file.

17 files changed:
tests/time.tests [new file with mode: 0644]
tests/time_2038.out [new file with mode: 0644]
tests/time_2038.pcap [new file with mode: 0644]
tests/time_2038_max.out [new file with mode: 0644]
tests/time_2038_max.pcap [new file with mode: 0644]
tests/time_2038_overflow.out [new file with mode: 0644]
tests/time_2038_overflow.pcap [new file with mode: 0644]
tests/time_2039.out [new file with mode: 0644]
tests/time_2039.pcap [new file with mode: 0644]
tests/time_2106.out [new file with mode: 0644]
tests/time_2106.pcap [new file with mode: 0644]
tests/time_2106_max.out [new file with mode: 0644]
tests/time_2106_max.pcap [new file with mode: 0644]
tests/time_2106_overflow.out [new file with mode: 0644]
tests/time_2106_overflow.pcapng [new file with mode: 0644]
tests/time_2107.out [new file with mode: 0644]
tests/time_2107.pcapng [new file with mode: 0644]

diff --git a/tests/time.tests b/tests/time.tests
new file mode 100644 (file)
index 0000000..d2634ef
--- /dev/null
@@ -0,0 +1,68 @@
+# -*- perl -*-
+
+# The packet time when > 2038-01-19T03:14:07Z cannot be correctly printed
+# if time_t size is 32 bits (overflow).
+# Some tests are run only if HAVE_TIME_T_64 is set. it depends on the
+# output of "./tcpdump --time-t-size" (32 or 64).
+
+# A 32-bit unsigned time_t goes until 2106-02-07T06:28:15Z.
+# All values above require a pcapng file.
+
+$testlist = [
+    {
+        name => 'time_2038',
+        input => 'time_2038.pcap',
+        output => 'time_2038.out',
+        args   => '-q'
+    },
+    {
+        name => 'time_2038_max',
+        input => 'time_2038_max.pcap',
+        output => 'time_2038_max.out',
+        args   => '-q'
+    },
+    {
+        config_set => 'HAVE_TIME_T_64',
+        name => 'time_2038_overflow',
+        input => 'time_2038_overflow.pcap',
+        output => 'time_2038_overflow.out',
+        args   => '-q'
+    },
+    {
+        config_set => 'HAVE_TIME_T_64',
+        name => 'time_2039',
+        input => 'time_2039.pcap',
+        output => 'time_2039.out',
+        args   => '-q'
+    },
+    {
+        config_set => 'HAVE_TIME_T_64',
+        name => 'time_2106',
+        input => 'time_2106.pcap',
+        output => 'time_2106.out',
+        args   => '-q'
+    },
+    {
+        config_set => 'HAVE_TIME_T_64',
+        name => 'time_2106_max',
+        input => 'time_2106_max.pcap',
+        output => 'time_2106_max.out',
+        args   => '-q'
+    },
+    {
+        config_set => 'HAVE_TIME_T_64',
+        name => 'time_2106_overflow',
+        input => 'time_2106_overflow.pcapng',
+        output => 'time_2106_overflow.out',
+        args   => '-q'
+    },
+    {
+        config_set => 'HAVE_TIME_T_64',
+        name => 'time_2107',
+        input => 'time_2107.pcapng',
+        output => 'time_2107.out',
+        args   => '-q'
+    },
+];
+
+1;
diff --git a/tests/time_2038.out b/tests/time_2038.out
new file mode 100644 (file)
index 0000000..2f2395f
--- /dev/null
@@ -0,0 +1 @@
+    1  2038-01-01 00:00:00.000000 IP 192.168.1.11.43966 > 209.87.249.18.53: UDP, length 56
diff --git a/tests/time_2038.pcap b/tests/time_2038.pcap
new file mode 100644 (file)
index 0000000..8b10f33
Binary files /dev/null and b/tests/time_2038.pcap differ
diff --git a/tests/time_2038_max.out b/tests/time_2038_max.out
new file mode 100644 (file)
index 0000000..019d5b3
--- /dev/null
@@ -0,0 +1 @@
+    1  2038-01-19 03:14:07.000000 IP 192.168.1.11.43966 > 209.87.249.18.53: UDP, length 56
diff --git a/tests/time_2038_max.pcap b/tests/time_2038_max.pcap
new file mode 100644 (file)
index 0000000..d9b9b3f
Binary files /dev/null and b/tests/time_2038_max.pcap differ
diff --git a/tests/time_2038_overflow.out b/tests/time_2038_overflow.out
new file mode 100644 (file)
index 0000000..6eac7ba
--- /dev/null
@@ -0,0 +1 @@
+    1  2038-01-19 03:14:08.000000 IP 192.168.1.11.43966 > 209.87.249.18.53: UDP, length 56
diff --git a/tests/time_2038_overflow.pcap b/tests/time_2038_overflow.pcap
new file mode 100644 (file)
index 0000000..e050453
Binary files /dev/null and b/tests/time_2038_overflow.pcap differ
diff --git a/tests/time_2039.out b/tests/time_2039.out
new file mode 100644 (file)
index 0000000..68e3378
--- /dev/null
@@ -0,0 +1 @@
+    1  2039-01-01 00:00:00.000000 IP 192.168.1.11.43966 > 209.87.249.18.53: UDP, length 56
diff --git a/tests/time_2039.pcap b/tests/time_2039.pcap
new file mode 100644 (file)
index 0000000..bc061ad
Binary files /dev/null and b/tests/time_2039.pcap differ
diff --git a/tests/time_2106.out b/tests/time_2106.out
new file mode 100644 (file)
index 0000000..23e75eb
--- /dev/null
@@ -0,0 +1 @@
+    1  2106-01-01 00:00:00.000000 IP 192.168.1.11.43966 > 209.87.249.18.53: UDP, length 56
diff --git a/tests/time_2106.pcap b/tests/time_2106.pcap
new file mode 100644 (file)
index 0000000..73281bf
Binary files /dev/null and b/tests/time_2106.pcap differ
diff --git a/tests/time_2106_max.out b/tests/time_2106_max.out
new file mode 100644 (file)
index 0000000..548e944
--- /dev/null
@@ -0,0 +1 @@
+    1  2106-02-07 06:28:15.000000 IP 192.168.1.11.43966 > 209.87.249.18.53: UDP, length 56
diff --git a/tests/time_2106_max.pcap b/tests/time_2106_max.pcap
new file mode 100644 (file)
index 0000000..4c49447
Binary files /dev/null and b/tests/time_2106_max.pcap differ
diff --git a/tests/time_2106_overflow.out b/tests/time_2106_overflow.out
new file mode 100644 (file)
index 0000000..8a135dd
--- /dev/null
@@ -0,0 +1 @@
+    1  2106-02-07 06:28:16.000000 IP 192.168.1.11.43966 > 209.87.249.18.53: UDP, length 56
diff --git a/tests/time_2106_overflow.pcapng b/tests/time_2106_overflow.pcapng
new file mode 100644 (file)
index 0000000..85655cd
Binary files /dev/null and b/tests/time_2106_overflow.pcapng differ
diff --git a/tests/time_2107.out b/tests/time_2107.out
new file mode 100644 (file)
index 0000000..b42e505
--- /dev/null
@@ -0,0 +1 @@
+    1  2107-01-01 00:00:00.000000 IP 192.168.1.11.43966 > 209.87.249.18.53: UDP, length 56
diff --git a/tests/time_2107.pcapng b/tests/time_2107.pcapng
new file mode 100644 (file)
index 0000000..18df9ea
Binary files /dev/null and b/tests/time_2107.pcapng differ