ia64/xen-unstable
changeset 8345:89e0dfa3a089
Grab the test ID from the report submission response and provide a link
to the user's test report
Signed-off-by: Dan Smith <danms@us.ibm.com>
to the user's test report
Signed-off-by: Dan Smith <danms@us.ibm.com>
author | danms@us.ibm.com |
---|---|
date | Tue Dec 13 18:00:50 2005 +0000 (2005-12-13) |
parents | 116b7c0a8534 |
children | 62d9ac63e7f5 |
files | tools/xm-test/lib/XmTestReport/Report.py |
line diff
1.1 --- a/tools/xm-test/lib/XmTestReport/Report.py Tue Dec 13 16:26:33 2005 +0000 1.2 +++ b/tools/xm-test/lib/XmTestReport/Report.py Tue Dec 13 18:00:50 2005 +0000 1.3 @@ -31,10 +31,12 @@ import os 1.4 import xml.dom.minidom 1.5 import httplib 1.6 import urllib 1.7 +import re 1.8 1.9 #REPORT_HOST = "xmtest-dev.dague.org" 1.10 REPORT_HOST = "xmtest.dague.org" 1.11 REPORT_URL = "/cgi-bin/report-results"; 1.12 +VIEW_URL = "cgi-bin/display?view=single&testid=" 1.13 1.14 class XmTestReport: 1.15 1.16 @@ -101,16 +103,21 @@ def postResults(results): 1.17 conn.request("POST", REPORT_URL, body, headers) 1.18 1.19 resp = conn.getresponse() 1.20 + data = resp.read() 1.21 + 1.22 if resp.status == 200: 1.23 print >>sys.stderr, "Your results have been submitted successfully!" 1.24 + match = re.match("^id=([0-9]+)$", data.split("\n")[1]) 1.25 + if match: 1.26 + id = match.group(1) 1.27 + print >>sys.stderr, "See your report at:" 1.28 + print >>sys.stderr, "http://%s/%s%s" % (REPORT_HOST, VIEW_URL, id) 1.29 else: 1.30 print >>sys.stderr, "Unable to submit results:" 1.31 print >>sys.stderr, "[http://%s%s] said %i: %s" % (REPORT_HOST, 1.32 REPORT_URL, 1.33 resp.status, 1.34 resp.reason) 1.35 - 1.36 - data = resp.read() 1.37 print >>sys.stderr, data 1.38 1.39 if __name__ == "__main__":