diff options
| author | Artyom V. Poptsov <poptsov.artyom@gmail.com> | 2017-05-21 09:18:07 +0300 |
|---|---|---|
| committer | Artyom V. Poptsov <poptsov.artyom@gmail.com> | 2017-05-21 09:18:07 +0300 |
| commit | ed2fbb2d5d9dd7d3043eacea630724a6c93abbaa (patch) | |
| tree | 000d50f8ce24b94c6a52595664b53e1b3b5afe64 | |
| parent | NEWS: Bump version to 0.11.1 (diff) | |
| download | guile-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.
| -rw-r--r-- | NEWS | 9 | ||||
| -rw-r--r-- | modules/ssh/dist/node.scm | 2 | ||||
| -rw-r--r-- | tests/common.scm | 12 | ||||
| -rw-r--r-- | tests/dist.scm | 17 |
4 files changed, 39 insertions, 1 deletions
@@ -7,6 +7,15 @@ Copyright (C) Artyom V. Poptsov <poptsov.artyom@gmail.com> are permitted in any medium without royalty provided the copyright notice and this notice are preserved. +* Unreleased +** Bugfixes +*** In (ssh dist node) +**** 'node-guile-version' now does not fail + The procedure would always fail to get Guile version. Now that should be + fixed. +** Update uit tests +*** Add test cases for fixed bugs + * Changes in version 0.11.1 (2017-05-09) ** Bugfixes *** Fix building scripts diff --git a/modules/ssh/dist/node.scm b/modules/ssh/dist/node.scm index 9c065c7..163fb72 100644 --- a/modules/ssh/dist/node.scm +++ b/modules/ssh/dist/node.scm @@ -411,7 +411,7 @@ procedure returns the 1st evaluated value if multiple values were returned." "Get Guile version installed on a NODE, return the version string. Return #f if Guile is not installed." (receive (result rc) - (rexec node "which guile > /dev/null && guile --version") + (rexec (node-session node) "which guile > /dev/null && guile --version") (and (zero? rc) (car result)))) 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. |
