def start_server(cls): """Start an SSH server for the tests to use""" # Pass loop explicitly to get coverage on non-default event loops return (yield from asyncssh.listen( port=0, loop=cls.loop, server_host_keys=['skey'], authorized_client_keys='authorized_keys', sftp_factory=True))
def start_server(): yield from asyncssh.listen( "", 8022, server_host_keys=["ssh_host_key"], authorized_client_keys="ssh_user_ca", session_factory=handle_connection, )
def start_server(cls): """Start an SSH server for the tests to use""" # Pass loop explicitly to get coverage on non-default event loops return (yield from asyncssh.listen(port=0, loop=cls.loop, server_host_keys=['skey'], authorized_client_keys='authorized_keys', sftp_factory=True))
def listen(cls, *, loop=(), server_factory=(), options=None, **kwargs): """Create an SSH server for the tests to use""" if loop == (): loop = cls.loop if server_factory == (): server_factory = Server options = asyncssh.SSHServerConnectionOptions( options=options, server_factory=server_factory, gss_host=None, server_host_keys=['skey']) return (yield from asyncssh.listen(port=0, loop=loop, family=socket.AF_INET, options=options, **kwargs))
def test_duplicate_type_server_host_keys(self): """Test starting a server with duplicate host key types""" with self.assertRaises(ValueError): yield from asyncssh.listen(server_host_keys=['skey', 'skey'])
def test_no_server_host_keys(self): """Test starting a server with no host keys""" with self.assertRaises(ValueError): yield from asyncssh.listen(server_host_keys=[], gss_host=None)
def start_server(): yield from asyncssh.listen('', 8022, server_host_keys=['ssh_host_key'], authorized_client_keys='ssh_user_ca', sftp_factory=True)
def start_server(): yield from asyncssh.listen('', 8022, server_host_keys=['ssh_host_key'], authorized_client_keys='ssh_user_ca', session_factory=handle_connection)
def test_no_server_host_keys(self): """Test starting a server with no host keys""" with self.assertRaises(ValueError): yield from asyncssh.listen(server_host_keys=[])
def start_server(cls): """Start an SSH server for the tests to use""" return (yield from asyncssh.listen( '', 0, loop=cls.loop, server_host_keys=['skey'], authorized_client_keys='authorized_keys', sftp_factory=True))