diff --git a/gnu/tests/ssh.scm b/gnu/tests/ssh.scm index 41be36035..6d367dc75 100644 --- a/gnu/tests/ssh.scm +++ b/gnu/tests/ssh.scm @@ -169,6 +170,33 @@ root with an empty password." (call-with-remote-input-file sftp-session witness read))))) + ;; Connect to the guest over SSH. Make sure we can run commands + ;; from the system profile. + (test-equal "run executables from system profile" + #t + (call-with-connected-session/auth + (lambda (session) + (let ((channel (make-channel session))) + (channel-open-session channel) + (channel-request-exec + channel + (string-append + "mkdir -p /root/.guix-profile/bin && " + "touch /root/.guix-profile/bin/witness && " + "chmod 755 /root/.guix-profile/bin/witness")) + (zero? (channel-get-exit-status channel)))))) + + ;; Connect to the guest over SSH. Make sure we can run commands + ;; that only exist in the user profile. + (test-equal "run executable from user profile" + #t + (call-with-connected-session/auth + (lambda (session) + (let ((channel (make-channel session))) + (channel-open-session channel) + (channel-request-exec channel "witness") + (zero? (channel-get-exit-status channel)))))) + (test-end) (exit (= (test-runner-fail-count (test-runner-current)) 0)))))