def test_tcps(self): address = ('127.0.0.1', 5515) keyfile = NamedTemporaryFile(delete=False) keyfile.write(key_data) keyfile.close() certfile = NamedTemporaryFile(delete=False) certfile.write(cert_data) certfile.close() serv = SyslogServer(address, Handler, keyfile=keyfile.name, certfile=certfile.name) serv.entry = None thr = threading.Thread( target=syslog_server_thread, args=(serv,)) thr.start() tm = TCPSyslogEmitter(address, octet_based_framing=True, keyfile=None) y = create_test_entry('TCPS') tm.emit(y) tm.close() thr.join() serv.socket.close() os.unlink(keyfile.name) os.unlink(certfile.name) self.assertEqual(serv.entry.msg, "An application event log entry through TCPS...")
def test_tcps(self): address = ('127.0.0.1', 5515) keyfile = NamedTemporaryFile(delete=False) keyfile.write(key_data) keyfile.close() certfile = NamedTemporaryFile(delete=False) certfile.write(cert_data) certfile.close() serv = SyslogServer(address, Handler, keyfile=keyfile.name, certfile=certfile.name) serv.entry = None thr = threading.Thread(target=syslog_server_thread, args=(serv, )) thr.start() tm = TCPSyslogEmitter(address, octet_based_framing=True, keyfile=None) y = create_test_entry('TCPS') tm.emit(y) tm.close() thr.join() serv.socket.close() os.unlink(keyfile.name) os.unlink(certfile.name) self.assertEqual(serv.entry.msg, "An application event log entry through TCPS...")
def test_tcp(self): address = ('127.0.0.1', 5514) serv = SyslogServer(address, Handler) serv.entry = None thr = threading.Thread(target=syslog_server_thread, args=(serv, )) thr.start() tm = TCPSyslogEmitter(address, octet_based_framing=False) y = create_test_entry('TCP') tm.emit(y) tm.close() thr.join() serv.socket.close() self.assertEqual(serv.entry.msg, "An application event log entry through TCP...")
def test_tcp(self): address = ('127.0.0.1', 5514) serv = SyslogServer(address, Handler) serv.entry = None thr = threading.Thread( target=syslog_server_thread, args=(serv,)) thr.start() tm = TCPSyslogEmitter(address, octet_based_framing=False) y = create_test_entry('TCP') tm.emit(y) tm.close() thr.join() serv.socket.close() self.assertEqual(serv.entry.msg, "An application event log entry through TCP...")