Unit test results is attached with this email.

Thanks,
Arun

On 6/30/12 1:20 AM, "Arun Sharma" <arun.sha...@calsoftinc.com> wrote:

>Fixed the remaining programs which does not logs in UTC timestamp format.
>Also updated NEWS.
>
>Signed-off-by: Arun Sharma <arun.sha...@calsoftinc.com>
>---
> NEWS                  |    5 ++++-
> lib/table.c           |    2 +-
> lib/vlog.c            |    4 ++--
> ovsdb/ovsdb-tool.c    |    2 +-
> utilities/ovs-ofctl.c |    2 +-
> 5 files changed, 9 insertions(+), 6 deletions(-)
>
>diff --git a/NEWS b/NEWS
>index f0b2490..f9f7d8c 100644
>--- a/NEWS
>+++ b/NEWS
>@@ -20,7 +20,10 @@ post-v1.7.0
>     - Open vSwitch now sends RARP packets in situations where it
>previously
>       sent a custom protocol, making it consistent with behavior of QEMU
>and
>       VMware.
>-
>+    - Logging:
>+      - "ovsdb-tool show-log" display records having UTC.
>+      - "ovsdb-client --timestamp" display timestamp in UTC.
>+      - "ovs-ofctl --timestamp" display timestamp in UTC.
> 
> v1.7.0 - xx xxx xxxx
> ------------------------
>diff --git a/lib/table.c b/lib/table.c
>index a8b35e2..f24ddc6 100644
>--- a/lib/table.c
>+++ b/lib/table.c
>@@ -224,7 +224,7 @@ static void
> table_format_timestamp__(char *s, size_t size)
> {
>     time_t now = time_wall();
>-    strftime(s, size, "%Y-%m-%d %H:%M:%S", localtime(&now));
>+    strftime(s, size, "%Y-%m-%d %H:%M:%S", gmtime(&now));
> }
> 
> static void
>diff --git a/lib/vlog.c b/lib/vlog.c
>index e5c5feb..d26e613 100644
>--- a/lib/vlog.c
>+++ b/lib/vlog.c
>@@ -498,8 +498,8 @@ vlog_init(void)
>         struct tm tm;
>         char s[128];
> 
>-        localtime_r(&now, &tm);
>-        strftime(s, sizeof s, "%a, %d %b %Y %H:%M:%S %z", &tm);
>+        gmtime_r(&now, &tm);
>+        strftime(s, sizeof s, "%a, %d %b %Y %H:%M:%S", &tm);
>         VLOG_ERR("current time is negative: %s (%ld)", s, (long int)
>now);
>     }
> 
>diff --git a/ovsdb/ovsdb-tool.c b/ovsdb/ovsdb-tool.c
>index f680989..f5412f3 100644
>--- a/ovsdb/ovsdb-tool.c
>+++ b/ovsdb/ovsdb-tool.c
>@@ -513,7 +513,7 @@ do_show_log(int argc, char *argv[])
>                 time_t t = json_integer(date);
>                 char s[128];
> 
>-                strftime(s, sizeof s, "%Y-%m-%d %H:%M:%S",
>localtime(&t));
>+                strftime(s, sizeof s, "%Y-%m-%d %H:%M:%S", gmtime(&t));
>                 printf(" %s", s);
>             }
> 
>diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
>index a2dfabf..dbc46cd 100644
>--- a/utilities/ovs-ofctl.c
>+++ b/utilities/ovs-ofctl.c
>@@ -1127,7 +1127,7 @@ monitor_vconn(struct vconn *vconn)
>                 time_t now = time_wall();
>                 char s[32];
> 
>-                strftime(s, sizeof s, "%Y-%m-%d %H:%M:%S: ",
>localtime(&now));
>+                strftime(s, sizeof s, "%Y-%m-%d %H:%M:%S: ",
>gmtime(&now));
>                 fputs(s, stderr);
>             }
> 
>-- 
>1.7.2.5
>
>_______________________________________________
>dev mailing list
>dev@openvswitch.org
>http://openvswitch.org/mailman/listinfo/dev
>

{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf320
{\fonttbl\f0\fmodern\fcharset0 Courier;\f1\fmodern\fcharset0 Courier-Bold;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww21120\viewh18840\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural

\f0\fs28 \cf0 ars@debian-dev-local:~$ date -u \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural

\f1\b\fs36 \cf0 Mon Jul  2 08:19:00 UTC 2012
\f0\b0\fs28 \
\
\
$ sudo utilities/ovs-ofctl --timestamp -v monitor br0\
2012-07-02T08:18:27Z|00001|ofctl|DBG|connecting to unix:/usr/local/var/run/openvswitch/br0.mgmt\
2012-07-02T08:18:27Z|00002|vconn|DBG|unix:/usr/local/var/run/openvswitch/br0.mgmt: sent (Success): OFPT_HELLO (xid=0x1):\
2012-07-02T08:18:27Z|00003|vconn|DBG|unix:/usr/local/var/run/openvswitch/br0.mgmt: received: OFPT_HELLO (xid=0x1):\
2012-07-02T08:18:27Z|00004|vconn|DBG|unix:/usr/local/var/run/openvswitch/br0.mgmt: negotiated OpenFlow version 0x01 (we support versions 0x01 to 0x01 inclusive, peer no later than version 0x01)\
2012-07-02T08:18:27Z|00005|vconn|DBG|unix:/usr/local/var/run/openvswitch/br0.mgmt: sent (Success): NXT_SET_PACKET_IN_FORMAT (xid=0x2): format=nxm\
2012-07-02T08:18:27Z|00006|vconn|DBG|unix:/usr/local/var/run/openvswitch/br0.mgmt: sent (Success): OFPT_BARRIER_REQUEST (xid=0x3):\
2012-07-02T08:18:27Z|00007|vconn|DBG|unix:/usr/local/var/run/openvswitch/br0.mgmt: received: OFPT_BARRIER_REPLY (xid=0x3):\
2012-07-02T08:19:27Z|00008|poll_loop|DBG|wakeup due to [POLLIN] on fd 6 (<->/usr/local/var/run/openvswitch/br0.mgmt) at lib/stream-fd.c:143\
2012-07-02T08:19:27Z|00009|vconn|DBG|unix:/usr/local/var/run/openvswitch/br0.mgmt: received: OFPT_ECHO_REQUEST (xid=0x0): 0 bytes of payload\

\f1\b\fs36 2012-07-02 08:19:27
\fs28 :
\f0\b0  OFPT_ECHO_REQUEST (xid=0x0): 0 bytes of payload\
^C2012-07-02T08:19:36Z|00010|poll_loop|DBG|wakeup due to [POLLIN] on fd 4 (FIFO pipe:[28361]) at lib/fatal-signal.c:176\
2012-07-02T08:19:36Z|00011|fatal_signal|WARN|terminating with signal 2 (Interrupt)\
\
\
\
\
\
\
$ sudo utilities/ovs-ofctl -v dump-flows br0\
2012-07-02T08:22:33Z|00001|vlog|ERR|current time is negative:
\fs36  
\f1\b Mon, 29 Dec 1969 06:56:06 
\f0\b0\fs28 (-234234)\
\
\
\
\
$ sudo ovsdb/ovsdb-client -v --timestamp monitor Bridge\
2012-07-02T08:28:06Z|00009|poll_loop|DBG|wakeup due to [POLLIN] on fd 3 (<->/usr/local/var/run/openvswitch/db.sock) at lib/stream-fd.c:143\
2012-07-02T08:28:06Z|00010|jsonrpc|DBG|unix:/usr/local/var/run/openvswitch/db.sock: received notification, method="update", params=[null,\{"Bridge":\{"b1a441bb-5ebd-43b2-abee-058d94360bdf":\{"old":\{"datapath_id":["set",[]],"_version":["uuid","3d85fa76-858b-4f85-8810-6a325bfc9a2b"]\},"new":\{"status":["map",[]],"_version":["uuid","ca4b86ba-1e35-4035-976f-6f47efcf586b"],"fail_mode":["set",[]],"other_config":["map",[]],"name":"br5","datapath_type":"","ports":["uuid","4c579cb1-2d3c-4f80-8878-fa091339d812"],"netflow":["set",[]],"flood_vlans":["set",[]],"external_ids":["map",[]],"controller":["set",[]],"sflow":["set",[]],"flow_tables":["map",[]],"datapath_id":"0000ba41a4b1b243","stp_enable":false,"mirrors":["set",[]]\}\}\}\}]\
\

\f1\b\fs36 2012-07-02 08:28:06
\f0\b0\fs28 \
row                                  action controller datapath_id        datapath_type external_ids fail_mode flood_vlans flow_tables mirrors name  netflow other_config ports                                  sflow status stp_enable _version                            \
------------------------------------ ------ ---------- ------------------ ------------- ------------ --------- ----------- ----------- ------- ----- ------- ------------ -------------------------------------- ----- ------ ---------- ------------------------------------\
b1a441bb-5ebd-43b2-abee-058d94360bdf old               []                                                                                                                                                                                3d85fa76-858b-4f85-8810-6a325bfc9a2b\
                                     new    []         "0000ba41a4b1b243" ""            \{\}           []        []          \{\}          []      "br5" []      \{\}           [4c579cb1-2d3c-4f80-8878-fa091339d812] []    \{\}     false      ca4b86ba-1e35-4035-976f-6f47efcf586b\
\
\
\
\
\
\
\
\
\
\
$ sudo ovsdb/ovsdb-tool show-log -m /usr/local/etc/openvswitch/conf.db \
record 0: "Open_vSwitch" schema, version="6.9.3", cksum="2110020336 16754"\
\
record 1: 2012-06-28 19:38:08 "ovs-vsctl: ovs-vsctl --no-wait --timeout=5 -- init -- set Open_vSwitch . db-version=6.9.3"\
	table Open_vSwitch insert row 04b76611:\
\
record 2: 2012-06-28 19:38:08 "ovs-vsctl: ovs-vsctl --no-wait --timeout=5 set Open_vSwitch . ovs-version=1.7.90 "external-ids:system-id=\\"88fd2432-252c-4bab-adb2-01b8ba6b7b09\\"" "system-type=\\"Debian\\"" "system-version=\\"6.0.4-squeeze\\"""\
	table Open_vSwitch row 04b76611 (04b76611):\
\
record 3: 2012-06-28 20:48:10 "ovs-vsctl: ovs-vsctl add-br br0"\
	table Port insert row "br0" (c7b334f9):\
	table Interface insert row "br0" (c2bb9a3a):\
	table Open_vSwitch row 04b76611 (04b76611):\
	table Bridge insert row "br0" (234de2f6):\
\
record 4: 2012-06-28 20:48:10\
	table Open_vSwitch row 04b76611 (04b76611):\
\
record 5: 2012-06-28 20:49:30 "ovs-vsctl: ovs-vsctl del-br br0"\
	table Port row "br0" (c7b334f9):\
		delete row\
	table Interface row "br0" (c2bb9a3a):\
		delete row\
	table Open_vSwitch row 04b76611 (04b76611):\
	table Bridge row "br0" (234de2f6):\
		delete row\
\
record 6: 2012-06-28 20:49:30\
	table Open_vSwitch row 04b76611 (04b76611):\
\
record 7: 2012-06-28 20:49:39 "ovs-vsctl: ovs-vsctl add-br br0"\
	table Port insert row "br0" (755493f6):\
	table Interface insert row "br0" (53ad0901):\
	table Open_vSwitch row 04b76611 (04b76611):\
	table Bridge insert row "br0" (3d911180):\
\
record 8: 2012-06-28 20:49:39\
	table Open_vSwitch row 04b76611 (04b76611):\
\
record 9: 2012-06-28 20:56:32 "ovs-vsctl: ovs-vsctl add-br br4"\
	table Port insert row "br4" (a202cc82):\
	table Interface insert row "br4" (41781817):\
	table Open_vSwitch row 04b76611 (04b76611):\
	table Bridge insert row "br4" (b510d622):\
\
record 10: 2012-06-28 20:56:32\
	table Open_vSwitch row 04b76611 (04b76611):\
\
record 11: 2012-06-28 22:19:10 "ovs-vsctl: ovs-vsctl --no-wait --timeout=5 set Open_vSwitch . ovs-version=1.7.90 "external-ids:system-id=\\"fbe12962-bb7f-44fa-bd2e-d752107edd6d\\"" "system-type=\\"Debian\\"" "system-version=\\"6.0.4-squeeze\\"""\
	table Open_vSwitch row 04b76611 (04b76611):\
\
record 12: 2012-06-28 22:19:40 "ovs-vsctl: ovs-vsctl add-br br1"\
	table Port insert row "br1" (f629c8f5):\
	table Interface insert row "br1" (c0391433):\
	table Open_vSwitch row 04b76611 (04b76611):\
	table Bridge insert row "br1" (96e6d30b):\
\
record 13: 2012-06-28 22:19:40\
	table Open_vSwitch row 04b76611 (04b76611):\
\
record 14: 2012-07-02 08:17:50 "ovs-vsctl: utilities/ovs-vsctl add-br br2"\
	table Port insert row "br2" (97e22a9d):\
	table Interface insert row "br2" (0a5586b0):\
	table Open_vSwitch row 04b76611 (04b76611):\
	table Bridge insert row "br2" (b608d3ad):\
\
record 15: 2012-07-02 08:17:50\
	table Open_vSwitch row 04b76611 (04b76611):\
\
record 16:
\f1\b\fs36  2012-07-02 08:28:06
\f0\b0  
\fs28 "ovs-vsctl: utilities/ovs-vsctl add-br br5"\
	table Port insert row "br5" (4c579cb1):\
	table Interface insert row "br5" (5fef1f86):\
	table Open_vSwitch row 04b76611 (04b76611):\
	table Bridge insert row "br5" (b1a441bb):\
\
record 17: 
\f1\b\fs36 2012-07-02 08:28:06
\f0\b0\fs28 \
	table Open_vSwitch row 04b76611 (04b76611):\
}
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to