summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-09-05 03:14:44 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-09-05 03:14:44 +0200
commit474c98fe263455f97f764195d44fb7b7406748b0 (patch)
treea2fd7a3ad6e081c0f4dc4a2e81c74a03ba95c019
parentef9657017cf082bd49ed81f3df85a0fb1786f715 (diff)
downloadsamba-474c98fe263455f97f764195d44fb7b7406748b0.tar.gz
samba-474c98fe263455f97f764195d44fb7b7406748b0.tar.bz2
samba-474c98fe263455f97f764195d44fb7b7406748b0.zip
selftest/subunit: Parse timestamps generated by upstream subunit.
-rw-r--r--selftest/subunithelper.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/selftest/subunithelper.py b/selftest/subunithelper.py
index 06e1fc2edc..f5e07a1d9a 100644
--- a/selftest/subunithelper.py
+++ b/selftest/subunithelper.py
@@ -45,8 +45,14 @@ def parse_results(msg_ops, statistics, fh):
elif command == "time":
msg_ops.control_msg(l)
grp = re.match(
- "(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)\n", arg)
- msg_ops.report_time(time.mktime((int(grp.group(1)), int(grp.group(2)), int(grp.group(3)), int(grp.group(4)), int(grp.group(5)), int(grp.group(6)), 0, 0, 0)))
+ '(\d+)-(\d+)-(\d+) (\d+):(\d+):([.0-9]+)\n', arg)
+ if grp is None:
+ grp = re.match(
+ '(\d+)-(\d+)-(\d+) (\d+):(\d+):([.0-9]+)Z\n', arg)
+ if grp is None:
+ print "Unable to parse time line: %s" % arg
+ if grp is not None:
+ msg_ops.report_time(time.mktime((int(grp.group(1)), int(grp.group(2)), int(grp.group(3)), int(grp.group(4)), int(grp.group(5)), int(float(grp.group(6))), 0, 0, 0)))
elif command in VALID_RESULTS:
msg_ops.control_msg(l)
result = command