diff options
| author | Artyom V. Poptsov <poptsov.artyom@gmail.com> | 2016-12-31 02:55:25 +0300 |
|---|---|---|
| committer | Artyom V. Poptsov <poptsov.artyom@gmail.com> | 2016-12-31 02:55:25 +0300 |
| commit | e06af630ce4ba34b76d0a5bf086986b76d10dc6c (patch) | |
| tree | 240df4458f17566fdd08a5eafb973624c40e0671 /tests | |
| parent | shell.scm (fallback-pgrep): Add dumb 'full?' option (diff) | |
| download | guile-ssh-e06af630ce4ba34b76d0a5bf086986b76d10dc6c.tar.gz | |
tests/common.scm: (start-server/exec): Send EOF after response
* tests/common.scm: (start-server/exec): Send EOF after response.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/common.scm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/common.scm b/tests/common.scm index c5dac55..c32ecd6 100644 --- a/tests/common.scm +++ b/tests/common.scm @@ -23,6 +23,7 @@ #:use-module (ice-9 rdelim) #:use-module (ice-9 format) #:use-module (ssh session) + #:use-module (ssh channel) #:use-module (ssh server) #:use-module (ssh log) #:use-module (ssh message) @@ -249,18 +250,25 @@ disconnected when the PROC is finished." (let ((channel #f)) (lambda (msg) (let ((msg-type (message-get-type msg))) + (format-log/scm 'nolog "start-server/exec" + "msg-type: ~a" msg-type) (case (car msg-type) ((request-channel-open) (set! channel (message-channel-request-open-reply-accept msg))) ((request-channel) (if (equal? (cadr msg-type) 'channel-request-exec) (let ((cmd (exec-req:cmd (message-get-req msg)))) + (format-log/scm 'nolog "start-server/exec" + "command: ~A" cmd) (cond ((string=? cmd "ping") - (write-line "pong" channel)) + (write-line "pong" channel) + (channel-send-eof channel)) ((string=? cmd "uname") ; For exit status testing + (write-line "pong" channel) (message-reply-success msg) - (channel-request-send-exit-status channel 0))) + (channel-request-send-exit-status channel 0) + (channel-send-eof channel))) (message-reply-success msg)) (message-reply-success msg))) (else |
