[tcpdump-workers] Should the tcpdump tests be run with TZ=GMT0, or should the AFS printer print time stamps in UTC?

Denis Ovsienko denis at ovsienko.info
Sun Aug 5 08:46:28 EDT 2018


 ---- On Sat, 04 Aug 2018 08:41:10 +0100 Francois-Xavier Le Bail <devel.fx.lebail at orange.fr> wrote ---- 
 > On 04/08/2018 09:03, Guy Harris wrote:
 > > On Aug 3, 2018, at 6:44 PM, Michael Richardson <mcr at sandelman.ca> wrote:
 > > 
 > >> Guy Harris <gharris at sonic.net> wrote:
 > >>> Currently, the tcpdump tests for AFS fail if you're not in the time
 > >>> zone where the .out files were generated, because AFS time stamps are
 > >>> printed as local time rather than as UTC.
 > >>
 > >> That's broken
 > 
 > Why broken ? it's just local time.

The problem is to make the printed value unambiguous (i.e. for any valid binary value VP1 from the packet there is exactly one printed string value VS, and VS can be parsed into exactly one binary value VP2, and VP1 == VP2). If the VS value uses local clock time, the format should tell the timezone, such that the output of tcpdump made in one time zone can be correctly understood by the user in another (less human errors).

One problem with setting TZ before running is that tcpdump output does not tell what timezone it uses, and even if it does, some users will get different output for the same input by default. Another is that the test will require a custom script because at the moment the tests in TESTLIST either all use a custom TZ, or none of them (as it is now).

That said, if the output uses UTC, it could be helpful to use an unambiguous format as well, as in commit 99412d6.

 > > So we should just change it to use gmtime() rather than localtime().
 > 
 > I think an user prefer have the local time.

-- 
    Denis Ovsienko




More information about the tcpdump-workers mailing list