summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtyom V. Poptsov <poptsov.artyom@gmail.com>2017-01-01 10:22:10 +0300
committerArtyom V. Poptsov <poptsov.artyom@gmail.com>2017-01-01 10:22:10 +0300
commit33d24a3a252e06663f655c0b7a23fd29ac64aee5 (patch)
tree03ee61a7c717915c80eb39f9a7011297f4657c4d
parentnode.scm (rrepl-skip-to-prompt): Use 'when' (diff)
downloadguile-ssh-33d24a3a252e06663f655c0b7a23fd29ac64aee5.tar.gz
tests/shell.scm ("which"): New TC
* tests/shell.scm ("which"): New TC. * tests/common.scm (start-server/exec): Echo the received command back by default.
-rw-r--r--tests/common.scm5
-rw-r--r--tests/shell.scm11
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/common.scm b/tests/common.scm
index c32ecd6..014997f 100644
--- a/tests/common.scm
+++ b/tests/common.scm
@@ -268,6 +268,11 @@ disconnected when the PROC is finished."
(write-line "pong" channel)
(message-reply-success msg)
(channel-request-send-exit-status channel 0)
+ (channel-send-eof channel))
+ (else
+ (write-line cmd channel)
+ (message-reply-success msg)
+ (channel-request-send-exit-status channel 0)
(channel-send-eof channel)))
(message-reply-success msg))
(message-reply-success msg)))
diff --git a/tests/shell.scm b/tests/shell.scm
index 743fc39..f8cac16 100644
--- a/tests/shell.scm
+++ b/tests/shell.scm
@@ -55,6 +55,17 @@
(rexec session "uname")
(list result exit-code)))))))
+(test-assert-with-log "which"
+ (run-client-test
+ start-server/exec
+ (lambda ()
+ (call-with-connected-session/shell
+ (lambda (session)
+ (receive (result exit-code)
+ (which session "uname")
+ (and (zero? exit-code)
+ (string=? (car result) "which 'uname'"))))))))
+
;;;