all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 32226@debbugs.gnu.org
Subject: bug#32226: shadowfile test failures
Date: Mon, 23 Jul 2018 11:55:09 +0200	[thread overview]
Message-ID: <87in56e0oy.fsf@gmx.de> (raw)
In-Reply-To: <83o9f0yaji.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 21 Jul 2018 16:37:37 +0300")

[-- Attachment #1: Type: text/plain, Size: 377 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

Hi Eli,

> Does the above fit the bill?  If not, what else is needed for the
> mock-up method?

I have tried the following patch. It still runs as expected on my
GNU/Linux machine. Could you pls check for MS Windows?

If it works there, I'll commit to the emacs-26 branch (and similar
patches for filenotify-tests.el and tramp-tests.el).


[-- Attachment #2: Type: text/plain, Size: 2837 bytes --]

diff --git a/test/lisp/shadowfile-tests.el b/test/lisp/shadowfile-tests.el
index 200fb4c58c..e1a260c336 100644
--- a/test/lisp/shadowfile-tests.el
+++ b/test/lisp/shadowfile-tests.el
@@ -19,6 +19,18 @@
 
 ;;; Commentary:
 
+;; Some of the tests require access to a remote host files.  Since
+;; this could be problematic, a mock-up connection method "mock" is
+;; used.  Emulating a remote connection, it simply calls "sh -i".
+;; Tramp's file name handlers still run, so this test is sufficient
+;; except for connection establishing.
+
+;; If you want to test a real Tramp connection, set
+;; $REMOTE_TEMPORARY_FILE_DIRECTORY to a suitable value in order to
+;; overwrite the default value.  If you want to skip tests accessing a
+;; remote host, set this environment variable to "/dev/null" or
+;; whatever is appropriate on your system.
+
 ;; A whole test run can be performed calling the command `shadowfile-test-all'.
 
 ;;; Code:
@@ -27,28 +39,28 @@
 (require 'shadowfile)
 (require 'tramp)
 
-;; There is no default value on w32 systems, which could work out of the box.
 (defconst shadow-test-remote-temporary-file-directory
   (cond
    ((getenv "REMOTE_TEMPORARY_FILE_DIRECTORY"))
-   ((eq system-type 'windows-nt) null-device)
-   (t (add-to-list
-       'tramp-methods
-       '("mock"
-	 (tramp-login-program        "sh")
-	 (tramp-login-args           (("-i")))
-	 (tramp-remote-shell         "/bin/sh")
-	 (tramp-remote-shell-args    ("-c"))
-	 (tramp-connection-timeout   10)))
-      (add-to-list
-       'tramp-default-host-alist
-       `("\\`mock\\'" nil ,(system-name)))
-      ;; Emacs' Makefile sets $HOME to a nonexistent value.  Needed in
-      ;; batch mode only, therefore.  It cannot be
-      ;; `temporary-directory', because the tests with "~" would fail.
-      (unless (and (null noninteractive) (file-directory-p "~/"))
-        (setenv "HOME" invocation-directory))
-      (format "/mock::%s" temporary-file-directory)))
+   ((executable-find "sh")
+    (add-to-list
+     'tramp-methods
+     `("mock"
+       (tramp-login-program        ,(executable-find "sh"))
+       (tramp-login-args           (("-i")))
+       (tramp-remote-shell         ,(executable-find "sh"))
+       (tramp-remote-shell-args    ("-c"))
+       (tramp-connection-timeout   10)))
+    (add-to-list
+     'tramp-default-host-alist
+     `("\\`mock\\'" nil ,(system-name)))
+    ;; Emacs' Makefile sets $HOME to a nonexistent value.  Needed in
+    ;; batch mode only, therefore.  It cannot be
+    ;; `temporary-directory', because the tests with "~" would fail.
+    (unless (and (null noninteractive) (file-directory-p "~/"))
+      (setenv "HOME" invocation-directory))
+    (format "/mock::%s" temporary-file-directory))
+   (t null-device))
   "Temporary directory for Tramp tests.")
 
 (defconst shadow-test-info-file

  parent reply	other threads:[~2018-07-23  9:55 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-20 17:22 bug#32226: shadowfile test failures Glenn Morris
2018-07-20 19:08 ` Eli Zaretskii
2018-07-21 10:36   ` Michael Albinus
2018-07-21 12:03     ` Eli Zaretskii
2018-07-21 12:13       ` Michael Albinus
2018-07-21 12:25         ` Eli Zaretskii
2018-07-21 12:48           ` Michael Albinus
2018-07-21 13:37             ` Eli Zaretskii
2018-07-21 13:56               ` Eli Zaretskii
2018-07-21 13:59               ` Michael Albinus
2018-07-21 14:21                 ` Eli Zaretskii
2018-07-21 14:41                   ` Michael Albinus
2018-07-23  9:55               ` Michael Albinus [this message]
2018-07-23 15:59                 ` Eli Zaretskii
2018-07-23 16:18                   ` Michael Albinus
2018-07-23 16:39                     ` Eli Zaretskii
2018-07-23 16:52                       ` Michael Albinus
2018-07-25 10:48                   ` Michael Albinus
2018-07-25 14:47                     ` Eli Zaretskii
2018-07-25 15:19                       ` Michael Albinus
2018-07-21 10:33 ` Michael Albinus
2018-07-24 17:44   ` Glenn Morris
2018-07-25 11:22     ` Michael Albinus
2018-08-12 16:19       ` Michael Albinus
2018-08-12 23:46         ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87in56e0oy.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=32226@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.