summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/channel.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/channel.rs b/tests/channel.rs
index e4e0f16..2ade997 100644
--- a/tests/channel.rs
+++ b/tests/channel.rs
@@ -10,9 +10,23 @@ fn smoke() {
channel.exec("true").unwrap();
channel.wait_eof().unwrap();
assert!(channel.eof());
+ channel.close().unwrap();
+ channel.wait_close().unwrap();
assert_eq!(channel.exit_status().unwrap(), 0);
+ assert!(channel.eof());
+}
+
+#[test]
+fn bad_smoke() {
+ let (_tcp, sess) = ::authed_session();
+ let mut channel = sess.channel_session().unwrap();
+ channel.flush().unwrap();
+ channel.exec("false").unwrap();
+ channel.wait_eof().unwrap();
+ assert!(channel.eof());
channel.close().unwrap();
channel.wait_close().unwrap();
+ assert_eq!(channel.exit_status().unwrap(), 1);
assert!(channel.eof());
}