summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-02-04 20:45:22 +0000
committerGerrit Code Review <review@openstack.org>2019-02-04 20:45:22 +0000
commit172dae4c5cad070196f1375b3fa8f3518f1fd4f0 (patch)
tree31391fd24a9333e6fd08060d2f9d5ac045345b9f
parent7fc7fdc9c82c5ef7163ea92b8b0336b1c498a415 (diff)
parentb3b4ab678be82583d67d187424ea68a70fbfaa56 (diff)
Merge "Properly log requests in SimpleHTTPRequestHandler"
-rw-r--r--tests/base.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/base.py b/tests/base.py
index a8803c7..59175f0 100644
--- a/tests/base.py
+++ b/tests/base.py
@@ -561,6 +561,9 @@ class GerritWebServer(object):
561 self.send_response(200) 561 self.send_response(200)
562 self.end_headers() 562 self.end_headers()
563 563
564 def log_message(self, fmt, *args):
565 self.log.debug(fmt, *args)
566
564 self.httpd = socketserver.ThreadingTCPServer(('', 0), Server) 567 self.httpd = socketserver.ThreadingTCPServer(('', 0), Server)
565 self.port = self.httpd.socket.getsockname()[1] 568 self.port = self.httpd.socket.getsockname()[1]
566 self.thread = threading.Thread(name='GerritWebServer', 569 self.thread = threading.Thread(name='GerritWebServer',
@@ -2064,6 +2067,8 @@ class WebProxyFixture(fixtures.Fixture):
2064 rules = self.rules 2067 rules = self.rules
2065 2068
2066 class Proxy(http.server.SimpleHTTPRequestHandler): 2069 class Proxy(http.server.SimpleHTTPRequestHandler):
2070 log = logging.getLogger('zuul.WebProxyFixture.Proxy')
2071
2067 def do_GET(self): 2072 def do_GET(self):
2068 path = self.path 2073 path = self.path
2069 for (pattern, replace) in rules: 2074 for (pattern, replace) in rules:
@@ -2078,6 +2083,9 @@ class WebProxyFixture(fixtures.Fixture):
2078 self.end_headers() 2083 self.end_headers()
2079 self.wfile.write(resp.content) 2084 self.wfile.write(resp.content)
2080 2085
2086 def log_message(self, fmt, *args):
2087 self.log.debug(fmt, *args)
2088
2081 self.httpd = socketserver.ThreadingTCPServer(('', 0), Proxy) 2089 self.httpd = socketserver.ThreadingTCPServer(('', 0), Proxy)
2082 self.port = self.httpd.socket.getsockname()[1] 2090 self.port = self.httpd.socket.getsockname()[1]
2083 self.thread = threading.Thread(target=self.httpd.serve_forever) 2091 self.thread = threading.Thread(target=self.httpd.serve_forever)