diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/common.scm | 8 | ||||
| -rw-r--r-- | tests/shell.scm | 11 |
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))))))) + ;;; |
