All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][XM-TEST] Repost - Allow reporting results to a different results repository
@ 2006-03-16 17:45 Paul Larson
  2006-03-21  0:19 ` Ewan Mellor
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Larson @ 2006-03-16 17:45 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 274 bytes --]

Add an option to xmtest to report results to an alternative results 
repository.  The default is preserved but can be overridden by either passing 
it with -r to runtest.sh or by setting the xmtest_repo environment variable.

Signed-off-by: Paul Larson <pl@us.ibm.com>

[-- Attachment #1.1.2: alt-xmtest-repo.patch --]
[-- Type: text/x-diff, Size: 4092 bytes --]

# HG changeset patch
# User pl@us.ibm.com
# Node ID 9abed75ccaf94ad84cb2e968b941e61e1efe3661
# Parent  c445d4a0dd76b4859d058368ffab7c65f732acab
Add an option to xmtest to report results to an alternative results repository.
The default is preserved but can be overridden by either passing it with -r to runtest.sh or by setting the xmtest_repo environment variable.

Signed-off-by: Paul Larson <pl@us.ibm.com>

diff -r c445d4a0dd76 -r 9abed75ccaf9 tools/xm-test/lib/XmTestReport/Report.py
--- a/tools/xm-test/lib/XmTestReport/Report.py	Tue Mar 14 18:33:45 2006
+++ b/tools/xm-test/lib/XmTestReport/Report.py	Tue Mar 14 20:51:08 2006
@@ -32,11 +32,7 @@
 import httplib
 import urllib
 import re
-
-#REPORT_HOST = "xmtest-dev.dague.org"
-REPORT_HOST = "xmtest.dague.org"
-REPORT_URL  = "/cgi-bin/report-results";
-VIEW_URL = "cgi-bin/display?view=single&testid="
+from urlparse import urlparse
 
 class XmTestReport:
 
@@ -88,8 +84,11 @@
 
     return 'multipart/form-data; boundary=%s' % boundary, textBody
 
-def postResults(results):
-    conn = httplib.HTTPConnection(REPORT_HOST)
+def postResults(report_server, results):
+    if not re.match('http://', report_server):
+	report_server = 'http://'+report_server
+    (report_host,report_url) = urlparse(report_server)[1:3]
+    conn = httplib.HTTPConnection(report_host)
 
     type, body = encodeForm({"log" : results})
 
@@ -100,22 +99,17 @@
     # print "%s\n" % type
     # print headers
     
-    conn.request("POST", REPORT_URL, body, headers)
+    conn.request("POST", report_url, body, headers)
     
     resp = conn.getresponse()
     data = resp.read()
 
     if resp.status == 200:
         print >>sys.stderr, "Your results have been submitted successfully!"
-        match = re.match("^id=([0-9]+)$", data.split("\n")[1])
-        if match:
-            id = match.group(1)
-            print >>sys.stderr, "See your report at:"
-            print >>sys.stderr, "http://%s/%s%s" % (REPORT_HOST, VIEW_URL, id)
     else:
         print >>sys.stderr, "Unable to submit results:"
-        print >>sys.stderr, "[http://%s%s] said %i: %s" % (REPORT_HOST,
-                                                           REPORT_URL,
+        print >>sys.stderr, "[http://%s%s] said %i: %s" % (report_host,
+                                                           report_url,
                                                            resp.status,
                                                            resp.reason)
         print >>sys.stderr, data
@@ -133,7 +127,9 @@
     dump = False
     files = []
 
-    for a in sys.argv[1:]:
+    report_server = sys.argv[1]
+
+    for a in sys.argv[2:]:
         if a == "-d":
             submit = False
             dump = True
@@ -156,5 +152,5 @@
         print xmlout
 
     if submit:
-        postResults(xmlout)
+        postResults(report_server, xmlout)
     
diff -r c445d4a0dd76 -r 9abed75ccaf9 tools/xm-test/runtest.sh
--- a/tools/xm-test/runtest.sh	Tue Mar 14 18:33:45 2006
+++ b/tools/xm-test/runtest.sh	Tue Mar 14 20:51:08 2006
@@ -13,6 +13,7 @@
     echo "  -b          : do not ask any questions (batch mode)"
     echo "  -g          : run a group test set"
     echo "  -e <email>  : set email address for report"
+    echo "  -r <url>    : url of test results repository to use"
     echo "  -s <report> : just submit report <report>"
     echo "  -h | --help : show this help"
 }
@@ -22,7 +23,7 @@
 
     reportfile=$1
 
-    ./lib/XmTestReport/Report.py $reportfile
+    ./lib/XmTestReport/Report.py $reportserver $reportfile
 }
 
 # Generate XML result report from output file
@@ -189,6 +190,7 @@
 # Defaults
 MAXFAIL=10
 report=yes
+reportserver=${xmtest_repo:-'http://xmtest.dague.org/cgi-bin/report-results'}
 batch=no
 run=yes
 GROUPENTERED=default
@@ -217,6 +219,10 @@
              echo "No file for group $GROUPENTERED"
              exit 1
           fi
+	  ;;
+      -r)
+	  shift
+	  reportserver=$1
 	  ;;
       -s)
 	  run=no

[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][XM-TEST] Repost - Allow reporting results to a different results repository
  2006-03-16 17:45 [PATCH][XM-TEST] Repost - Allow reporting results to a different results repository Paul Larson
@ 2006-03-21  0:19 ` Ewan Mellor
  0 siblings, 0 replies; 2+ messages in thread
From: Ewan Mellor @ 2006-03-21  0:19 UTC (permalink / raw)
  To: Paul Larson; +Cc: xen-devel

On Thu, Mar 16, 2006 at 11:45:02AM -0600, Paul Larson wrote:

> Add an option to xmtest to report results to an alternative results 
> repository.  The default is preserved but can be overridden by either passing 
> it with -r to runtest.sh or by setting the xmtest_repo environment variable.
> 
> Signed-off-by: Paul Larson <pl@us.ibm.com>

Applied, thank you.

Ewan.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-03-21  0:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-16 17:45 [PATCH][XM-TEST] Repost - Allow reporting results to a different results repository Paul Larson
2006-03-21  0:19 ` Ewan Mellor

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.