<s> from subprocess import Popen <EOL> from test_common import * <EOL> import socket , ssl , time , os , signal <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> ghostunnel = None <EOL> try : <EOL> root = RootCert ( '<STR_LIT:root>' ) <EOL> root . create_signed_cert ( '<STR_LIT>' ) <EOL> ghostunnel = run_ghostunnel ( [ '<STR_LIT>' , '<STR_LIT>' . format ( LOCALHOST ) , <EOL> '<STR_LIT>' . format ( LOCALHOST ) , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' . format ( LOCALHOST , STATUS_PORT ) , <EOL> '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> for i in range ( <NUM_LIT:0> , <NUM_LIT:10> ) : <EOL> try : <EOL> ghostunnel . wait ( timeout = <NUM_LIT:1> ) <EOL> except : <EOL> pass <EOL> if ghostunnel . returncode != None : <EOL> if ghostunnel . returncode == <NUM_LIT:0> : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> else : <EOL> print_ok ( "<STR_LIT>" ) <EOL> break <EOL> time . sleep ( <NUM_LIT:1> ) <EOL> print_ok ( "<STR_LIT:OK>" ) <EOL> finally : <EOL> terminate ( ghostunnel ) </s>
