ofp-print: Omit timestamp when printing packets in ofp_packet_to_string().
authorBen Pfaff <blp@nicira.com>
Mon, 14 Mar 2011 16:46:19 +0000 (09:46 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 14 Mar 2011 17:13:34 +0000 (10:13 -0700)
There's no value in the timestamp here, because it will always be the
same.  Printing it just makes results less reproducible because output
then depends on the time zone.

This fixes a test failure in California due to yesterday's DST change,
and presumably a test failure almost everywhere else all the time.

Reported-by: Andrew Evans <aevans@nicira.com>
lib/ofp-print.c
tests/ofp-print.at

index d4f33da..b4e6918 100644 (file)
@@ -82,7 +82,7 @@ ofp_packet_to_string(const void *data, size_t len, size_t total_len OVS_UNUSED)
     }
     rewind(pcap);
 
-    snprintf(command, sizeof command, "/usr/sbin/tcpdump -e -n -r /dev/fd/%d 2>/dev/null",
+    snprintf(command, sizeof command, "/usr/sbin/tcpdump -t -e -n -r /dev/fd/%d 2>/dev/null",
              fileno(pcap));
     tcpdump = popen(command, "r");
     fclose(pcap);
index af5249b..d9ec6e8 100644 (file)
@@ -230,7 +230,7 @@ dnl so trim off the end of the line where differences appear.
 AT_CHECK([sed 's/\(length 60:\).*/\1 .../' stdout], [0], [dnl
 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=3 data_len=60 buffer=0x00000111
 tunnel0:in_port0003:tci(0) mac50:54:00:00:00:05->50:54:00:00:00:06 type0800 proto6 tos0 ip192.168.0.1->192.168.0.2 port10031->0
--8:00:00.000000 50:54:00:00:00:05 > 50:54:00:00:00:06, ethertype IPv4 (0x0800), length 60: ...
+50:54:00:00:00:05 > 50:54:00:00:00:06, ethertype IPv4 (0x0800), length 60: ...
 ])
 AT_CLEANUP