This commit is contained in:
Eugene Pankov 2022-09-02 12:25:54 +02:00
parent eaed2d2b48
commit f106d2922b
No known key found for this signature in database
GPG key ID: 5896FCBBDD1CF4F4
4 changed files with 6 additions and 7 deletions

2
russh

@ -1 +1 @@
Subproject commit 958f33a374c79735f7d42b9284553f68e6f62d00
Subproject commit 811680a3bf04c563fd1a4cfa39b05224d08e85c0

View file

@ -24,7 +24,7 @@ class Test:
proc.wait(timeout=timeout)
assert proc.returncode == 0
def test_fail_no_connection(self, processes):
def test_fail_no_connection(self, processes, timeout):
proc, _ = processes.start_wg(
config=dedent(
'''\

View file

@ -7,7 +7,7 @@ from .util import wait_port
class Test:
def test(
self, processes: ProcessManager, wg_c_ed25519_pubkey: Path, password_123_hash
self, processes: ProcessManager, wg_c_ed25519_pubkey: Path, password_123_hash, timeout
):
ssh_port = processes.start_ssh_server(
trusted_keys=[wg_c_ed25519_pubkey.read_text()]
@ -48,7 +48,7 @@ class Test:
'/bin/sh',
password='123',
)
assert ssh_client.communicate(timeout=30)[0] == b'/bin/sh\n'
assert ssh_client.communicate(timeout=timeout)[0] == b'/bin/sh\n'
assert ssh_client.returncode == 0
ssh_client = processes.start_ssh_client(
@ -63,5 +63,5 @@ class Test:
'/bin/sh',
password='321',
)
ssh_client.communicate(timeout=30)
ssh_client.communicate(timeout=timeout)
assert ssh_client.returncode != 0

View file

@ -1400,8 +1400,7 @@ impl ServerSession {
async fn _channel_eof(&mut self, server_channel_id: ServerChannelId) -> Result<()> {
let channel_id = self.map_channel(&server_channel_id)?;
debug!(channel=%channel_id, "EOF");
self.send_command_and_wait(RCCommand::Channel(channel_id, ChannelOperation::Eof))
.await?;
let _ = self.send_command(RCCommand::Channel(channel_id, ChannelOperation::Eof));
Ok(())
}