emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 r117016: Use a mock-up connection method for remo


From: Michael Albinus
Subject: [Emacs-diffs] emacs-24 r117016: Use a mock-up connection method for remote files.
Date: Thu, 24 Apr 2014 08:22:06 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117016
revision-id: address@hidden
parent: address@hidden
committer: Michael Albinus <address@hidden>
branch nick: emacs-24
timestamp: Thu 2014-04-24 10:21:58 +0200
message:
  Use a mock-up connection method for remote files.
  
  * automated/file-notify-tests.el
  (file-notify-test-remote-temporary-file-directory):
  * automated/tramp-tests.el (tramp-test-temporary-file-directory):
  Use a mock-up method as default.
  (tramp-test00-availability): Print the used directory name.
  (tramp-test33-recursive-load): Fix typo.
modified:
  test/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-8588
  test/automated/file-notify-tests.el 
filenotifytests.el-20130702144123-sxglvo6zs3jcj8w1-1
  test/automated/tramp-tests.el  tramptests.el-20131105142319-d9zp3oprkpxj5v1e-1
=== modified file 'test/ChangeLog'
--- a/test/ChangeLog    2014-04-22 10:52:08 +0000
+++ b/test/ChangeLog    2014-04-24 08:21:58 +0000
@@ -1,3 +1,12 @@
+2014-04-24  Michael Albinus  <address@hidden>
+
+       * automated/file-notify-tests.el
+       (file-notify-test-remote-temporary-file-directory):
+       * automated/tramp-tests.el (tramp-test-temporary-file-directory):
+       Use a mock-up method as default.
+       (tramp-test00-availability): Print the used directory name.
+       (tramp-test33-recursive-load): Fix typo.
+
 2014-04-22  Michael Albinus  <address@hidden>
 
        * automated/tramp-tests.el (tramp--test-check-files): Remove traces.

=== modified file 'test/automated/file-notify-tests.el'
--- a/test/automated/file-notify-tests.el       2014-02-04 11:41:20 +0000
+++ b/test/automated/file-notify-tests.el       2014-04-24 08:21:58 +0000
@@ -19,11 +19,17 @@
 
 ;;; Commentary:
 
-;; Some of the tests require access to a remote host files.  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.
+;; 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 handler 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.
 
 ;; When running the tests in batch mode, it must NOT require an
 ;; interactive password prompt unless the environment variable
@@ -35,13 +41,22 @@
 
 (require 'ert)
 (require 'filenotify)
+(require 'tramp)
 
 ;; There is no default value on w32 systems, which could work out of the box.
 (defconst file-notify-test-remote-temporary-file-directory
   (cond
    ((getenv "REMOTE_TEMPORARY_FILE_DIRECTORY"))
    ((eq system-type 'windows-nt) null-device)
-   (t (format "/ssh::%s" temporary-file-directory)))
+   (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)))
+      (format "/mock::%s" temporary-file-directory)))
   "Temporary directory for Tramp tests.")
 
 (defvar file-notify--test-tmpfile nil)
@@ -49,7 +64,6 @@
 (defvar file-notify--test-results nil)
 (defvar file-notify--test-event nil)
 
-(require 'tramp)
 (setq tramp-verbose 0
       tramp-message-show-message nil)
 

=== modified file 'test/automated/tramp-tests.el'
--- a/test/automated/tramp-tests.el     2014-04-22 10:52:08 +0000
+++ b/test/automated/tramp-tests.el     2014-04-24 08:21:58 +0000
@@ -21,11 +21,17 @@
 
 ;; The tests require a recent ert.el from Emacs 24.4.
 
-;; Some of the tests require access to a remote host files.  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.
+;; 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 handler 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.
 
 ;; When running the tests in batch mode, it must NOT require an
 ;; interactive password prompt unless the environment variable
@@ -51,7 +57,15 @@
   (cond
    ((getenv "REMOTE_TEMPORARY_FILE_DIRECTORY"))
    ((eq system-type 'windows-nt) null-device)
-   (t (format "/ssh::%s" temporary-file-directory)))
+   (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)))
+      (format "/mock::%s" temporary-file-directory)))
   "Temporary directory for Tramp tests.")
 
 (setq password-cache-expiry nil
@@ -127,6 +141,7 @@
 (ert-deftest tramp-test00-availability ()
   "Test availability of Tramp functions."
   :expected-result (if (tramp--test-enabled) :passed :failed)
+  (message "Remote directory: `%s'" tramp-test-temporary-file-directory)
   (should (ignore-errors
            (and
             (file-remote-p tramp-test-temporary-file-directory)
@@ -1589,7 +1604,7 @@
   (dolist (code
           (list
            (format
-            "(expand-file-name %S))"
+            "(expand-file-name %S)"
             tramp-test-temporary-file-directory)
            (format
             "(let ((default-directory %S)) (expand-file-name %S))"


reply via email to

[Prev in Thread] Current Thread [Next in Thread]