Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1450

Show
Ignore:
Timestamp:
11/27/06 14:21:28
Author:
fumanchu
Message:

Added an '-ssl' arg to test_states to help fix #606 (Problem timing out the persistent connection when SSL is enabled).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/test/test.py

    r1403 r1450  
    1313import getopt 
    1414import httplib 
    15 import os, os.path 
     15import os 
    1616localDir = os.path.dirname(__file__) 
    1717serverpem = os.path.join(os.getcwd(), localDir, 'test.pem') 
  • trunk/cherrypy/test/test_states.py

    r1449 r1450  
     1import httplib 
    12import os 
    23import sys 
     
    294295 
    295296 
    296 def run_all(host, port): 
     297def run_all(host, port, ssl=False): 
    297298    conf = {'server.socket_host': host, 
    298299            'server.socket_port': port, 
     
    300301            'environment': "test_suite", 
    301302            } 
     303     
     304    if ssl: 
     305        localDir = os.path.dirname(__file__) 
     306        serverpem = os.path.join(os.getcwd(), localDir, 'test.pem') 
     307        conf['server.ssl_certificate'] = serverpem 
     308        conf['server.ssl_private_key'] = serverpem 
     309        ServerStateTests.scheme == "https" 
     310        ServerStateTests.HTTP_CONN = httplib.HTTPSConnection 
     311     
    302312    def _run(server): 
    303313        print 
     
    325335    host = '127.0.0.1' 
    326336    port = 8000 
     337    ssl = False 
    327338    if len(sys.argv) > 1: 
    328339        cmd = sys.argv[1] 
     
    330341                   for prefix in ("", "-", "--", "\\")]: 
    331342            print 
    332             print "test_states.py -?             -> this help page" 
    333             print "test_states.py [host] [port]  -> run the tests on the given host/port" 
    334             print "test_states.py -localhosts [port]  -> try various localhost strings" 
     343            print "test_states.py -?                 -> this help page" 
     344            print "test_states.py [host] [port]      -> run the tests on the given host/port" 
     345            print "test_states.py -ssl [port]        -> run the tests using SSL on %s:port" % host 
     346            print "test_states.py -localhosts [port] -> try various localhost strings" 
    335347            sys.exit(0) 
    336348        if len(sys.argv) > 2: 
     
    339351            run_localhosts(port) 
    340352            sys.exit(0) 
    341         host = sys.argv[1].strip("\"'") 
    342     run_all(host, port) 
     353        if cmd == "-ssl": 
     354            ssl = True 
     355        else: 
     356            host = cmd.strip("\"'") 
     357    run_all(host, port, ssl) 

Hosted by WebFaction

Log in as guest/cpguest to create tickets