ChannelShell shell = s.createShellChannel();
ByteArrayOutputStream out = new ByteArrayOutputStream();
ByteArrayOutputStream err = new ByteArrayOutputStream();
shell.setOut(out);
shell.setErr(err);
shell.open().await();
int res = s.waitFor(ClientSession.CLOSED, 5000);
assertEquals("Session should be closed", ClientSession.CLOSED | ClientSession.AUTHED, res);
assertTrue(latch.await(1, TimeUnit.SECONDS));
assertTrue(TestEchoShellFactory.TestEchoShell.latch.await(1, TimeUnit.SECONDS));
}