summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArtyom V. Poptsov <poptsov.artyom@gmail.com>2017-05-21 09:18:07 +0300
committerArtyom V. Poptsov <poptsov.artyom@gmail.com>2017-05-21 09:18:07 +0300
commited2fbb2d5d9dd7d3043eacea630724a6c93abbaa (patch)
tree000d50f8ce24b94c6a52595664b53e1b3b5afe64 /tests
parentNEWS: Bump version to 0.11.1 (diff)
downloadguile-ssh-ed2fbb2d5d9dd7d3043eacea630724a6c93abbaa.tar.gz
node.scm (node-guile-version): Bugfix
'node-guile-version' would always fail due to a wrong call to 'rexec' procedure passing it a node object instead of a session object. This patch fixes the bug. Reported by Mark H Weaver <mhw@netris.org> and Ludovic Courtès <ludo@gnu.org>: <https://bugs.gnu.org/26976> * modules/ssh/dist/node.scm (node-guile-version): Pass node session to a 'rexec' procedure instead of a node object. * tests/common.scm (start-server/exec): Handle node version requests. * tests/dist.scm ("node-guile-version, valid response"): New test case. * NEWS: Update.
Diffstat (limited to 'tests')
-rw-r--r--tests/common.scm12
-rw-r--r--tests/dist.scm17
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/common.scm b/tests/common.scm
index 663c0be..e6b11c4 100644
--- a/tests/common.scm
+++ b/tests/common.scm
@@ -291,6 +291,18 @@ disconnected when the PROC is finished."
(message-reply-success msg)
(channel-request-send-exit-status channel 0)
(channel-send-eof channel))
+ ((string=? cmd "which guile > /dev/null && guile --version")
+ (write-line "\
+guile (GNU Guile) 2.0.14
+Copyright (C) 2016 Free Software Foundation, Inc.
+
+License LGPLv3+: GNU LGPL 3 or later <http://gnu.org/licenses/lgpl.html>.
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+" 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/dist.scm b/tests/dist.scm
index ddf9573..f26b0cf 100644
--- a/tests/dist.scm
+++ b/tests/dist.scm
@@ -190,6 +190,23 @@ $4 = #<session #<undefined>@#<undefined>:22 (disconnected) 453fff>"
(lambda (port)
(rrepl-skip-to-prompt port))))
+(test-assert-with-log "node-guile-version, valid response"
+ (run-client-test
+ ;; Server
+ start-server/exec
+ ;; Client
+ (lambda ()
+ (call-with-connected-session
+ (lambda (session)
+ (authenticate-server session)
+ (format-log/scm 'nolog "client" "session: ~a" session)
+ (unless (equal? (userauth-none! session) 'success)
+ (error "Could not authenticate with a server" session))
+
+ (let ((n (make-node session #:start-repl-server? #f)))
+ (string=? (node-guile-version n)
+ "guile (GNU Guile) 2.0.14")))))))
+
;;; Distributed forms.