Skip to content

Commit a41457a

Browse files
committed
Add eight time test files with packet dates in 2038, 2039, 2106 and 2107
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.
1 parent aacc29d commit a41457a

17 files changed

+76
-0
lines changed

tests/time.tests

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# -*- perl -*-
2+
3+
# The packet time when > 2038-01-19T03:14:07Z cannot be correctly printed
4+
# if time_t size is 32 bits (overflow).
5+
# Some tests are run only if HAVE_TIME_T_64 is set. it depends on the
6+
# output of "./tcpdump --time-t-size" (32 or 64).
7+
8+
# A 32-bit unsigned time_t goes until 2106-02-07T06:28:15Z.
9+
# All values above require a pcapng file.
10+
11+
$testlist = [
12+
{
13+
name => 'time_2038',
14+
input => 'time_2038.pcap',
15+
output => 'time_2038.out',
16+
args => '-q'
17+
},
18+
{
19+
name => 'time_2038_max',
20+
input => 'time_2038_max.pcap',
21+
output => 'time_2038_max.out',
22+
args => '-q'
23+
},
24+
{
25+
config_set => 'HAVE_TIME_T_64',
26+
name => 'time_2038_overflow',
27+
input => 'time_2038_overflow.pcap',
28+
output => 'time_2038_overflow.out',
29+
args => '-q'
30+
},
31+
{
32+
config_set => 'HAVE_TIME_T_64',
33+
name => 'time_2039',
34+
input => 'time_2039.pcap',
35+
output => 'time_2039.out',
36+
args => '-q'
37+
},
38+
{
39+
config_set => 'HAVE_TIME_T_64',
40+
name => 'time_2106',
41+
input => 'time_2106.pcap',
42+
output => 'time_2106.out',
43+
args => '-q'
44+
},
45+
{
46+
config_set => 'HAVE_TIME_T_64',
47+
name => 'time_2106_max',
48+
input => 'time_2106_max.pcap',
49+
output => 'time_2106_max.out',
50+
args => '-q'
51+
},
52+
{
53+
config_set => 'HAVE_TIME_T_64',
54+
name => 'time_2106_overflow',
55+
input => 'time_2106_overflow.pcapng',
56+
output => 'time_2106_overflow.out',
57+
args => '-q'
58+
},
59+
{
60+
config_set => 'HAVE_TIME_T_64',
61+
name => 'time_2107',
62+
input => 'time_2107.pcapng',
63+
output => 'time_2107.out',
64+
args => '-q'
65+
},
66+
];
67+
68+
1;

tests/time_2038.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1 2038-01-01 00:00:00.000000 IP 192.168.1.11.43966 > 209.87.249.18.53: UDP, length 56

tests/time_2038.pcap

138 Bytes
Binary file not shown.

tests/time_2038_max.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1 2038-01-19 03:14:07.000000 IP 192.168.1.11.43966 > 209.87.249.18.53: UDP, length 56

tests/time_2038_max.pcap

138 Bytes
Binary file not shown.

tests/time_2038_overflow.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1 2038-01-19 03:14:08.000000 IP 192.168.1.11.43966 > 209.87.249.18.53: UDP, length 56

tests/time_2038_overflow.pcap

138 Bytes
Binary file not shown.

tests/time_2039.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1 2039-01-01 00:00:00.000000 IP 192.168.1.11.43966 > 209.87.249.18.53: UDP, length 56

tests/time_2039.pcap

138 Bytes
Binary file not shown.

tests/time_2106.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1 2106-01-01 00:00:00.000000 IP 192.168.1.11.43966 > 209.87.249.18.53: UDP, length 56

0 commit comments

Comments
 (0)