|
Boost-Commit : |
From: grafikrobot_at_[hidden]
Date: 2007-08-19 02:05:28
Author: grafik
Date: 2007-08-19 02:05:26 EDT (Sun, 19 Aug 2007)
New Revision: 38756
URL: http://svn.boost.org/trac/boost/changeset/38756
Log:
Add support for posting to Dart server using the specified http proxy.
Text files modified:
trunk/tools/regression/xsl_reports/runner/collect_and_upload_logs.py | 30 ++++++++++++++++++++++++++++--
trunk/tools/regression/xsl_reports/runner/regression.py | 4 +++-
2 files changed, 31 insertions(+), 3 deletions(-)
Modified: trunk/tools/regression/xsl_reports/runner/collect_and_upload_logs.py
==============================================================================
--- trunk/tools/regression/xsl_reports/runner/collect_and_upload_logs.py (original)
+++ trunk/tools/regression/xsl_reports/runner/collect_and_upload_logs.py 2007-08-19 02:05:26 EDT (Sun, 19 Aug 2007)
@@ -12,6 +12,7 @@
import stat
import xml.dom.minidom
import xmlrpclib
+import httplib
import os.path
import string
@@ -70,12 +71,24 @@
ascii_only_table += '?'
else:
ascii_only_table += chr(i)
+
+class xmlrpcProxyTransport(xmlrpclib.Transport):
+ def __init__(self, proxy):
+ self.proxy = proxy
+ def make_connection(self, host):
+ self.realhost = host
+ return httplib.HTTP(self.proxy)
+ def send_request(self, connection, handler, request_body):
+ connection.putrequest('POST','http://%s%s' % (self.realhost,handler))
+ def send_host(self, connection, host):
+ connection.putheader('Host',self.realhost)
def publish_test_logs(
input_dirs,
runner_id, tag, platform, comment_file, timestamp, user, source, run_type,
dart_server = None,
+ http_proxy = None,
**unused
):
__log__ = 1
@@ -150,8 +163,12 @@
os.path.walk( input_dir, _publish_test_log_files_, None )
if dart_server:
try:
+ rpc_transport = None
+ if http_proxy:
+ rpc_transport = xmlrpcProxyTransport(http_proxy)
dart_rpc = xmlrpclib.ServerProxy(
- 'http://%s/%s/Command/' % (dart_server,dart_project[tag]) )
+ 'http://%s/%s/Command/' % (dart_server,dart_project[tag]),
+ rpc_transport )
for dom in dart_dom.values():
#~ utils.log('Dart XML: %s' % dom.toxml('utf-8'))
dart_rpc.Submit.put(xmlrpclib.Binary(dom.toxml('utf-8')))
@@ -250,6 +267,7 @@
, source
, run_type
, dart_server = None
+ , http_proxy = None
, **unused
):
@@ -258,7 +276,8 @@
if dart_server:
publish_test_logs( [ results_dir ],
runner_id, tag, platform, comment_file, timestamp, user, source, run_type,
- dart_server = dart_server )
+ dart_server = dart_server,
+ http_proxy = http_proxy )
results_file = os.path.join( results_dir, '%s.xml' % runner_id )
results_writer = open( results_file, 'w' )
@@ -332,6 +351,7 @@
, debug_level = 0
, send_bjam_log = False
, dart_server = None
+ , http_proxy = None
, **unused
):
@@ -346,6 +366,7 @@
, source
, run_type
, dart_server = dart_server
+ , http_proxy = http_proxy
)
upload_logs(
@@ -373,6 +394,7 @@
, 'run-type='
, 'user='
, 'ftp-proxy='
+ , 'proxy='
, 'debug-level='
, 'send-bjam-log'
, 'help'
@@ -388,6 +410,7 @@
, '--source' : 'SVN'
, '--run-type' : 'full'
, '--ftp-proxy' : None
+ , '--proxy' : None
, '--debug-level' : 0
, '--dart-server' : 'beta.boost.org:8081'
@@ -406,6 +429,7 @@
, 'source' : options[ '--source' ]
, 'run_type' : options[ '--run-type' ]
, 'ftp_proxy' : options[ '--ftp-proxy' ]
+ , 'http_proxy' : options[ '--proxy' ]
, 'debug_level' : int(options[ '--debug-level' ])
, 'send_bjam_log' : options.has_key( '--send-bjam-log' )
, 'dart_server' : options[ '--dart-server' ]
@@ -438,6 +462,8 @@
\t--run-type "incremental" or "full" ("full" by default)
\t--send-bjam-log in addition to regular XML results, send in full bjam
\t log of the regression run
+\t--proxy HTTP proxy server address and port (e.g.
+\t 'http://www.someproxy.com:3128', optional)
\t--ftp-proxy FTP proxy server (e.g. 'ftpproxy', optional)
\t--debug-level debugging level; controls the amount of debugging
\t output printed; 0 by default (no debug output)
Modified: trunk/tools/regression/xsl_reports/runner/regression.py
==============================================================================
--- trunk/tools/regression/xsl_reports/runner/regression.py (original)
+++ trunk/tools/regression/xsl_reports/runner/regression.py 2007-08-19 02:05:26 EDT (Sun, 19 Aug 2007)
@@ -629,6 +629,7 @@
, comment
, incremental
, dart_server
+ , http_proxy
, args
, **unused
):
@@ -665,6 +666,7 @@
, source
, run_type
, dart_server
+ , http_proxy
)
@@ -815,7 +817,7 @@
# told to have no toolsets in command line "--toolset="
if toolsets != '': # --toolset=,
test( toolsets, bjam_options, monitored, timeout, v2, [] )
- collect_logs( tag, runner, platform, user, comment, incremental, dart_server, [] )
+ collect_logs( tag, runner, platform, user, comment, incremental, dart_server, proxy, [] )
upload_logs( tag, runner, user, ftp_proxy, debug_level, send_bjam_log, dart_server )
if book:
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk