summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArtyom V. Poptsov <poptsov.artyom@gmail.com>2017-01-01 10:49:24 +0300
committerArtyom V. Poptsov <poptsov.artyom@gmail.com>2017-01-01 10:49:24 +0300
commit0216333e274cf398235bc0fab88e5cf5256c0e60 (patch)
tree76750ab7a9e543d2b8f32d0459befe019fa8fa47 /tests
parenttests/shell.scm: Update copyright dates (diff)
downloadguile-ssh-0216333e274cf398235bc0fab88e5cf5256c0e60.tar.gz
tests/shell.scm ("fallback-pgrep"): New TC
* tests/shell.scm ("fallback-pgrep"): New TC. * tests/common.scm (start-server/exec): Handle 'fallback-pgrep' request.
Diffstat (limited to 'tests')
-rw-r--r--tests/common.scm8
-rw-r--r--tests/shell.scm11
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/common.scm b/tests/common.scm
index 014997f..3fb4b48 100644
--- a/tests/common.scm
+++ b/tests/common.scm
@@ -22,6 +22,8 @@
#:use-module (srfi srfi-26)
#:use-module (ice-9 rdelim)
#:use-module (ice-9 format)
+ #:use-module (ice-9 regex)
+ #:use-module (ice-9 popen)
#:use-module (ssh session)
#:use-module (ssh channel)
#:use-module (ssh server)
@@ -269,6 +271,12 @@ disconnected when the PROC is finished."
(message-reply-success msg)
(channel-request-send-exit-status channel 0)
(channel-send-eof channel))
+ ((string-match "echo '.*" cmd)
+ (let ((p (open-input-pipe cmd)))
+ (write-line (read-line p) 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)
diff --git a/tests/shell.scm b/tests/shell.scm
index 1e3b958..3561010 100644
--- a/tests/shell.scm
+++ b/tests/shell.scm
@@ -66,6 +66,17 @@
(and (zero? exit-code)
(string=? (car result) "which 'uname'"))))))))
+(test-assert-with-log "fallback-pgrep"
+ (run-client-test
+ start-server/exec
+ (lambda ()
+ (call-with-connected-session/shell
+ (lambda (session)
+ (receive (result exit-code)
+ (fallback-pgrep session "guile")
+ (and (zero? exit-code)
+ result)))))))
+
;;;