blob: 231ee84740ed154b0486bd22af3766cf7330961c [file] [log] [blame]
#!/usr/bin/env python
# Copyright 2010 Google Inc. All Rights Reserved.
"""Script for test playback.
1. OpenSSL library -
2. Python interface to the OpenSSL library -
Example usage:
python -t <test_dir>
from optparse import OptionParser
import playback_driver
import proxy_handler
def Run(options):
driver = playback_driver.PlaybackRequestHandler(options.test_dir)
httpd = proxy_handler.CreateServer(driver, options.port)
sa = httpd.socket.getsockname()
print "Serving HTTP on", sa[0], "port", sa[1], "..."
if __name__ == '__main__':
parser = OptionParser()
parser.add_option("-t", "--test-dir", dest="test_dir",
help="directory containing recorded test data")
parser.add_option("-p", "--port", dest="port", type="int", default=8000)
options = parser.parse_args()[0]
if not options.test_dir:
raise Exception('please specify test directory')