#NEWLINE# @ classmethod #NEWLINE# def setUpClass( cls ) : #NEWLINE# #INDENT# program = cls . _get_exe ( ) #NEWLINE# cls . directory = tempfile . mkdtemp ( prefix = 'python-etcd' ) #NEWLINE# cls . ca_cert_path = os . path . join ( cls . directory , 'ca.crt' ) #NEWLINE# ca_key_path = os . path . join ( cls . directory , 'ca.key' ) #NEWLINE# server_cert_path = os . path . join ( cls . directory , 'server.crt' ) #NEWLINE# server_key_path = os . path . join ( cls . directory , 'server.key' ) #NEWLINE# cls . client_cert_path = os . path . join ( cls . directory , 'client.crt' ) #NEWLINE# cls . client_key_path = os . path . join ( cls . directory , 'client.key' ) #NEWLINE# cls . client_all_cert = os . path . join ( cls . directory , 'client-all.crt' ) #NEWLINE# ( ca , ca_key ) = helpers . TestingCA . create_test_ca_certificate ( cls . ca_cert_path , ca_key_path ) #NEWLINE# helpers . TestingCA . create_test_certificate ( ca , ca_key , server_cert_path , server_key_path , '127.0.0.1' ) #NEWLINE# helpers . TestingCA . create_test_certificate ( ca , ca_key , cls . client_cert_path , cls . client_key_path ) #NEWLINE# cls . processHelper = helpers . EtcdProcessHelper ( cls . directory , proc_name = program , port_range_start = 6001 , internal_port_range_start = 8001 , tls = True ) #NEWLINE# with open ( cls . client_all_cert , 'w' ) as f : #NEWLINE# #INDENT# with open ( cls . client_key_path , 'r' ) as g : #NEWLINE# #INDENT# f . write ( g . read ( ) ) #NEWLINE# #UNINDENT# with open ( cls . client_cert_path , 'r' ) as g : #NEWLINE# #INDENT# f . write ( g . read ( ) ) #NEWLINE# #UNINDENT# #UNINDENT# cls . processHelper . run ( number = 3 , proc_args = [ ( '-cert-file=%s' % server_cert_path ) , ( '-key-file=%s' % server_cert_path ) , ( '-ca-file=%s' % cls . ca_cert_path ) ] )