<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> root1 = RootCert ( '<STR_LIT>' ) <EOL> root1 . create_signed_cert ( '<STR_LIT>' ) <EOL> root1 . 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>' . format ( LOCALHOST , STATUS_PORT ) ] ) <EOL> pair1 = SocketPair ( TcpClient ( <NUM_LIT> ) , TlsServer ( '<STR_LIT>' , '<STR_LIT>' , <NUM_LIT> ) ) <EOL> pair1 . validate_can_send_from_client ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> pair1 . validate_client_cert ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> TlsClient ( None , '<STR_LIT>' , STATUS_PORT ) . connect ( <NUM_LIT:20> , '<STR_LIT>' ) <EOL> print_ok ( "<STR_LIT>" ) <EOL> open ( '<STR_LIT>' , '<STR_LIT:a>' ) . close ( ) <EOL> os . rename ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> ghostunnel . send_signal ( signal . SIGUSR1 ) <EOL> TlsClient ( None , '<STR_LIT>' , STATUS_PORT ) . connect ( <NUM_LIT:20> , '<STR_LIT>' ) <EOL> print_ok ( "<STR_LIT>" ) <EOL> pair2 = SocketPair ( TcpClient ( <NUM_LIT> ) , TlsServer ( '<STR_LIT>' , '<STR_LIT>' , <NUM_LIT> ) ) <EOL> pair2 . validate_can_send_from_client ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> pair2 . validate_client_cert ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> pair2 . cleanup ( ) <EOL> pair1 . validate_can_send_from_client ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> pair1 . cleanup ( ) <EOL> print_ok ( "<STR_LIT:OK>" ) <EOL> finally : <EOL> terminate ( ghostunnel ) </s>
