diff options
| author | Michael Albinus | 2022-06-08 12:06:56 +0200 |
|---|---|---|
| committer | Michael Albinus | 2022-06-08 12:06:56 +0200 |
| commit | b2ed8a547ace1dade2823d28b60c21d3634d68b2 (patch) | |
| tree | aa3420eccea7101e5f5b7d8639825e4e4dc65ff7 /test | |
| parent | 493ae66be08a99ea7918ee8210aec3eb925c8fad (diff) | |
| download | emacs-b2ed8a547ace1dade2823d28b60c21d3634d68b2.tar.gz emacs-b2ed8a547ace1dade2823d28b60c21d3634d68b2.zip | |
Factor out test configuration for remote files
* lisp/emacs-lisp/ert-x.el (tramp-methods)
(tramp-default-host-alist): Declare.
(ert-remote-temporary-file-directory): New defconst.
* test/README: Mention dnd-tests.el.
* test/lisp/autorevert-tests.el
(auto-revert-test-remote-temporary-file-directory): Remove.
Replace all uses by `ert-remote-temporary-file-directory'.
* test/lisp/dnd-tests.el (ert-x): Require.
(dnd-tests-temporary-file-directory): Remove. Replace all uses by
`ert-remote-temporary-file-directory'.
* test/lisp/filenotify-tests.el
(file-notify-test-remote-temporary-file-directory): Remove.
Replace all uses by `ert-remote-temporary-file-directory'.
* test/lisp/shadowfile-tests.el (ert-x): Require.
(shadow-test-remote-temporary-file-directory): Remove. Replace
all uses by `ert-remote-temporary-file-directory'.
* test/lisp/net/tramp-tests.el: Don't require ert.
(ert-remote-temporary-file-directory): Define if it doesn't exist.
(tramp-test-temporary-file-directory): Remove. Replace all uses
by `ert-remote-temporary-file-directory'.
Diffstat (limited to 'test')
| -rw-r--r-- | test/README | 11 | ||||
| -rw-r--r-- | test/lisp/autorevert-tests.el | 36 | ||||
| -rw-r--r-- | test/lisp/dnd-tests.el | 33 | ||||
| -rw-r--r-- | test/lisp/filenotify-tests.el | 38 | ||||
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 289 | ||||
| -rw-r--r-- | test/lisp/shadowfile-tests.el | 116 |
6 files changed, 204 insertions, 319 deletions
diff --git a/test/README b/test/README index 3d865de78b4..17783a4bacf 100644 --- a/test/README +++ b/test/README | |||
| @@ -118,11 +118,12 @@ If the $EMACS_TEST_JUNIT_REPORT environment variable is set to a file | |||
| 118 | name, a JUnit test report is generated under this name. | 118 | name, a JUnit test report is generated under this name. |
| 119 | 119 | ||
| 120 | Some of the tests require a remote temporary directory | 120 | Some of the tests require a remote temporary directory |
| 121 | (autorevert-tests.el, filenotify-tests.el, shadowfile-tests.el and | 121 | (autorevert-tests.el, dnd-tests.el, filenotify-tests.el, |
| 122 | tramp-tests.el). Per default, a mock-up connection method is used | 122 | shadowfile-tests.el and tramp-tests.el). Per default, a mock-up |
| 123 | (this might not be possible when running on MS Windows). If you want | 123 | connection method is used (this might not be possible when running on |
| 124 | to test a real remote connection, set $REMOTE_TEMPORARY_FILE_DIRECTORY | 124 | MS Windows). If you want to test a real remote connection, set |
| 125 | to a suitable value in order to overwrite the default value: | 125 | $REMOTE_TEMPORARY_FILE_DIRECTORY to a suitable value in order to |
| 126 | overwrite the default value: | ||
| 126 | 127 | ||
| 127 | env REMOTE_TEMPORARY_FILE_DIRECTORY=/ssh:host:/tmp make ... | 128 | env REMOTE_TEMPORARY_FILE_DIRECTORY=/ssh:host:/tmp make ... |
| 128 | 129 | ||
diff --git a/test/lisp/autorevert-tests.el b/test/lisp/autorevert-tests.el index d26e0f5a159..54b1a16b5db 100644 --- a/test/lisp/autorevert-tests.el +++ b/test/lisp/autorevert-tests.el | |||
| @@ -52,10 +52,9 @@ | |||
| 52 | 52 | ||
| 53 | ;;; Code: | 53 | ;;; Code: |
| 54 | 54 | ||
| 55 | (require 'ert) | 55 | (require 'tramp) |
| 56 | (require 'ert-x) | 56 | (require 'ert-x) |
| 57 | (require 'autorevert) | 57 | (require 'autorevert) |
| 58 | (require 'tramp) | ||
| 59 | 58 | ||
| 60 | (setq auto-revert-debug nil | 59 | (setq auto-revert-debug nil |
| 61 | auto-revert-notify-exclude-dir-regexp "nothing-to-be-excluded" | 60 | auto-revert-notify-exclude-dir-regexp "nothing-to-be-excluded" |
| @@ -70,30 +69,6 @@ | |||
| 70 | (defvar auto-revert--messages nil | 69 | (defvar auto-revert--messages nil |
| 71 | "Used to collect messages issued during a section of a test.") | 70 | "Used to collect messages issued during a section of a test.") |
| 72 | 71 | ||
| 73 | ;; There is no default value on w32 systems, which could work out of the box. | ||
| 74 | (defconst auto-revert-test-remote-temporary-file-directory | ||
| 75 | (cond | ||
| 76 | ((getenv "REMOTE_TEMPORARY_FILE_DIRECTORY")) | ||
| 77 | ((eq system-type 'windows-nt) null-device) | ||
| 78 | (t (add-to-list | ||
| 79 | 'tramp-methods | ||
| 80 | '("mock" | ||
| 81 | (tramp-login-program "sh") | ||
| 82 | (tramp-login-args (("-i"))) | ||
| 83 | (tramp-remote-shell "/bin/sh") | ||
| 84 | (tramp-remote-shell-args ("-c")) | ||
| 85 | (tramp-connection-timeout 10))) | ||
| 86 | (add-to-list | ||
| 87 | 'tramp-default-host-alist | ||
| 88 | `("\\`mock\\'" nil ,(system-name))) | ||
| 89 | ;; Emacs' Makefile sets $HOME to a nonexistent value. Needed in | ||
| 90 | ;; batch mode only, therefore. `temporary-file-directory' might | ||
| 91 | ;; be quoted, so we unquote it just in case. | ||
| 92 | (unless (and (null noninteractive) (file-directory-p "~/")) | ||
| 93 | (setenv "HOME" (file-name-unquote temporary-file-directory))) | ||
| 94 | (format "/mock::%s" temporary-file-directory))) | ||
| 95 | "Temporary directory for Tramp tests.") | ||
| 96 | |||
| 97 | ;; Filter suppressed remote file-notify libraries. | 72 | ;; Filter suppressed remote file-notify libraries. |
| 98 | (when (stringp (getenv "REMOTE_FILE_NOTIFY_LIBRARY")) | 73 | (when (stringp (getenv "REMOTE_FILE_NOTIFY_LIBRARY")) |
| 99 | (dolist (lib '("inotifywait" "gio-monitor" "gvfs-monitor-dir")) | 74 | (dolist (lib '("inotifywait" "gio-monitor" "gvfs-monitor-dir")) |
| @@ -114,10 +89,9 @@ being the result.") | |||
| 114 | t (ignore-errors | 89 | t (ignore-errors |
| 115 | (and | 90 | (and |
| 116 | (not (getenv "EMACS_HYDRA_CI")) | 91 | (not (getenv "EMACS_HYDRA_CI")) |
| 117 | (file-remote-p auto-revert-test-remote-temporary-file-directory) | 92 | (file-remote-p ert-remote-temporary-file-directory) |
| 118 | (file-directory-p auto-revert-test-remote-temporary-file-directory) | 93 | (file-directory-p ert-remote-temporary-file-directory) |
| 119 | (file-writable-p | 94 | (file-writable-p ert-remote-temporary-file-directory)))))) |
| 120 | auto-revert-test-remote-temporary-file-directory)))))) | ||
| 121 | ;; Return result. | 95 | ;; Return result. |
| 122 | (cdr auto-revert--test-enabled-remote-checked)) | 96 | (cdr auto-revert--test-enabled-remote-checked)) |
| 123 | 97 | ||
| @@ -146,7 +120,7 @@ This expects `auto-revert--messages' to be bound by | |||
| 146 | ,docstring | 120 | ,docstring |
| 147 | :tags '(:expensive-test :unstable) | 121 | :tags '(:expensive-test :unstable) |
| 148 | (let ((temporary-file-directory | 122 | (let ((temporary-file-directory |
| 149 | auto-revert-test-remote-temporary-file-directory) | 123 | ert-remote-temporary-file-directory) |
| 150 | (auto-revert-remote-files t) | 124 | (auto-revert-remote-files t) |
| 151 | (ert-test (ert-get-test ',test)) | 125 | (ert-test (ert-get-test ',test)) |
| 152 | vc-handled-backends) | 126 | vc-handled-backends) |
diff --git a/test/lisp/dnd-tests.el b/test/lisp/dnd-tests.el index 7a12cb8347c..1e5b1f823fb 100644 --- a/test/lisp/dnd-tests.el +++ b/test/lisp/dnd-tests.el | |||
| @@ -30,30 +30,7 @@ | |||
| 30 | (require 'cl-lib) | 30 | (require 'cl-lib) |
| 31 | (require 'tramp) | 31 | (require 'tramp) |
| 32 | (require 'select) | 32 | (require 'select) |
| 33 | 33 | (require 'ert-x) | |
| 34 | ;; This code was taken from tramp-tests.el: perhaps some of it isn't | ||
| 35 | ;; strictly necessary. | ||
| 36 | (defconst dnd-tests-temporary-file-directory | ||
| 37 | (cond | ||
| 38 | ((getenv "REMOTE_TEMPORARY_FILE_DIRECTORY")) | ||
| 39 | ((eq system-type 'windows-nt) null-device) | ||
| 40 | (t (add-to-list | ||
| 41 | 'tramp-methods | ||
| 42 | '("mock" | ||
| 43 | (tramp-login-program "sh") | ||
| 44 | (tramp-login-args (("-i"))) | ||
| 45 | (tramp-remote-shell "/bin/sh") | ||
| 46 | (tramp-remote-shell-args ("-c")) | ||
| 47 | (tramp-connection-timeout 10))) | ||
| 48 | (add-to-list | ||
| 49 | 'tramp-default-host-alist | ||
| 50 | `("\\`mock\\'" nil ,(system-name))) | ||
| 51 | ;; Emacs's Makefile sets $HOME to a nonexistent value. Needed | ||
| 52 | ;; in batch mode only, therefore. | ||
| 53 | (unless (and (null noninteractive) (file-directory-p "~/")) | ||
| 54 | (setenv "HOME" temporary-file-directory)) | ||
| 55 | (format "/mock::%s" temporary-file-directory))) | ||
| 56 | "Temporary directory for drag-and-drop tests involving remote files.") | ||
| 57 | 34 | ||
| 58 | (defvar dnd-tests-selection-table nil | 35 | (defvar dnd-tests-selection-table nil |
| 59 | "Alist of selection names to their values.") | 36 | "Alist of selection names to their values.") |
| @@ -108,15 +85,15 @@ | |||
| 108 | "Return if a test involving remote files can proceed." | 85 | "Return if a test involving remote files can proceed." |
| 109 | (ignore-errors | 86 | (ignore-errors |
| 110 | (and | 87 | (and |
| 111 | (file-remote-p dnd-tests-temporary-file-directory) | 88 | (file-remote-p ert-remote-temporary-file-directory) |
| 112 | (file-directory-p dnd-tests-temporary-file-directory) | 89 | (file-directory-p ert-remote-temporary-file-directory) |
| 113 | (file-writable-p dnd-tests-temporary-file-directory)))) | 90 | (file-writable-p ert-remote-temporary-file-directory)))) |
| 114 | 91 | ||
| 115 | (defun dnd-tests-make-temp-name () | 92 | (defun dnd-tests-make-temp-name () |
| 116 | "Return a temporary remote file name for test. | 93 | "Return a temporary remote file name for test. |
| 117 | The temporary file is not created." | 94 | The temporary file is not created." |
| 118 | (expand-file-name (make-temp-name "dnd-test-remote") | 95 | (expand-file-name (make-temp-name "dnd-test-remote") |
| 119 | dnd-tests-temporary-file-directory)) | 96 | ert-remote-temporary-file-directory)) |
| 120 | 97 | ||
| 121 | (defun dnd-tests-parse-tt-netfile (netfile) | 98 | (defun dnd-tests-parse-tt-netfile (netfile) |
| 122 | "Parse NETFILE and return its components. | 99 | "Parse NETFILE and return its components. |
diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el index 13bb2cd3452..ad0138b2e7b 100644 --- a/test/lisp/filenotify-tests.el +++ b/test/lisp/filenotify-tests.el | |||
| @@ -52,34 +52,9 @@ | |||
| 52 | 52 | ||
| 53 | ;;; Code: | 53 | ;;; Code: |
| 54 | 54 | ||
| 55 | (require 'ert) | 55 | (require 'tramp) |
| 56 | (require 'ert-x) | 56 | (require 'ert-x) |
| 57 | (require 'filenotify) | 57 | (require 'filenotify) |
| 58 | (require 'tramp) | ||
| 59 | |||
| 60 | ;; There is no default value on w32 systems, which could work out of the box. | ||
| 61 | (defconst file-notify-test-remote-temporary-file-directory | ||
| 62 | (cond | ||
| 63 | ((getenv "REMOTE_TEMPORARY_FILE_DIRECTORY")) | ||
| 64 | ((eq system-type 'windows-nt) null-device) | ||
| 65 | (t (add-to-list | ||
| 66 | 'tramp-methods | ||
| 67 | '("mock" | ||
| 68 | (tramp-login-program "sh") | ||
| 69 | (tramp-login-args (("-i"))) | ||
| 70 | (tramp-remote-shell "/bin/sh") | ||
| 71 | (tramp-remote-shell-args ("-c")) | ||
| 72 | (tramp-connection-timeout 10))) | ||
| 73 | (add-to-list | ||
| 74 | 'tramp-default-host-alist | ||
| 75 | `("\\`mock\\'" nil ,(system-name))) | ||
| 76 | ;; Emacs' Makefile sets $HOME to a nonexistent value. Needed in | ||
| 77 | ;; batch mode only, therefore. `temporary-file-directory' might | ||
| 78 | ;; be quoted, so we unquote it just in case. | ||
| 79 | (unless (and (null noninteractive) (file-directory-p "~/")) | ||
| 80 | (setenv "HOME" (file-name-unquote temporary-file-directory))) | ||
| 81 | (format "/mock::%s" temporary-file-directory))) | ||
| 82 | "Temporary directory for Tramp tests.") | ||
| 83 | 58 | ||
| 84 | ;; Filter suppressed remote file-notify libraries. | 59 | ;; Filter suppressed remote file-notify libraries. |
| 85 | (when (stringp (getenv "REMOTE_FILE_NOTIFY_LIBRARY")) | 60 | (when (stringp (getenv "REMOTE_FILE_NOTIFY_LIBRARY")) |
| @@ -232,12 +207,12 @@ being the result.") | |||
| 232 | (let (desc) | 207 | (let (desc) |
| 233 | (ignore-errors | 208 | (ignore-errors |
| 234 | (and | 209 | (and |
| 235 | (file-remote-p file-notify-test-remote-temporary-file-directory) | 210 | (file-remote-p ert-remote-temporary-file-directory) |
| 236 | (file-directory-p file-notify-test-remote-temporary-file-directory) | 211 | (file-directory-p ert-remote-temporary-file-directory) |
| 237 | (file-writable-p file-notify-test-remote-temporary-file-directory) | 212 | (file-writable-p ert-remote-temporary-file-directory) |
| 238 | (setq desc | 213 | (setq desc |
| 239 | (file-notify-add-watch | 214 | (file-notify-add-watch |
| 240 | file-notify-test-remote-temporary-file-directory | 215 | ert-remote-temporary-file-directory |
| 241 | '(change) #'ignore)))) | 216 | '(change) #'ignore)))) |
| 242 | (setq file-notify--test-remote-enabled-checked (cons t desc)) | 217 | (setq file-notify--test-remote-enabled-checked (cons t desc)) |
| 243 | (when desc (file-notify-rm-watch desc)))) | 218 | (when desc (file-notify-rm-watch desc)))) |
| @@ -297,8 +272,7 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'." | |||
| 297 | `(ert-deftest ,(intern (concat (symbol-name test) "-remote")) () | 272 | `(ert-deftest ,(intern (concat (symbol-name test) "-remote")) () |
| 298 | ,docstring | 273 | ,docstring |
| 299 | :tags (if ,unstable '(:expensive-test :unstable) '(:expensive-test)) | 274 | :tags (if ,unstable '(:expensive-test :unstable) '(:expensive-test)) |
| 300 | (let* ((temporary-file-directory | 275 | (let* ((temporary-file-directory ert-remote-temporary-file-directory) |
| 301 | file-notify-test-remote-temporary-file-directory) | ||
| 302 | (ert-test (ert-get-test ',test)) | 276 | (ert-test (ert-get-test ',test)) |
| 303 | vc-handled-backends) | 277 | vc-handled-backends) |
| 304 | (skip-unless (file-notify--test-remote-enabled)) | 278 | (skip-unless (file-notify--test-remote-enabled)) |
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 621b6ba1c29..87c8eb0ada3 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -44,12 +44,11 @@ | |||
| 44 | (require 'cl-lib) | 44 | (require 'cl-lib) |
| 45 | (require 'dired) | 45 | (require 'dired) |
| 46 | (require 'dired-aux) | 46 | (require 'dired-aux) |
| 47 | (require 'ert) | 47 | (require 'tramp) |
| 48 | (require 'ert-x) | 48 | (require 'ert-x) |
| 49 | (require 'seq) ; For `seq-random-elt', autoloaded since Emacs 28.1 | 49 | (require 'seq) ; For `seq-random-elt', autoloaded since Emacs 28.1 |
| 50 | (require 'tar-mode) | 50 | (require 'tar-mode) |
| 51 | (require 'trace) | 51 | (require 'trace) |
| 52 | (require 'tramp) | ||
| 53 | (require 'vc) | 52 | (require 'vc) |
| 54 | (require 'vc-bzr) | 53 | (require 'vc-bzr) |
| 55 | (require 'vc-git) | 54 | (require 'vc-git) |
| @@ -128,6 +127,33 @@ A resource file is in the resource directory as per | |||
| 128 | `ert-resource-directory'." | 127 | `ert-resource-directory'." |
| 129 | `(expand-file-name ,file (ert-resource-directory))))) | 128 | `(expand-file-name ,file (ert-resource-directory))))) |
| 130 | 129 | ||
| 130 | ;; `ert-remote-temporary-file-directory' was introduced in Emacs 29.1. | ||
| 131 | (unless (boundp 'ert-remote-temporary-file-directory) | ||
| 132 | (eval-and-compile | ||
| 133 | ;; There is no default value on w32 systems, which could work out | ||
| 134 | ;; of the box. | ||
| 135 | (defconst ert-remote-temporary-file-directory | ||
| 136 | (cond | ||
| 137 | ((getenv "REMOTE_TEMPORARY_FILE_DIRECTORY")) | ||
| 138 | ((eq system-type 'windows-nt) null-device) | ||
| 139 | (t (add-to-list | ||
| 140 | 'tramp-methods | ||
| 141 | '("mock" | ||
| 142 | (tramp-login-program "sh") | ||
| 143 | (tramp-login-args (("-i"))) | ||
| 144 | (tramp-remote-shell "/bin/sh") | ||
| 145 | (tramp-remote-shell-args ("-c")) | ||
| 146 | (tramp-connection-timeout 10))) | ||
| 147 | (add-to-list | ||
| 148 | 'tramp-default-host-alist | ||
| 149 | `("\\`mock\\'" nil ,(system-name))) | ||
| 150 | ;; Emacs's Makefile sets $HOME to a nonexistent value. | ||
| 151 | ;; Needed in batch mode only, therefore. | ||
| 152 | (unless (and (null noninteractive) (file-directory-p "~/")) | ||
| 153 | (setenv "HOME" temporary-file-directory)) | ||
| 154 | (format "/mock::%s" temporary-file-directory))) | ||
| 155 | "Temporary directory for remote file tests."))) | ||
| 156 | |||
| 131 | ;; Beautify batch mode. | 157 | ;; Beautify batch mode. |
| 132 | (when noninteractive | 158 | (when noninteractive |
| 133 | ;; Suppress nasty messages. | 159 | ;; Suppress nasty messages. |
| @@ -137,32 +163,9 @@ A resource file is in the resource directory as per | |||
| 137 | '(fset 'tramp-gvfs-handler-askquestion | 163 | '(fset 'tramp-gvfs-handler-askquestion |
| 138 | (lambda (_message _choices) '(t nil 0))))) | 164 | (lambda (_message _choices) '(t nil 0))))) |
| 139 | 165 | ||
| 140 | ;; There is no default value on w32 systems, which could work out of the box. | ||
| 141 | (defconst tramp-test-temporary-file-directory | ||
| 142 | (cond | ||
| 143 | ((getenv "REMOTE_TEMPORARY_FILE_DIRECTORY")) | ||
| 144 | ((eq system-type 'windows-nt) null-device) | ||
| 145 | (t (add-to-list | ||
| 146 | 'tramp-methods | ||
| 147 | '("mock" | ||
| 148 | (tramp-login-program "sh") | ||
| 149 | (tramp-login-args (("-i"))) | ||
| 150 | (tramp-remote-shell "/bin/sh") | ||
| 151 | (tramp-remote-shell-args ("-c")) | ||
| 152 | (tramp-connection-timeout 10))) | ||
| 153 | (add-to-list | ||
| 154 | 'tramp-default-host-alist | ||
| 155 | `("\\`mock\\'" nil ,(system-name))) | ||
| 156 | ;; Emacs's Makefile sets $HOME to a nonexistent value. Needed | ||
| 157 | ;; in batch mode only, therefore. | ||
| 158 | (unless (and (null noninteractive) (file-directory-p "~/")) | ||
| 159 | (setenv "HOME" temporary-file-directory)) | ||
| 160 | (format "/mock::%s" temporary-file-directory))) | ||
| 161 | "Temporary directory for Tramp tests.") | ||
| 162 | |||
| 163 | (defconst tramp-test-vec | 166 | (defconst tramp-test-vec |
| 164 | (and (file-remote-p tramp-test-temporary-file-directory) | 167 | (and (file-remote-p ert-remote-temporary-file-directory) |
| 165 | (tramp-dissect-file-name tramp-test-temporary-file-directory)) | 168 | (tramp-dissect-file-name ert-remote-temporary-file-directory)) |
| 166 | "The used `tramp-file-name' structure.") | 169 | "The used `tramp-file-name' structure.") |
| 167 | 170 | ||
| 168 | (setq auth-source-save-behavior nil | 171 | (setq auth-source-save-behavior nil |
| @@ -192,9 +195,9 @@ being the result.") | |||
| 192 | (cons | 195 | (cons |
| 193 | t (ignore-errors | 196 | t (ignore-errors |
| 194 | (and | 197 | (and |
| 195 | (file-remote-p tramp-test-temporary-file-directory) | 198 | (file-remote-p ert-remote-temporary-file-directory) |
| 196 | (file-directory-p tramp-test-temporary-file-directory) | 199 | (file-directory-p ert-remote-temporary-file-directory) |
| 197 | (file-writable-p tramp-test-temporary-file-directory)))))) | 200 | (file-writable-p ert-remote-temporary-file-directory)))))) |
| 198 | 201 | ||
| 199 | (when (cdr tramp--test-enabled-checked) | 202 | (when (cdr tramp--test-enabled-checked) |
| 200 | ;; Cleanup connection. | 203 | ;; Cleanup connection. |
| @@ -213,7 +216,7 @@ The temporary file is not created." | |||
| 213 | (if quoted #'tramp-compat-file-name-quote #'identity) | 216 | (if quoted #'tramp-compat-file-name-quote #'identity) |
| 214 | (expand-file-name | 217 | (expand-file-name |
| 215 | (make-temp-name "tramp-test") | 218 | (make-temp-name "tramp-test") |
| 216 | (if local temporary-file-directory tramp-test-temporary-file-directory)))) | 219 | (if local temporary-file-directory ert-remote-temporary-file-directory)))) |
| 217 | 220 | ||
| 218 | ;; Method "smb" supports `make-symbolic-link' only if the remote host | 221 | ;; Method "smb" supports `make-symbolic-link' only if the remote host |
| 219 | ;; has CIFS capabilities. tramp-adb.el, tramp-gvfs.el, tramp-rclone.el | 222 | ;; has CIFS capabilities. tramp-adb.el, tramp-gvfs.el, tramp-rclone.el |
| @@ -295,12 +298,12 @@ Also see `ignore'." | |||
| 295 | "Test availability of Tramp functions." | 298 | "Test availability of Tramp functions." |
| 296 | :expected-result (if (tramp--test-enabled) :passed :failed) | 299 | :expected-result (if (tramp--test-enabled) :passed :failed) |
| 297 | (tramp--test-message | 300 | (tramp--test-message |
| 298 | "Remote directory: `%s'" tramp-test-temporary-file-directory) | 301 | "Remote directory: `%s'" ert-remote-temporary-file-directory) |
| 299 | (should (ignore-errors | 302 | (should (ignore-errors |
| 300 | (and | 303 | (and |
| 301 | (file-remote-p tramp-test-temporary-file-directory) | 304 | (file-remote-p ert-remote-temporary-file-directory) |
| 302 | (file-directory-p tramp-test-temporary-file-directory) | 305 | (file-directory-p ert-remote-temporary-file-directory) |
| 303 | (file-writable-p tramp-test-temporary-file-directory))))) | 306 | (file-writable-p ert-remote-temporary-file-directory))))) |
| 304 | 307 | ||
| 305 | (ert-deftest tramp-test01-file-name-syntax () | 308 | (ert-deftest tramp-test01-file-name-syntax () |
| 306 | "Check remote file name syntax." | 309 | "Check remote file name syntax." |
| @@ -1997,7 +2000,7 @@ Also see `ignore'." | |||
| 1997 | (find-file | 2000 | (find-file |
| 1998 | (format | 2001 | (format |
| 1999 | "%s|%s:foo:" | 2002 | "%s|%s:foo:" |
| 2000 | (substring (file-remote-p tramp-test-temporary-file-directory) 0 -1) | 2003 | (substring (file-remote-p ert-remote-temporary-file-directory) 0 -1) |
| 2001 | m)) | 2004 | m)) |
| 2002 | :type 'user-error)))) | 2005 | :type 'user-error)))) |
| 2003 | 2006 | ||
| @@ -2022,7 +2025,7 @@ Also see `ignore'." | |||
| 2022 | (should-error | 2025 | (should-error |
| 2023 | (tramp-smb-get-localname | 2026 | (tramp-smb-get-localname |
| 2024 | (tramp-dissect-file-name | 2027 | (tramp-dissect-file-name |
| 2025 | (expand-file-name file tramp-test-temporary-file-directory))) | 2028 | (expand-file-name file ert-remote-temporary-file-directory))) |
| 2026 | :type 'file-error)))) | 2029 | :type 'file-error)))) |
| 2027 | 2030 | ||
| 2028 | (ert-deftest tramp-test04-substitute-in-file-name () | 2031 | (ert-deftest tramp-test04-substitute-in-file-name () |
| @@ -2178,16 +2181,16 @@ Also see `ignore'." | |||
| 2178 | (string-equal | 2181 | (string-equal |
| 2179 | (let ((default-directory | 2182 | (let ((default-directory |
| 2180 | (concat | 2183 | (concat |
| 2181 | (file-remote-p tramp-test-temporary-file-directory) "/path"))) | 2184 | (file-remote-p ert-remote-temporary-file-directory) "/path"))) |
| 2182 | (expand-file-name ".." "./")) | 2185 | (expand-file-name ".." "./")) |
| 2183 | (concat (file-remote-p tramp-test-temporary-file-directory) "/")))) | 2186 | (concat (file-remote-p ert-remote-temporary-file-directory) "/")))) |
| 2184 | 2187 | ||
| 2185 | (ert-deftest tramp-test05-expand-file-name-top () | 2188 | (ert-deftest tramp-test05-expand-file-name-top () |
| 2186 | "Check `expand-file-name'." | 2189 | "Check `expand-file-name'." |
| 2187 | (skip-unless (tramp--test-enabled)) | 2190 | (skip-unless (tramp--test-enabled)) |
| 2188 | (skip-unless (not (tramp--test-ange-ftp-p))) | 2191 | (skip-unless (not (tramp--test-ange-ftp-p))) |
| 2189 | 2192 | ||
| 2190 | (let ((dir (concat (file-remote-p tramp-test-temporary-file-directory) "/"))) | 2193 | (let ((dir (concat (file-remote-p ert-remote-temporary-file-directory) "/"))) |
| 2191 | (dolist (local '("." "..")) | 2194 | (dolist (local '("." "..")) |
| 2192 | (should (string-equal (expand-file-name local dir) dir)) | 2195 | (should (string-equal (expand-file-name local dir) dir)) |
| 2193 | (should (string-equal (expand-file-name (concat dir local)) dir))))) | 2196 | (should (string-equal (expand-file-name (concat dir local)) dir))))) |
| @@ -2250,8 +2253,8 @@ This checks also `file-name-as-directory', `file-name-directory', | |||
| 2250 | ;; We must clear `tramp-default-method'. On hydra, it is "ftp", | 2253 | ;; We must clear `tramp-default-method'. On hydra, it is "ftp", |
| 2251 | ;; which ruins the tests. | 2254 | ;; which ruins the tests. |
| 2252 | (let ((tramp-default-method | 2255 | (let ((tramp-default-method |
| 2253 | (file-remote-p tramp-test-temporary-file-directory 'method)) | 2256 | (file-remote-p ert-remote-temporary-file-directory 'method)) |
| 2254 | (host (file-remote-p tramp-test-temporary-file-directory 'host))) | 2257 | (host (file-remote-p ert-remote-temporary-file-directory 'host))) |
| 2255 | (dolist | 2258 | (dolist |
| 2256 | (file | 2259 | (file |
| 2257 | `(,(format "/%s::" tramp-default-method) | 2260 | `(,(format "/%s::" tramp-default-method) |
| @@ -2278,8 +2281,8 @@ This checks also `file-name-as-directory', `file-name-directory', | |||
| 2278 | (skip-unless (tramp--test-emacs29-p)) | 2281 | (skip-unless (tramp--test-emacs29-p)) |
| 2279 | 2282 | ||
| 2280 | ;; We must refill the cache. `file-truename' does it. | 2283 | ;; We must refill the cache. `file-truename' does it. |
| 2281 | (file-truename tramp-test-temporary-file-directory) | 2284 | (file-truename ert-remote-temporary-file-directory) |
| 2282 | (let* ((remote-host (file-remote-p tramp-test-temporary-file-directory)) | 2285 | (let* ((remote-host (file-remote-p ert-remote-temporary-file-directory)) |
| 2283 | (remote-host-nohop | 2286 | (remote-host-nohop |
| 2284 | (tramp-make-tramp-file-name (tramp-dissect-file-name remote-host))) | 2287 | (tramp-make-tramp-file-name (tramp-dissect-file-name remote-host))) |
| 2285 | ;; Not all methods can expand "~". | 2288 | ;; Not all methods can expand "~". |
| @@ -2368,7 +2371,7 @@ This checks also `file-name-as-directory', `file-name-directory', | |||
| 2368 | (insert-file-contents tmp-name2) | 2371 | (insert-file-contents tmp-name2) |
| 2369 | (should (string-equal (buffer-string) "foo"))) | 2372 | (should (string-equal (buffer-string) "foo"))) |
| 2370 | ;; Check also that a file transfer with compression works. | 2373 | ;; Check also that a file transfer with compression works. |
| 2371 | (let ((default-directory tramp-test-temporary-file-directory) | 2374 | (let ((default-directory ert-remote-temporary-file-directory) |
| 2372 | (tramp-copy-size-limit 4) | 2375 | (tramp-copy-size-limit 4) |
| 2373 | (tramp-inline-compress-start-size 2)) | 2376 | (tramp-inline-compress-start-size 2)) |
| 2374 | (delete-file tmp-name2) | 2377 | (delete-file tmp-name2) |
| @@ -2568,7 +2571,7 @@ This checks also `file-name-as-directory', `file-name-directory', | |||
| 2568 | ;; The function was introduced in Emacs 28.1. | 2571 | ;; The function was introduced in Emacs 28.1. |
| 2569 | (skip-unless (boundp 'tar-goto-file)) | 2572 | (skip-unless (boundp 'tar-goto-file)) |
| 2570 | 2573 | ||
| 2571 | (let* ((default-directory tramp-test-temporary-file-directory) | 2574 | (let* ((default-directory ert-remote-temporary-file-directory) |
| 2572 | (archive (ert-resource-file "foo.tar.gz")) | 2575 | (archive (ert-resource-file "foo.tar.gz")) |
| 2573 | (tmp-file (expand-file-name (file-name-nondirectory archive))) | 2576 | (tmp-file (expand-file-name (file-name-nondirectory archive))) |
| 2574 | (require-final-newline t) | 2577 | (require-final-newline t) |
| @@ -3258,7 +3261,7 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." | |||
| 3258 | (ert-deftest tramp-test17-dired-with-wildcards () | 3261 | (ert-deftest tramp-test17-dired-with-wildcards () |
| 3259 | "Check `dired' with wildcards." | 3262 | "Check `dired' with wildcards." |
| 3260 | ;; `separate' syntax and IPv6 host name syntax do not work. | 3263 | ;; `separate' syntax and IPv6 host name syntax do not work. |
| 3261 | (skip-unless (not (string-match-p "\\[" tramp-test-temporary-file-directory))) | 3264 | (skip-unless (not (string-match-p "\\[" ert-remote-temporary-file-directory))) |
| 3262 | (skip-unless (tramp--test-enabled)) | 3265 | (skip-unless (tramp--test-enabled)) |
| 3263 | (skip-unless (tramp--test-sh-p)) | 3266 | (skip-unless (tramp--test-sh-p)) |
| 3264 | (skip-unless (not (tramp--test-rsync-p))) | 3267 | (skip-unless (not (tramp--test-rsync-p))) |
| @@ -3272,10 +3275,10 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." | |||
| 3272 | (expand-file-name (tramp--test-make-temp-name nil quoted))) | 3275 | (expand-file-name (tramp--test-make-temp-name nil quoted))) |
| 3273 | (tmp-name3 (expand-file-name "foo" tmp-name1)) | 3276 | (tmp-name3 (expand-file-name "foo" tmp-name1)) |
| 3274 | (tmp-name4 (expand-file-name "bar" tmp-name2)) | 3277 | (tmp-name4 (expand-file-name "bar" tmp-name2)) |
| 3275 | (tramp-test-temporary-file-directory | 3278 | (ert-remote-temporary-file-directory |
| 3276 | (funcall | 3279 | (funcall |
| 3277 | (if quoted #'tramp-compat-file-name-quote #'identity) | 3280 | (if quoted #'tramp-compat-file-name-quote #'identity) |
| 3278 | tramp-test-temporary-file-directory)) | 3281 | ert-remote-temporary-file-directory)) |
| 3279 | buffer) | 3282 | buffer) |
| 3280 | (unwind-protect | 3283 | (unwind-protect |
| 3281 | (progn | 3284 | (progn |
| @@ -3293,19 +3296,19 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." | |||
| 3293 | (setq buffer | 3296 | (setq buffer |
| 3294 | (dired-noselect | 3297 | (dired-noselect |
| 3295 | (expand-file-name | 3298 | (expand-file-name |
| 3296 | "tramp-test*" tramp-test-temporary-file-directory))) | 3299 | "tramp-test*" ert-remote-temporary-file-directory))) |
| 3297 | (goto-char (point-min)) | 3300 | (goto-char (point-min)) |
| 3298 | (should | 3301 | (should |
| 3299 | (re-search-forward | 3302 | (re-search-forward |
| 3300 | (regexp-quote | 3303 | (regexp-quote |
| 3301 | (file-relative-name | 3304 | (file-relative-name |
| 3302 | tmp-name1 tramp-test-temporary-file-directory)))) | 3305 | tmp-name1 ert-remote-temporary-file-directory)))) |
| 3303 | (goto-char (point-min)) | 3306 | (goto-char (point-min)) |
| 3304 | (should | 3307 | (should |
| 3305 | (re-search-forward | 3308 | (re-search-forward |
| 3306 | (regexp-quote | 3309 | (regexp-quote |
| 3307 | (file-relative-name | 3310 | (file-relative-name |
| 3308 | tmp-name2 tramp-test-temporary-file-directory))))) | 3311 | tmp-name2 ert-remote-temporary-file-directory))))) |
| 3309 | (kill-buffer buffer) | 3312 | (kill-buffer buffer) |
| 3310 | 3313 | ||
| 3311 | ;; Check for expanded directory and file names. | 3314 | ;; Check for expanded directory and file names. |
| @@ -3313,20 +3316,20 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." | |||
| 3313 | (setq buffer | 3316 | (setq buffer |
| 3314 | (dired-noselect | 3317 | (dired-noselect |
| 3315 | (expand-file-name | 3318 | (expand-file-name |
| 3316 | "tramp-test*/*" tramp-test-temporary-file-directory))) | 3319 | "tramp-test*/*" ert-remote-temporary-file-directory))) |
| 3317 | (goto-char (point-min)) | 3320 | (goto-char (point-min)) |
| 3318 | (should | 3321 | (should |
| 3319 | (re-search-forward | 3322 | (re-search-forward |
| 3320 | (regexp-quote | 3323 | (regexp-quote |
| 3321 | (file-relative-name | 3324 | (file-relative-name |
| 3322 | tmp-name3 tramp-test-temporary-file-directory)))) | 3325 | tmp-name3 ert-remote-temporary-file-directory)))) |
| 3323 | (goto-char (point-min)) | 3326 | (goto-char (point-min)) |
| 3324 | (should | 3327 | (should |
| 3325 | (re-search-forward | 3328 | (re-search-forward |
| 3326 | (regexp-quote | 3329 | (regexp-quote |
| 3327 | (file-relative-name | 3330 | (file-relative-name |
| 3328 | tmp-name4 | 3331 | tmp-name4 |
| 3329 | tramp-test-temporary-file-directory))))) | 3332 | ert-remote-temporary-file-directory))))) |
| 3330 | (kill-buffer buffer) | 3333 | (kill-buffer buffer) |
| 3331 | 3334 | ||
| 3332 | ;; Check for special characters. | 3335 | ;; Check for special characters. |
| @@ -3341,20 +3344,20 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." | |||
| 3341 | (setq buffer | 3344 | (setq buffer |
| 3342 | (dired-noselect | 3345 | (dired-noselect |
| 3343 | (expand-file-name | 3346 | (expand-file-name |
| 3344 | "tramp-test*/*" tramp-test-temporary-file-directory))) | 3347 | "tramp-test*/*" ert-remote-temporary-file-directory))) |
| 3345 | (goto-char (point-min)) | 3348 | (goto-char (point-min)) |
| 3346 | (should | 3349 | (should |
| 3347 | (re-search-forward | 3350 | (re-search-forward |
| 3348 | (regexp-quote | 3351 | (regexp-quote |
| 3349 | (file-relative-name | 3352 | (file-relative-name |
| 3350 | tmp-name3 tramp-test-temporary-file-directory)))) | 3353 | tmp-name3 ert-remote-temporary-file-directory)))) |
| 3351 | (goto-char (point-min)) | 3354 | (goto-char (point-min)) |
| 3352 | (should | 3355 | (should |
| 3353 | (re-search-forward | 3356 | (re-search-forward |
| 3354 | (regexp-quote | 3357 | (regexp-quote |
| 3355 | (file-relative-name | 3358 | (file-relative-name |
| 3356 | tmp-name4 | 3359 | tmp-name4 |
| 3357 | tramp-test-temporary-file-directory))))) | 3360 | ert-remote-temporary-file-directory))))) |
| 3358 | (kill-buffer buffer)) | 3361 | (kill-buffer buffer)) |
| 3359 | 3362 | ||
| 3360 | ;; Cleanup. | 3363 | ;; Cleanup. |
| @@ -3427,8 +3430,8 @@ This tests also `access-file', `file-readable-p', | |||
| 3427 | ;; We must use `file-truename' for the temporary directory, | 3430 | ;; We must use `file-truename' for the temporary directory, |
| 3428 | ;; because it could be located on a symlinked directory. This | 3431 | ;; because it could be located on a symlinked directory. This |
| 3429 | ;; would let the test fail. | 3432 | ;; would let the test fail. |
| 3430 | (let* ((tramp-test-temporary-file-directory | 3433 | (let* ((ert-remote-temporary-file-directory |
| 3431 | (file-truename tramp-test-temporary-file-directory)) | 3434 | (file-truename ert-remote-temporary-file-directory)) |
| 3432 | (tmp-name1 (tramp--test-make-temp-name nil quoted)) | 3435 | (tmp-name1 (tramp--test-make-temp-name nil quoted)) |
| 3433 | (tmp-name2 (tramp--test-make-temp-name nil quoted)) | 3436 | (tmp-name2 (tramp--test-make-temp-name nil quoted)) |
| 3434 | ;; File name with "//". | 3437 | ;; File name with "//". |
| @@ -3448,7 +3451,7 @@ This tests also `access-file', `file-readable-p', | |||
| 3448 | (and test-file-ownership-preserved-p | 3451 | (and test-file-ownership-preserved-p |
| 3449 | (zerop (logand | 3452 | (zerop (logand |
| 3450 | #o1000 | 3453 | #o1000 |
| 3451 | (file-modes tramp-test-temporary-file-directory)))) | 3454 | (file-modes ert-remote-temporary-file-directory)))) |
| 3452 | (write-region "foo" nil tmp-name1) | 3455 | (write-region "foo" nil tmp-name1) |
| 3453 | (setq test-file-ownership-preserved-p | 3456 | (setq test-file-ownership-preserved-p |
| 3454 | (= (file-attribute-group-id (file-attributes tmp-name1)) | 3457 | (= (file-attribute-group-id (file-attributes tmp-name1)) |
| @@ -3527,7 +3530,7 @@ This tests also `access-file', `file-readable-p', | |||
| 3527 | 3530 | ||
| 3528 | ;; Check, that "//" in symlinks are handled properly. | 3531 | ;; Check, that "//" in symlinks are handled properly. |
| 3529 | (with-temp-buffer | 3532 | (with-temp-buffer |
| 3530 | (let ((default-directory tramp-test-temporary-file-directory)) | 3533 | (let ((default-directory ert-remote-temporary-file-directory)) |
| 3531 | (shell-command | 3534 | (shell-command |
| 3532 | (format | 3535 | (format |
| 3533 | "ln -s %s %s" | 3536 | "ln -s %s %s" |
| @@ -3785,8 +3788,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3785 | ;; We must use `file-truename' for the temporary directory, | 3788 | ;; We must use `file-truename' for the temporary directory, |
| 3786 | ;; because it could be located on a symlinked directory. This | 3789 | ;; because it could be located on a symlinked directory. This |
| 3787 | ;; would let the test fail. | 3790 | ;; would let the test fail. |
| 3788 | (let* ((tramp-test-temporary-file-directory | 3791 | (let* ((ert-remote-temporary-file-directory |
| 3789 | (file-truename tramp-test-temporary-file-directory)) | 3792 | (file-truename ert-remote-temporary-file-directory)) |
| 3790 | (tmp-name1 (tramp--test-make-temp-name nil quoted)) | 3793 | (tmp-name1 (tramp--test-make-temp-name nil quoted)) |
| 3791 | (tmp-name2 (tramp--test-make-temp-name nil quoted)) | 3794 | (tmp-name2 (tramp--test-make-temp-name nil quoted)) |
| 3792 | (tmp-name3 (tramp--test-make-temp-name 'local quoted)) | 3795 | (tmp-name3 (tramp--test-make-temp-name 'local quoted)) |
| @@ -3933,7 +3936,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3933 | (should (file-equal-p tmp-name1 tmp-name2)) | 3936 | (should (file-equal-p tmp-name1 tmp-name2)) |
| 3934 | ;; Check relative symlink file name. | 3937 | ;; Check relative symlink file name. |
| 3935 | (delete-file tmp-name2) | 3938 | (delete-file tmp-name2) |
| 3936 | (let ((default-directory tramp-test-temporary-file-directory)) | 3939 | (let ((default-directory ert-remote-temporary-file-directory)) |
| 3937 | (make-symbolic-link (file-name-nondirectory tmp-name1) tmp-name2)) | 3940 | (make-symbolic-link (file-name-nondirectory tmp-name1) tmp-name2)) |
| 3938 | (should (file-symlink-p tmp-name2)) | 3941 | (should (file-symlink-p tmp-name2)) |
| 3939 | (should-not (string-equal tmp-name2 (file-truename tmp-name2))) | 3942 | (should-not (string-equal tmp-name2 (file-truename tmp-name2))) |
| @@ -3980,7 +3983,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3980 | (tramp--test-ignore-make-symbolic-link-error | 3983 | (tramp--test-ignore-make-symbolic-link-error |
| 3981 | (make-directory tmp-name1) | 3984 | (make-directory tmp-name1) |
| 3982 | (should (file-directory-p tmp-name1)) | 3985 | (should (file-directory-p tmp-name1)) |
| 3983 | (let* ((tramp-test-temporary-file-directory | 3986 | (let* ((ert-remote-temporary-file-directory |
| 3984 | (file-truename tmp-name1)) | 3987 | (file-truename tmp-name1)) |
| 3985 | (tmp-name2 (tramp--test-make-temp-name nil quoted)) | 3988 | (tmp-name2 (tramp--test-make-temp-name nil quoted)) |
| 3986 | (tmp-name3 tmp-name2) | 3989 | (tmp-name3 tmp-name2) |
| @@ -4041,7 +4044,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4041 | (directory-file-name | 4044 | (directory-file-name |
| 4042 | (funcall | 4045 | (funcall |
| 4043 | (if quoted #'tramp-compat-file-name-quote #'identity) | 4046 | (if quoted #'tramp-compat-file-name-quote #'identity) |
| 4044 | tramp-test-temporary-file-directory))) | 4047 | ert-remote-temporary-file-directory))) |
| 4045 | (dir2 (file-name-as-directory dir1))) | 4048 | (dir2 (file-name-as-directory dir1))) |
| 4046 | (should (string-equal (file-truename dir1) (expand-file-name dir1))) | 4049 | (should (string-equal (file-truename dir1) (expand-file-name dir1))) |
| 4047 | (should (string-equal (file-truename dir2) (expand-file-name dir2))))))) | 4050 | (should (string-equal (file-truename dir2) (expand-file-name dir2))))))) |
| @@ -4131,7 +4134,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4131 | "Check that `file-acl' and `set-file-acl' work proper." | 4134 | "Check that `file-acl' and `set-file-acl' work proper." |
| 4132 | (skip-unless (tramp--test-enabled)) | 4135 | (skip-unless (tramp--test-enabled)) |
| 4133 | ;; The following test checks also whether `set-file-modes' will work. | 4136 | ;; The following test checks also whether `set-file-modes' will work. |
| 4134 | (skip-unless (file-acl tramp-test-temporary-file-directory)) | 4137 | (skip-unless (file-acl ert-remote-temporary-file-directory)) |
| 4135 | (skip-unless (not (tramp--test-crypt-p))) | 4138 | (skip-unless (not (tramp--test-crypt-p))) |
| 4136 | 4139 | ||
| 4137 | ;; `filename-non-special' has been fixed in Emacs 27.1, see Bug#29579. | 4140 | ;; `filename-non-special' has been fixed in Emacs 27.1, see Bug#29579. |
| @@ -4210,7 +4213,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4210 | "Check `file-selinux-context' and `set-file-selinux-context'." | 4213 | "Check `file-selinux-context' and `set-file-selinux-context'." |
| 4211 | (skip-unless (tramp--test-enabled)) | 4214 | (skip-unless (tramp--test-enabled)) |
| 4212 | (skip-unless | 4215 | (skip-unless |
| 4213 | (not (equal (file-selinux-context tramp-test-temporary-file-directory) | 4216 | (not (equal (file-selinux-context ert-remote-temporary-file-directory) |
| 4214 | '(nil nil nil nil)))) | 4217 | '(nil nil nil nil)))) |
| 4215 | (skip-unless (not (tramp--test-crypt-p))) | 4218 | (skip-unless (not (tramp--test-crypt-p))) |
| 4216 | 4219 | ||
| @@ -4271,7 +4274,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4271 | (let ((default-directory temporary-file-directory)) | 4274 | (let ((default-directory temporary-file-directory)) |
| 4272 | (shell-command-to-string "id -Z")) | 4275 | (shell-command-to-string "id -Z")) |
| 4273 | (let ((default-directory | 4276 | (let ((default-directory |
| 4274 | tramp-test-temporary-file-directory)) | 4277 | ert-remote-temporary-file-directory)) |
| 4275 | (shell-command-to-string "id -Z")))) | 4278 | (shell-command-to-string "id -Z")))) |
| 4276 | 4279 | ||
| 4277 | ;; Two files with same SELinux context. | 4280 | ;; Two files with same SELinux context. |
| @@ -4356,8 +4359,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4356 | ;; does not work on MS Windows. | 4359 | ;; does not work on MS Windows. |
| 4357 | (unless (memq system-type '(cygwin windows-nt)) | 4360 | (unless (memq system-type '(cygwin windows-nt)) |
| 4358 | (let ((tramp-fuse-remove-hidden-files t) | 4361 | (let ((tramp-fuse-remove-hidden-files t) |
| 4359 | (method (file-remote-p tramp-test-temporary-file-directory 'method)) | 4362 | (method (file-remote-p ert-remote-temporary-file-directory 'method)) |
| 4360 | (host (file-remote-p tramp-test-temporary-file-directory 'host)) | 4363 | (host (file-remote-p ert-remote-temporary-file-directory 'host)) |
| 4361 | (orig-syntax tramp-syntax)) | 4364 | (orig-syntax tramp-syntax)) |
| 4362 | (when (and (stringp host) (string-match tramp-host-with-port-regexp host)) | 4365 | (when (and (stringp host) (string-match tramp-host-with-port-regexp host)) |
| 4363 | (setq host (match-string 1 host))) | 4366 | (setq host (match-string 1 host))) |
| @@ -4509,7 +4512,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4509 | (dolist (quoted (if (tramp--test-expensive-test-p) '(nil t) '(nil))) | 4512 | (dolist (quoted (if (tramp--test-expensive-test-p) '(nil t) '(nil))) |
| 4510 | (let* ((tmp-name (tramp--test-make-temp-name nil quoted)) | 4513 | (let* ((tmp-name (tramp--test-make-temp-name nil quoted)) |
| 4511 | (fnnd (file-name-nondirectory tmp-name)) | 4514 | (fnnd (file-name-nondirectory tmp-name)) |
| 4512 | (default-directory tramp-test-temporary-file-directory) | 4515 | (default-directory ert-remote-temporary-file-directory) |
| 4513 | (buffer (get-buffer-create "*tramp-tests*")) | 4516 | (buffer (get-buffer-create "*tramp-tests*")) |
| 4514 | kill-buffer-query-functions) | 4517 | kill-buffer-query-functions) |
| 4515 | (unwind-protect | 4518 | (unwind-protect |
| @@ -4643,7 +4646,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4643 | (skip-unless (tramp--test-supports-processes-p)) | 4646 | (skip-unless (tramp--test-supports-processes-p)) |
| 4644 | 4647 | ||
| 4645 | (dolist (quoted (if (tramp--test-expensive-test-p) '(nil t) '(nil))) | 4648 | (dolist (quoted (if (tramp--test-expensive-test-p) '(nil t) '(nil))) |
| 4646 | (let ((default-directory tramp-test-temporary-file-directory) | 4649 | (let ((default-directory ert-remote-temporary-file-directory) |
| 4647 | (tmp-name (tramp--test-make-temp-name nil quoted)) | 4650 | (tmp-name (tramp--test-make-temp-name nil quoted)) |
| 4648 | kill-buffer-query-functions command proc) | 4651 | kill-buffer-query-functions command proc) |
| 4649 | 4652 | ||
| @@ -4809,7 +4812,7 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'." | |||
| 4809 | :tags (append '(:expensive-test :tramp-asynchronous-processes) | 4812 | :tags (append '(:expensive-test :tramp-asynchronous-processes) |
| 4810 | (and ,unstable '(:unstable))) | 4813 | (and ,unstable '(:unstable))) |
| 4811 | (skip-unless (tramp--test-enabled)) | 4814 | (skip-unless (tramp--test-enabled)) |
| 4812 | (let ((default-directory tramp-test-temporary-file-directory) | 4815 | (let ((default-directory ert-remote-temporary-file-directory) |
| 4813 | (ert-test (ert-get-test ',test)) | 4816 | (ert-test (ert-get-test ',test)) |
| 4814 | (tramp-connection-properties | 4817 | (tramp-connection-properties |
| 4815 | (cons '(nil "direct-async-process" t) | 4818 | (cons '(nil "direct-async-process" t) |
| @@ -4822,7 +4825,7 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'." | |||
| 4822 | (cl-letf (((symbol-function #'tramp--test-enabled) #'tramp--test-always) | 4825 | (cl-letf (((symbol-function #'tramp--test-enabled) #'tramp--test-always) |
| 4823 | ((symbol-function #'internal-default-process-sentinel) | 4826 | ((symbol-function #'internal-default-process-sentinel) |
| 4824 | #'ignore)) | 4827 | #'ignore)) |
| 4825 | (file-truename tramp-test-temporary-file-directory) | 4828 | (file-truename ert-remote-temporary-file-directory) |
| 4826 | (funcall (ert-test-body ert-test))))))) | 4829 | (funcall (ert-test-body ert-test))))))) |
| 4827 | 4830 | ||
| 4828 | (tramp--test--deftest-direct-async-process tramp-test29-start-file-process | 4831 | (tramp--test--deftest-direct-async-process tramp-test29-start-file-process |
| @@ -4839,7 +4842,7 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'." | |||
| 4839 | (skip-unless (tramp--test-emacs27-p)) | 4842 | (skip-unless (tramp--test-emacs27-p)) |
| 4840 | 4843 | ||
| 4841 | (dolist (quoted (if (tramp--test-expensive-test-p) '(nil t) '(nil))) | 4844 | (dolist (quoted (if (tramp--test-expensive-test-p) '(nil t) '(nil))) |
| 4842 | (let ((default-directory tramp-test-temporary-file-directory) | 4845 | (let ((default-directory ert-remote-temporary-file-directory) |
| 4843 | (tmp-name (tramp--test-make-temp-name nil quoted)) | 4846 | (tmp-name (tramp--test-make-temp-name nil quoted)) |
| 4844 | kill-buffer-query-functions command proc) | 4847 | kill-buffer-query-functions command proc) |
| 4845 | (with-no-warnings (should-not (make-process))) | 4848 | (with-no-warnings (should-not (make-process))) |
| @@ -5100,7 +5103,7 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'." | |||
| 5100 | ;; We must use `file-truename' for the temporary directory, in | 5103 | ;; We must use `file-truename' for the temporary directory, in |
| 5101 | ;; order to establish the connection prior running an asynchronous | 5104 | ;; order to establish the connection prior running an asynchronous |
| 5102 | ;; process. | 5105 | ;; process. |
| 5103 | (let ((default-directory (file-truename tramp-test-temporary-file-directory)) | 5106 | (let ((default-directory (file-truename ert-remote-temporary-file-directory)) |
| 5104 | (delete-exited-processes t) | 5107 | (delete-exited-processes t) |
| 5105 | kill-buffer-query-functions command proc) | 5108 | kill-buffer-query-functions command proc) |
| 5106 | (unwind-protect | 5109 | (unwind-protect |
| @@ -5145,7 +5148,7 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'." | |||
| 5145 | ;; We must use `file-truename' for the temporary directory, in | 5148 | ;; We must use `file-truename' for the temporary directory, in |
| 5146 | ;; order to establish the connection prior running an asynchronous | 5149 | ;; order to establish the connection prior running an asynchronous |
| 5147 | ;; process. | 5150 | ;; process. |
| 5148 | (let ((default-directory (file-truename tramp-test-temporary-file-directory)) | 5151 | (let ((default-directory (file-truename ert-remote-temporary-file-directory)) |
| 5149 | (delete-exited-processes t) | 5152 | (delete-exited-processes t) |
| 5150 | kill-buffer-query-functions command proc) | 5153 | kill-buffer-query-functions command proc) |
| 5151 | 5154 | ||
| @@ -5207,7 +5210,7 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'." | |||
| 5207 | ;; `list-system-processes' is supported since Emacs 29.1. | 5210 | ;; `list-system-processes' is supported since Emacs 29.1. |
| 5208 | (skip-unless (tramp--test-emacs29-p)) | 5211 | (skip-unless (tramp--test-emacs29-p)) |
| 5209 | 5212 | ||
| 5210 | (let ((default-directory tramp-test-temporary-file-directory)) | 5213 | (let ((default-directory ert-remote-temporary-file-directory)) |
| 5211 | (skip-unless (consp (list-system-processes))) | 5214 | (skip-unless (consp (list-system-processes))) |
| 5212 | (should (not (equal (list-system-processes) | 5215 | (should (not (equal (list-system-processes) |
| 5213 | (let ((default-directory temporary-file-directory)) | 5216 | (let ((default-directory temporary-file-directory)) |
| @@ -5224,7 +5227,7 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'." | |||
| 5224 | ;; We must use `file-truename' for the temporary directory, in | 5227 | ;; We must use `file-truename' for the temporary directory, in |
| 5225 | ;; order to establish the connection prior running an asynchronous | 5228 | ;; order to establish the connection prior running an asynchronous |
| 5226 | ;; process. | 5229 | ;; process. |
| 5227 | (let ((default-directory (file-truename tramp-test-temporary-file-directory)) | 5230 | (let ((default-directory (file-truename ert-remote-temporary-file-directory)) |
| 5228 | (delete-exited-processes t) | 5231 | (delete-exited-processes t) |
| 5229 | kill-buffer-query-functions command proc) | 5232 | kill-buffer-query-functions command proc) |
| 5230 | (skip-unless (consp (list-system-processes))) | 5233 | (skip-unless (consp (list-system-processes))) |
| @@ -5282,7 +5285,7 @@ INPUT, if non-nil, is a string sent to the process." | |||
| 5282 | 5285 | ||
| 5283 | (dolist (quoted (if (tramp--test-expensive-test-p) '(nil t) '(nil))) | 5286 | (dolist (quoted (if (tramp--test-expensive-test-p) '(nil t) '(nil))) |
| 5284 | (let ((tmp-name (tramp--test-make-temp-name nil quoted)) | 5287 | (let ((tmp-name (tramp--test-make-temp-name nil quoted)) |
| 5285 | (default-directory tramp-test-temporary-file-directory) | 5288 | (default-directory ert-remote-temporary-file-directory) |
| 5286 | ;; Suppress nasty messages. | 5289 | ;; Suppress nasty messages. |
| 5287 | (inhibit-message t) | 5290 | (inhibit-message t) |
| 5288 | kill-buffer-query-functions) | 5291 | kill-buffer-query-functions) |
| @@ -5363,7 +5366,7 @@ INPUT, if non-nil, is a string sent to the process." | |||
| 5363 | (when (and (tramp--test-asynchronous-processes-p) | 5366 | (when (and (tramp--test-asynchronous-processes-p) |
| 5364 | (tramp--test-sh-p) (tramp--test-emacs27-p)) | 5367 | (tramp--test-sh-p) (tramp--test-emacs27-p)) |
| 5365 | (let* ((async-shell-command-width 1024) | 5368 | (let* ((async-shell-command-width 1024) |
| 5366 | (default-directory tramp-test-temporary-file-directory) | 5369 | (default-directory ert-remote-temporary-file-directory) |
| 5367 | (cols (ignore-errors | 5370 | (cols (ignore-errors |
| 5368 | (read (tramp--test-shell-command-to-string-asynchronously | 5371 | (read (tramp--test-shell-command-to-string-asynchronously |
| 5369 | "tput cols"))))) | 5372 | "tput cols"))))) |
| @@ -5415,7 +5418,7 @@ INPUT, if non-nil, is a string sent to the process." | |||
| 5415 | ;; We check both the local and remote case, in order to guarantee | 5418 | ;; We check both the local and remote case, in order to guarantee |
| 5416 | ;; that they behave similar. | 5419 | ;; that they behave similar. |
| 5417 | (dolist (default-directory | 5420 | (dolist (default-directory |
| 5418 | `(,temporary-file-directory ,tramp-test-temporary-file-directory)) | 5421 | `(,temporary-file-directory ,ert-remote-temporary-file-directory)) |
| 5419 | ;; These are the possible values of `shell-command-dont-erase-buffer'. | 5422 | ;; These are the possible values of `shell-command-dont-erase-buffer'. |
| 5420 | ;; `random' is taken as non-nil value without special meaning. | 5423 | ;; `random' is taken as non-nil value without special meaning. |
| 5421 | (dolist (shell-command-dont-erase-buffer | 5424 | (dolist (shell-command-dont-erase-buffer |
| @@ -5515,7 +5518,7 @@ INPUT, if non-nil, is a string sent to the process." | |||
| 5515 | (and (tramp--test-asynchronous-processes-p) | 5518 | (and (tramp--test-asynchronous-processes-p) |
| 5516 | '(tramp--test-shell-command-to-string-asynchronously)))) | 5519 | '(tramp--test-shell-command-to-string-asynchronously)))) |
| 5517 | 5520 | ||
| 5518 | (let ((default-directory tramp-test-temporary-file-directory) | 5521 | (let ((default-directory ert-remote-temporary-file-directory) |
| 5519 | (shell-file-name "/bin/sh") | 5522 | (shell-file-name "/bin/sh") |
| 5520 | (envvar (concat "VAR_" (upcase (md5 (current-time-string))))) | 5523 | (envvar (concat "VAR_" (upcase (md5 (current-time-string))))) |
| 5521 | kill-buffer-query-functions) | 5524 | kill-buffer-query-functions) |
| @@ -5606,7 +5609,7 @@ Use direct async.") | |||
| 5606 | (skip-unless (not (tramp--test-crypt-p))) | 5609 | (skip-unless (not (tramp--test-crypt-p))) |
| 5607 | 5610 | ||
| 5608 | ;; We force a reconnect, in order to have a clean environment. | 5611 | ;; We force a reconnect, in order to have a clean environment. |
| 5609 | (dolist (dir `(,tramp-test-temporary-file-directory | 5612 | (dolist (dir `(,ert-remote-temporary-file-directory |
| 5610 | "/mock:localhost#11111:" "/mock:localhost#22222:")) | 5613 | "/mock:localhost#11111:" "/mock:localhost#22222:")) |
| 5611 | (tramp-cleanup-connection | 5614 | (tramp-cleanup-connection |
| 5612 | (tramp-dissect-file-name dir) 'keep-debug 'keep-password)) | 5615 | (tramp-dissect-file-name dir) 'keep-debug 'keep-password)) |
| @@ -5640,7 +5643,7 @@ Use direct async.") | |||
| 5640 | ;; Since Emacs 27.1. | 5643 | ;; Since Emacs 27.1. |
| 5641 | (skip-unless (macrop 'with-connection-local-variables)) | 5644 | (skip-unless (macrop 'with-connection-local-variables)) |
| 5642 | 5645 | ||
| 5643 | (let* ((default-directory tramp-test-temporary-file-directory) | 5646 | (let* ((default-directory ert-remote-temporary-file-directory) |
| 5644 | (tmp-name1 (tramp--test-make-temp-name)) | 5647 | (tmp-name1 (tramp--test-make-temp-name)) |
| 5645 | (tmp-name2 (expand-file-name "foo" tmp-name1)) | 5648 | (tmp-name2 (expand-file-name "foo" tmp-name1)) |
| 5646 | (enable-local-variables :all) | 5649 | (enable-local-variables :all) |
| @@ -5707,7 +5710,7 @@ Use direct async.") | |||
| 5707 | (when (tramp--test-adb-p) | 5710 | (when (tramp--test-adb-p) |
| 5708 | (skip-unless (tramp--test-emacs27-p))) | 5711 | (skip-unless (tramp--test-emacs27-p))) |
| 5709 | 5712 | ||
| 5710 | (let ((default-directory tramp-test-temporary-file-directory) | 5713 | (let ((default-directory ert-remote-temporary-file-directory) |
| 5711 | explicit-shell-file-name kill-buffer-query-functions | 5714 | explicit-shell-file-name kill-buffer-query-functions |
| 5712 | connection-local-profile-alist connection-local-criteria-alist) | 5715 | connection-local-profile-alist connection-local-criteria-alist) |
| 5713 | (unwind-protect | 5716 | (unwind-protect |
| @@ -5757,7 +5760,7 @@ Use direct async.") | |||
| 5757 | (skip-unless (fboundp 'exec-path)) | 5760 | (skip-unless (fboundp 'exec-path)) |
| 5758 | 5761 | ||
| 5759 | (let ((tmp-name (tramp--test-make-temp-name)) | 5762 | (let ((tmp-name (tramp--test-make-temp-name)) |
| 5760 | (default-directory tramp-test-temporary-file-directory)) | 5763 | (default-directory ert-remote-temporary-file-directory)) |
| 5761 | (unwind-protect | 5764 | (unwind-protect |
| 5762 | (progn | 5765 | (progn |
| 5763 | (should (consp (with-no-warnings (exec-path)))) | 5766 | (should (consp (with-no-warnings (exec-path)))) |
| @@ -5802,7 +5805,7 @@ Use direct async.") | |||
| 5802 | (skip-unless (fboundp 'exec-path)) | 5805 | (skip-unless (fboundp 'exec-path)) |
| 5803 | 5806 | ||
| 5804 | (let* ((tmp-name (tramp--test-make-temp-name)) | 5807 | (let* ((tmp-name (tramp--test-make-temp-name)) |
| 5805 | (default-directory tramp-test-temporary-file-directory) | 5808 | (default-directory ert-remote-temporary-file-directory) |
| 5806 | (orig-exec-path (with-no-warnings (exec-path))) | 5809 | (orig-exec-path (with-no-warnings (exec-path))) |
| 5807 | (tramp-remote-path tramp-remote-path) | 5810 | (tramp-remote-path tramp-remote-path) |
| 5808 | (orig-tramp-remote-path tramp-remote-path) | 5811 | (orig-tramp-remote-path tramp-remote-path) |
| @@ -5869,7 +5872,7 @@ Use direct async.") | |||
| 5869 | ;; order to establish the connection prior running an asynchronous | 5872 | ;; order to establish the connection prior running an asynchronous |
| 5870 | ;; process. | 5873 | ;; process. |
| 5871 | (let* ((default-directory | 5874 | (let* ((default-directory |
| 5872 | (file-truename tramp-test-temporary-file-directory)) | 5875 | (file-truename ert-remote-temporary-file-directory)) |
| 5873 | (tmp-name1 (tramp--test-make-temp-name nil quoted)) | 5876 | (tmp-name1 (tramp--test-make-temp-name nil quoted)) |
| 5874 | (tmp-name2 (expand-file-name "foo" tmp-name1)) | 5877 | (tmp-name2 (expand-file-name "foo" tmp-name1)) |
| 5875 | (tramp-remote-process-environment tramp-remote-process-environment) | 5878 | (tramp-remote-process-environment tramp-remote-process-environment) |
| @@ -5973,7 +5976,7 @@ Use direct async.") | |||
| 5973 | (if quoted #'tramp-compat-file-name-quote #'identity) | 5976 | (if quoted #'tramp-compat-file-name-quote #'identity) |
| 5974 | (expand-file-name | 5977 | (expand-file-name |
| 5975 | (format "#%s#" (file-name-nondirectory tmp-name1)) | 5978 | (format "#%s#" (file-name-nondirectory tmp-name1)) |
| 5976 | tramp-test-temporary-file-directory)))))) | 5979 | ert-remote-temporary-file-directory)))))) |
| 5977 | 5980 | ||
| 5978 | ;; Use default `tramp-auto-save-directory' mechanism. | 5981 | ;; Use default `tramp-auto-save-directory' mechanism. |
| 5979 | ;; Ange-FTP doesn't care. | 5982 | ;; Ange-FTP doesn't care. |
| @@ -6078,7 +6081,7 @@ Use direct async.") | |||
| 6078 | (if quoted #'tramp-compat-file-name-quote #'identity) | 6081 | (if quoted #'tramp-compat-file-name-quote #'identity) |
| 6079 | (expand-file-name | 6082 | (expand-file-name |
| 6080 | (format "%s~" (file-name-nondirectory tmp-name1)) | 6083 | (format "%s~" (file-name-nondirectory tmp-name1)) |
| 6081 | tramp-test-temporary-file-directory))))))) | 6084 | ert-remote-temporary-file-directory))))))) |
| 6082 | 6085 | ||
| 6083 | (unwind-protect | 6086 | (unwind-protect |
| 6084 | ;; Map `backup-directory-alist'. | 6087 | ;; Map `backup-directory-alist'. |
| @@ -6411,7 +6414,7 @@ Use direct async.") | |||
| 6411 | (skip-unless (tramp--test-enabled)) | 6414 | (skip-unless (tramp--test-enabled)) |
| 6412 | (skip-unless (not (tramp--test-ange-ftp-p))) | 6415 | (skip-unless (not (tramp--test-ange-ftp-p))) |
| 6413 | 6416 | ||
| 6414 | (let ((default-directory tramp-test-temporary-file-directory) | 6417 | (let ((default-directory ert-remote-temporary-file-directory) |
| 6415 | tmp-file) | 6418 | tmp-file) |
| 6416 | ;; The remote host shall know a temporary file directory. | 6419 | ;; The remote host shall know a temporary file directory. |
| 6417 | (should (stringp (temporary-file-directory))) | 6420 | (should (stringp (temporary-file-directory))) |
| @@ -6458,7 +6461,7 @@ variables, so we check the Emacs version directly." | |||
| 6458 | (defun tramp--test-adb-p () | 6461 | (defun tramp--test-adb-p () |
| 6459 | "Check, whether the remote host runs Android. | 6462 | "Check, whether the remote host runs Android. |
| 6460 | This requires restrictions of file name syntax." | 6463 | This requires restrictions of file name syntax." |
| 6461 | (tramp-adb-file-name-p tramp-test-temporary-file-directory)) | 6464 | (tramp-adb-file-name-p ert-remote-temporary-file-directory)) |
| 6462 | 6465 | ||
| 6463 | (defun tramp--test-ange-ftp-p () | 6466 | (defun tramp--test-ange-ftp-p () |
| 6464 | "Check, whether Ange-FTP is used." | 6467 | "Check, whether Ange-FTP is used." |
| @@ -6481,13 +6484,13 @@ This is used in tests which we don't want to tag | |||
| 6481 | 6484 | ||
| 6482 | (defun tramp--test-crypt-p () | 6485 | (defun tramp--test-crypt-p () |
| 6483 | "Check, whether the remote directory is crypted." | 6486 | "Check, whether the remote directory is crypted." |
| 6484 | (tramp-crypt-file-name-p tramp-test-temporary-file-directory)) | 6487 | (tramp-crypt-file-name-p ert-remote-temporary-file-directory)) |
| 6485 | 6488 | ||
| 6486 | (defun tramp--test-docker-p () | 6489 | (defun tramp--test-docker-p () |
| 6487 | "Check, whether the docker method is used. | 6490 | "Check, whether the docker method is used. |
| 6488 | This does not support some special file names." | 6491 | This does not support some special file names." |
| 6489 | (string-equal | 6492 | (string-equal |
| 6490 | "docker" (file-remote-p tramp-test-temporary-file-directory 'method))) | 6493 | "docker" (file-remote-p ert-remote-temporary-file-directory 'method))) |
| 6491 | 6494 | ||
| 6492 | (defun tramp--test-expensive-test-p () | 6495 | (defun tramp--test-expensive-test-p () |
| 6493 | "Whether expensive tests are run. | 6496 | "Whether expensive tests are run. |
| @@ -6503,7 +6506,7 @@ completely." | |||
| 6503 | This does not support globbing characters in file names (yet)." | 6506 | This does not support globbing characters in file names (yet)." |
| 6504 | ;; Globbing characters are ??, ?* and ?\[. | 6507 | ;; Globbing characters are ??, ?* and ?\[. |
| 6505 | (string-match-p | 6508 | (string-match-p |
| 6506 | "ftp$" (file-remote-p tramp-test-temporary-file-directory 'method))) | 6509 | "ftp$" (file-remote-p ert-remote-temporary-file-directory 'method))) |
| 6507 | 6510 | ||
| 6508 | (defun tramp--test-fuse-p () | 6511 | (defun tramp--test-fuse-p () |
| 6509 | "Check, whether an FUSE file system isused." | 6512 | "Check, whether an FUSE file system isused." |
| @@ -6512,20 +6515,20 @@ This does not support globbing characters in file names (yet)." | |||
| 6512 | (defun tramp--test-gdrive-p () | 6515 | (defun tramp--test-gdrive-p () |
| 6513 | "Check, whether the gdrive method is used." | 6516 | "Check, whether the gdrive method is used." |
| 6514 | (string-equal | 6517 | (string-equal |
| 6515 | "gdrive" (file-remote-p tramp-test-temporary-file-directory 'method))) | 6518 | "gdrive" (file-remote-p ert-remote-temporary-file-directory 'method))) |
| 6516 | 6519 | ||
| 6517 | (defun tramp--test-gvfs-p (&optional method) | 6520 | (defun tramp--test-gvfs-p (&optional method) |
| 6518 | "Check, whether the remote host runs a GVFS based method. | 6521 | "Check, whether the remote host runs a GVFS based method. |
| 6519 | This requires restrictions of file name syntax. | 6522 | This requires restrictions of file name syntax. |
| 6520 | If optional METHOD is given, it is checked first." | 6523 | If optional METHOD is given, it is checked first." |
| 6521 | (or (member method tramp-gvfs-methods) | 6524 | (or (member method tramp-gvfs-methods) |
| 6522 | (tramp-gvfs-file-name-p tramp-test-temporary-file-directory))) | 6525 | (tramp-gvfs-file-name-p ert-remote-temporary-file-directory))) |
| 6523 | 6526 | ||
| 6524 | (defun tramp--test-hpux-p () | 6527 | (defun tramp--test-hpux-p () |
| 6525 | "Check, whether the remote host runs HP-UX. | 6528 | "Check, whether the remote host runs HP-UX. |
| 6526 | Several special characters do not work properly there." | 6529 | Several special characters do not work properly there." |
| 6527 | ;; We must refill the cache. `file-truename' does it. | 6530 | ;; We must refill the cache. `file-truename' does it. |
| 6528 | (file-truename tramp-test-temporary-file-directory) | 6531 | (file-truename ert-remote-temporary-file-directory) |
| 6529 | (ignore-errors (tramp-check-remote-uname tramp-test-vec "^HP-UX"))) | 6532 | (ignore-errors (tramp-check-remote-uname tramp-test-vec "^HP-UX"))) |
| 6530 | 6533 | ||
| 6531 | (defun tramp--test-ksh-p () | 6534 | (defun tramp--test-ksh-p () |
| @@ -6533,21 +6536,21 @@ Several special characters do not work properly there." | |||
| 6533 | ksh93 makes some strange conversions of non-latin characters into | 6536 | ksh93 makes some strange conversions of non-latin characters into |
| 6534 | a $'' syntax." | 6537 | a $'' syntax." |
| 6535 | ;; We must refill the cache. `file-truename' does it. | 6538 | ;; We must refill the cache. `file-truename' does it. |
| 6536 | (file-truename tramp-test-temporary-file-directory) | 6539 | (file-truename ert-remote-temporary-file-directory) |
| 6537 | (string-match-p | 6540 | (string-match-p |
| 6538 | "ksh$" (tramp-get-connection-property tramp-test-vec "remote-shell" ""))) | 6541 | "ksh$" (tramp-get-connection-property tramp-test-vec "remote-shell" ""))) |
| 6539 | 6542 | ||
| 6540 | (defun tramp--test-macos-p () | 6543 | (defun tramp--test-macos-p () |
| 6541 | "Check, whether the remote host runs macOS." | 6544 | "Check, whether the remote host runs macOS." |
| 6542 | ;; We must refill the cache. `file-truename' does it. | 6545 | ;; We must refill the cache. `file-truename' does it. |
| 6543 | (file-truename tramp-test-temporary-file-directory) | 6546 | (file-truename ert-remote-temporary-file-directory) |
| 6544 | (ignore-errors (tramp-check-remote-uname tramp-test-vec "Darwin"))) | 6547 | (ignore-errors (tramp-check-remote-uname tramp-test-vec "Darwin"))) |
| 6545 | 6548 | ||
| 6546 | (defun tramp--test-mock-p () | 6549 | (defun tramp--test-mock-p () |
| 6547 | "Check, whether the mock method is used. | 6550 | "Check, whether the mock method is used. |
| 6548 | This does not support external Emacs calls." | 6551 | This does not support external Emacs calls." |
| 6549 | (string-equal | 6552 | (string-equal |
| 6550 | "mock" (file-remote-p tramp-test-temporary-file-directory 'method))) | 6553 | "mock" (file-remote-p ert-remote-temporary-file-directory 'method))) |
| 6551 | 6554 | ||
| 6552 | (defun tramp--test-out-of-band-p () | 6555 | (defun tramp--test-out-of-band-p () |
| 6553 | "Check, whether an out-of-band method is used." | 6556 | "Check, whether an out-of-band method is used." |
| @@ -6556,13 +6559,13 @@ This does not support external Emacs calls." | |||
| 6556 | (defun tramp--test-rclone-p () | 6559 | (defun tramp--test-rclone-p () |
| 6557 | "Check, whether the remote host is offered by rclone. | 6560 | "Check, whether the remote host is offered by rclone. |
| 6558 | This requires restrictions of file name syntax." | 6561 | This requires restrictions of file name syntax." |
| 6559 | (tramp-rclone-file-name-p tramp-test-temporary-file-directory)) | 6562 | (tramp-rclone-file-name-p ert-remote-temporary-file-directory)) |
| 6560 | 6563 | ||
| 6561 | (defun tramp--test-rsync-p () | 6564 | (defun tramp--test-rsync-p () |
| 6562 | "Check, whether the rsync method is used. | 6565 | "Check, whether the rsync method is used. |
| 6563 | This does not support special file names." | 6566 | This does not support special file names." |
| 6564 | (string-equal | 6567 | (string-equal |
| 6565 | "rsync" (file-remote-p tramp-test-temporary-file-directory 'method))) | 6568 | "rsync" (file-remote-p ert-remote-temporary-file-directory 'method))) |
| 6566 | 6569 | ||
| 6567 | (defun tramp--test-sh-p () | 6570 | (defun tramp--test-sh-p () |
| 6568 | "Check, whether the remote host runs a based method from tramp-sh.el." | 6571 | "Check, whether the remote host runs a based method from tramp-sh.el." |
| @@ -6576,7 +6579,7 @@ Additionally, ls does not support \"--dired\"." | |||
| 6576 | ;; We must refill the cache. `insert-directory' does it. | 6579 | ;; We must refill the cache. `insert-directory' does it. |
| 6577 | ;; This fails for tramp-crypt.el, so we ignore that. | 6580 | ;; This fails for tramp-crypt.el, so we ignore that. |
| 6578 | (ignore-errors | 6581 | (ignore-errors |
| 6579 | (insert-directory tramp-test-temporary-file-directory "-al")) | 6582 | (insert-directory ert-remote-temporary-file-directory "-al")) |
| 6580 | (not (tramp-get-connection-property tramp-test-vec "ls--dired" nil))))) | 6583 | (not (tramp-get-connection-property tramp-test-vec "ls--dired" nil))))) |
| 6581 | 6584 | ||
| 6582 | (defun tramp--test-share-p () | 6585 | (defun tramp--test-share-p () |
| @@ -6584,22 +6587,22 @@ Additionally, ls does not support \"--dired\"." | |||
| 6584 | (and (tramp--test-gvfs-p) | 6587 | (and (tramp--test-gvfs-p) |
| 6585 | (string-match-p | 6588 | (string-match-p |
| 6586 | "^\\(afp\\|davs?\\|smb\\)$" | 6589 | "^\\(afp\\|davs?\\|smb\\)$" |
| 6587 | (file-remote-p tramp-test-temporary-file-directory 'method)))) | 6590 | (file-remote-p ert-remote-temporary-file-directory 'method)))) |
| 6588 | 6591 | ||
| 6589 | (defun tramp--test-sshfs-p () | 6592 | (defun tramp--test-sshfs-p () |
| 6590 | "Check, whether the remote host is offered by sshfs. | 6593 | "Check, whether the remote host is offered by sshfs. |
| 6591 | This requires restrictions of file name syntax." | 6594 | This requires restrictions of file name syntax." |
| 6592 | (tramp-sshfs-file-name-p tramp-test-temporary-file-directory)) | 6595 | (tramp-sshfs-file-name-p ert-remote-temporary-file-directory)) |
| 6593 | 6596 | ||
| 6594 | (defun tramp--test-sudoedit-p () | 6597 | (defun tramp--test-sudoedit-p () |
| 6595 | "Check, whether the sudoedit method is used." | 6598 | "Check, whether the sudoedit method is used." |
| 6596 | (tramp-sudoedit-file-name-p tramp-test-temporary-file-directory)) | 6599 | (tramp-sudoedit-file-name-p ert-remote-temporary-file-directory)) |
| 6597 | 6600 | ||
| 6598 | (defun tramp--test-telnet-p () | 6601 | (defun tramp--test-telnet-p () |
| 6599 | "Check, whether the telnet method is used. | 6602 | "Check, whether the telnet method is used. |
| 6600 | This does not support special file names." | 6603 | This does not support special file names." |
| 6601 | (string-equal | 6604 | (string-equal |
| 6602 | "telnet" (file-remote-p tramp-test-temporary-file-directory 'method))) | 6605 | "telnet" (file-remote-p ert-remote-temporary-file-directory 'method))) |
| 6603 | 6606 | ||
| 6604 | (defun tramp--test-windows-nt-p () | 6607 | (defun tramp--test-windows-nt-p () |
| 6605 | "Check, whether the locale host runs MS Windows." | 6608 | "Check, whether the locale host runs MS Windows." |
| @@ -6620,7 +6623,7 @@ This requires restrictions of file name syntax." | |||
| 6620 | (defun tramp--test-smb-p () | 6623 | (defun tramp--test-smb-p () |
| 6621 | "Check, whether the locale or remote host runs MS Windows. | 6624 | "Check, whether the locale or remote host runs MS Windows. |
| 6622 | This requires restrictions of file name syntax." | 6625 | This requires restrictions of file name syntax." |
| 6623 | (tramp-smb-file-name-p tramp-test-temporary-file-directory)) | 6626 | (tramp-smb-file-name-p ert-remote-temporary-file-directory)) |
| 6624 | 6627 | ||
| 6625 | (defun tramp--test-supports-processes-p () | 6628 | (defun tramp--test-supports-processes-p () |
| 6626 | "Return whether the method under test supports external processes." | 6629 | "Return whether the method under test supports external processes." |
| @@ -6636,7 +6639,7 @@ This requires restrictions of file name syntax." | |||
| 6636 | (and | 6639 | (and |
| 6637 | (tramp--test-gvfs-p) | 6640 | (tramp--test-gvfs-p) |
| 6638 | (string-match-p | 6641 | (string-match-p |
| 6639 | "ftp" (file-remote-p tramp-test-temporary-file-directory 'method))))) | 6642 | "ftp" (file-remote-p ert-remote-temporary-file-directory 'method))))) |
| 6640 | 6643 | ||
| 6641 | (defun tramp--test-check-files (&rest files) | 6644 | (defun tramp--test-check-files (&rest files) |
| 6642 | "Run a simple but comprehensive test over every file in FILES." | 6645 | "Run a simple but comprehensive test over every file in FILES." |
| @@ -6647,8 +6650,8 @@ This requires restrictions of file name syntax." | |||
| 6647 | ;; We must use `file-truename' for the temporary directory, | 6650 | ;; We must use `file-truename' for the temporary directory, |
| 6648 | ;; because it could be located on a symlinked directory. This | 6651 | ;; because it could be located on a symlinked directory. This |
| 6649 | ;; would let the test fail. | 6652 | ;; would let the test fail. |
| 6650 | (let* ((tramp-test-temporary-file-directory | 6653 | (let* ((ert-remote-temporary-file-directory |
| 6651 | (file-truename tramp-test-temporary-file-directory)) | 6654 | (file-truename ert-remote-temporary-file-directory)) |
| 6652 | (tramp-fuse-remove-hidden-files t) | 6655 | (tramp-fuse-remove-hidden-files t) |
| 6653 | (tmp-name1 (tramp--test-make-temp-name nil quoted)) | 6656 | (tmp-name1 (tramp--test-make-temp-name nil quoted)) |
| 6654 | (tmp-name2 (tramp--test-make-temp-name 'local quoted)) | 6657 | (tmp-name2 (tramp--test-make-temp-name 'local quoted)) |
| @@ -6835,7 +6838,7 @@ This requires restrictions of file name syntax." | |||
| 6835 | (dolist (elt files) | 6838 | (dolist (elt files) |
| 6836 | (let ((envvar (concat "VAR_" (upcase (md5 elt)))) | 6839 | (let ((envvar (concat "VAR_" (upcase (md5 elt)))) |
| 6837 | (elt (encode-coding-string elt coding-system-for-read)) | 6840 | (elt (encode-coding-string elt coding-system-for-read)) |
| 6838 | (default-directory tramp-test-temporary-file-directory) | 6841 | (default-directory ert-remote-temporary-file-directory) |
| 6839 | (process-environment process-environment)) | 6842 | (process-environment process-environment)) |
| 6840 | (setenv envvar elt) | 6843 | (setenv envvar elt) |
| 6841 | ;; The value of PS1 could confuse Tramp's detection | 6844 | ;; The value of PS1 could confuse Tramp's detection |
| @@ -6933,12 +6936,12 @@ Use the \"stat\" command." | |||
| 6933 | (skip-unless (tramp--test-sh-p)) | 6936 | (skip-unless (tramp--test-sh-p)) |
| 6934 | (skip-unless (not (tramp--test-rsync-p))) | 6937 | (skip-unless (not (tramp--test-rsync-p))) |
| 6935 | ;; We cannot use `tramp-test-vec', because this fails during compilation. | 6938 | ;; We cannot use `tramp-test-vec', because this fails during compilation. |
| 6936 | (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil | 6939 | (with-parsed-tramp-file-name ert-remote-temporary-file-directory nil |
| 6937 | (skip-unless (tramp-get-remote-stat v))) | 6940 | (skip-unless (tramp-get-remote-stat v))) |
| 6938 | 6941 | ||
| 6939 | (let ((tramp-connection-properties | 6942 | (let ((tramp-connection-properties |
| 6940 | (append | 6943 | (append |
| 6941 | `((,(regexp-quote (file-remote-p tramp-test-temporary-file-directory)) | 6944 | `((,(regexp-quote (file-remote-p ert-remote-temporary-file-directory)) |
| 6942 | "perl" nil)) | 6945 | "perl" nil)) |
| 6943 | tramp-connection-properties))) | 6946 | tramp-connection-properties))) |
| 6944 | (tramp--test-special-characters))) | 6947 | (tramp--test-special-characters))) |
| @@ -6952,15 +6955,15 @@ Use the \"perl\" command." | |||
| 6952 | (skip-unless (tramp--test-sh-p)) | 6955 | (skip-unless (tramp--test-sh-p)) |
| 6953 | (skip-unless (not (tramp--test-rsync-p))) | 6956 | (skip-unless (not (tramp--test-rsync-p))) |
| 6954 | ;; We cannot use `tramp-test-vec', because this fails during compilation. | 6957 | ;; We cannot use `tramp-test-vec', because this fails during compilation. |
| 6955 | (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil | 6958 | (with-parsed-tramp-file-name ert-remote-temporary-file-directory nil |
| 6956 | (skip-unless (tramp-get-remote-perl v))) | 6959 | (skip-unless (tramp-get-remote-perl v))) |
| 6957 | 6960 | ||
| 6958 | (let ((tramp-connection-properties | 6961 | (let ((tramp-connection-properties |
| 6959 | (append | 6962 | (append |
| 6960 | `((,(regexp-quote (file-remote-p tramp-test-temporary-file-directory)) | 6963 | `((,(regexp-quote (file-remote-p ert-remote-temporary-file-directory)) |
| 6961 | "stat" nil) | 6964 | "stat" nil) |
| 6962 | ;; See `tramp-sh-handle-file-truename'. | 6965 | ;; See `tramp-sh-handle-file-truename'. |
| 6963 | (,(regexp-quote (file-remote-p tramp-test-temporary-file-directory)) | 6966 | (,(regexp-quote (file-remote-p ert-remote-temporary-file-directory)) |
| 6964 | "readlink" nil)) | 6967 | "readlink" nil)) |
| 6965 | tramp-connection-properties))) | 6968 | tramp-connection-properties))) |
| 6966 | (tramp--test-special-characters))) | 6969 | (tramp--test-special-characters))) |
| @@ -6976,12 +6979,12 @@ Use the \"ls\" command." | |||
| 6976 | 6979 | ||
| 6977 | (let ((tramp-connection-properties | 6980 | (let ((tramp-connection-properties |
| 6978 | (append | 6981 | (append |
| 6979 | `((,(regexp-quote (file-remote-p tramp-test-temporary-file-directory)) | 6982 | `((,(regexp-quote (file-remote-p ert-remote-temporary-file-directory)) |
| 6980 | "perl" nil) | 6983 | "perl" nil) |
| 6981 | (,(regexp-quote (file-remote-p tramp-test-temporary-file-directory)) | 6984 | (,(regexp-quote (file-remote-p ert-remote-temporary-file-directory)) |
| 6982 | "stat" nil) | 6985 | "stat" nil) |
| 6983 | ;; See `tramp-sh-handle-file-truename'. | 6986 | ;; See `tramp-sh-handle-file-truename'. |
| 6984 | (,(regexp-quote (file-remote-p tramp-test-temporary-file-directory)) | 6987 | (,(regexp-quote (file-remote-p ert-remote-temporary-file-directory)) |
| 6985 | "readlink" nil)) | 6988 | "readlink" nil)) |
| 6986 | tramp-connection-properties))) | 6989 | tramp-connection-properties))) |
| 6987 | (tramp--test-special-characters))) | 6990 | (tramp--test-special-characters))) |
| @@ -7060,12 +7063,12 @@ Use the \"stat\" command." | |||
| 7060 | (skip-unless (not (tramp--test-ksh-p))) | 7063 | (skip-unless (not (tramp--test-ksh-p))) |
| 7061 | (skip-unless (not (tramp--test-crypt-p))) | 7064 | (skip-unless (not (tramp--test-crypt-p))) |
| 7062 | ;; We cannot use `tramp-test-vec', because this fails during compilation. | 7065 | ;; We cannot use `tramp-test-vec', because this fails during compilation. |
| 7063 | (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil | 7066 | (with-parsed-tramp-file-name ert-remote-temporary-file-directory nil |
| 7064 | (skip-unless (tramp-get-remote-stat v))) | 7067 | (skip-unless (tramp-get-remote-stat v))) |
| 7065 | 7068 | ||
| 7066 | (let ((tramp-connection-properties | 7069 | (let ((tramp-connection-properties |
| 7067 | (append | 7070 | (append |
| 7068 | `((,(regexp-quote (file-remote-p tramp-test-temporary-file-directory)) | 7071 | `((,(regexp-quote (file-remote-p ert-remote-temporary-file-directory)) |
| 7069 | "perl" nil)) | 7072 | "perl" nil)) |
| 7070 | tramp-connection-properties))) | 7073 | tramp-connection-properties))) |
| 7071 | (tramp--test-utf8))) | 7074 | (tramp--test-utf8))) |
| @@ -7083,15 +7086,15 @@ Use the \"perl\" command." | |||
| 7083 | (skip-unless (not (tramp--test-ksh-p))) | 7086 | (skip-unless (not (tramp--test-ksh-p))) |
| 7084 | (skip-unless (not (tramp--test-crypt-p))) | 7087 | (skip-unless (not (tramp--test-crypt-p))) |
| 7085 | ;; We cannot use `tramp-test-vec', because this fails during compilation. | 7088 | ;; We cannot use `tramp-test-vec', because this fails during compilation. |
| 7086 | (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil | 7089 | (with-parsed-tramp-file-name ert-remote-temporary-file-directory nil |
| 7087 | (skip-unless (tramp-get-remote-perl v))) | 7090 | (skip-unless (tramp-get-remote-perl v))) |
| 7088 | 7091 | ||
| 7089 | (let ((tramp-connection-properties | 7092 | (let ((tramp-connection-properties |
| 7090 | (append | 7093 | (append |
| 7091 | `((,(regexp-quote (file-remote-p tramp-test-temporary-file-directory)) | 7094 | `((,(regexp-quote (file-remote-p ert-remote-temporary-file-directory)) |
| 7092 | "stat" nil) | 7095 | "stat" nil) |
| 7093 | ;; See `tramp-sh-handle-file-truename'. | 7096 | ;; See `tramp-sh-handle-file-truename'. |
| 7094 | (,(regexp-quote (file-remote-p tramp-test-temporary-file-directory)) | 7097 | (,(regexp-quote (file-remote-p ert-remote-temporary-file-directory)) |
| 7095 | "readlink" nil)) | 7098 | "readlink" nil)) |
| 7096 | tramp-connection-properties))) | 7099 | tramp-connection-properties))) |
| 7097 | (tramp--test-utf8))) | 7100 | (tramp--test-utf8))) |
| @@ -7111,12 +7114,12 @@ Use the \"ls\" command." | |||
| 7111 | 7114 | ||
| 7112 | (let ((tramp-connection-properties | 7115 | (let ((tramp-connection-properties |
| 7113 | (append | 7116 | (append |
| 7114 | `((,(regexp-quote (file-remote-p tramp-test-temporary-file-directory)) | 7117 | `((,(regexp-quote (file-remote-p ert-remote-temporary-file-directory)) |
| 7115 | "perl" nil) | 7118 | "perl" nil) |
| 7116 | (,(regexp-quote (file-remote-p tramp-test-temporary-file-directory)) | 7119 | (,(regexp-quote (file-remote-p ert-remote-temporary-file-directory)) |
| 7117 | "stat" nil) | 7120 | "stat" nil) |
| 7118 | ;; See `tramp-sh-handle-file-truename'. | 7121 | ;; See `tramp-sh-handle-file-truename'. |
| 7119 | (,(regexp-quote (file-remote-p tramp-test-temporary-file-directory)) | 7122 | (,(regexp-quote (file-remote-p ert-remote-temporary-file-directory)) |
| 7120 | "readlink" nil)) | 7123 | "readlink" nil)) |
| 7121 | tramp-connection-properties))) | 7124 | tramp-connection-properties))) |
| 7122 | (tramp--test-utf8))) | 7125 | (tramp--test-utf8))) |
| @@ -7130,7 +7133,7 @@ Use the \"ls\" command." | |||
| 7130 | ;; `file-system-info' exists since Emacs 27.1. We don't want to see | 7133 | ;; `file-system-info' exists since Emacs 27.1. We don't want to see |
| 7131 | ;; compiler warnings for older Emacsen. | 7134 | ;; compiler warnings for older Emacsen. |
| 7132 | (when-let ((fsi (with-no-warnings | 7135 | (when-let ((fsi (with-no-warnings |
| 7133 | (file-system-info tramp-test-temporary-file-directory)))) | 7136 | (file-system-info ert-remote-temporary-file-directory)))) |
| 7134 | (should (consp fsi)) | 7137 | (should (consp fsi)) |
| 7135 | (should (= (length fsi) 3)) | 7138 | (should (= (length fsi) 3)) |
| 7136 | (dotimes (i (length fsi)) | 7139 | (dotimes (i (length fsi)) |
| @@ -7385,7 +7388,7 @@ process sentinels. They shall not disturb each other." | |||
| 7385 | ;; default handler. | 7388 | ;; default handler. |
| 7386 | (skip-unless (not (tramp--test-emacs29-p))) | 7389 | (skip-unless (not (tramp--test-emacs29-p))) |
| 7387 | 7390 | ||
| 7388 | (let ((default-directory tramp-test-temporary-file-directory) | 7391 | (let ((default-directory ert-remote-temporary-file-directory) |
| 7389 | (tmp-name (tramp--test-make-temp-name))) | 7392 | (tmp-name (tramp--test-make-temp-name))) |
| 7390 | (write-region "foo" nil tmp-name) | 7393 | (write-region "foo" nil tmp-name) |
| 7391 | (dired default-directory) | 7394 | (dired default-directory) |
| @@ -7406,7 +7409,7 @@ process sentinels. They shall not disturb each other." | |||
| 7406 | ;; default handler. | 7409 | ;; default handler. |
| 7407 | (skip-unless (not (tramp--test-emacs29-p))) | 7410 | (skip-unless (not (tramp--test-emacs29-p))) |
| 7408 | 7411 | ||
| 7409 | (let ((default-directory tramp-test-temporary-file-directory) | 7412 | (let ((default-directory ert-remote-temporary-file-directory) |
| 7410 | (tmp-name (tramp--test-make-temp-name))) | 7413 | (tmp-name (tramp--test-make-temp-name))) |
| 7411 | (make-directory tmp-name) | 7414 | (make-directory tmp-name) |
| 7412 | (dired default-directory) | 7415 | (dired default-directory) |
| @@ -7451,17 +7454,17 @@ process sentinels. They shall not disturb each other." | |||
| 7451 | (tramp-cleanup-connection tramp-test-vec 'keep-debug) | 7454 | (tramp-cleanup-connection tramp-test-vec 'keep-debug) |
| 7452 | ;; We don't want to invalidate the password. | 7455 | ;; We don't want to invalidate the password. |
| 7453 | (setq mocked-input `(,(copy-sequence pass))) | 7456 | (setq mocked-input `(,(copy-sequence pass))) |
| 7454 | (should (file-exists-p tramp-test-temporary-file-directory)) | 7457 | (should (file-exists-p ert-remote-temporary-file-directory)) |
| 7455 | 7458 | ||
| 7456 | ;; Don't entering a password returns in error. | 7459 | ;; Don't entering a password returns in error. |
| 7457 | (tramp-cleanup-connection tramp-test-vec 'keep-debug) | 7460 | (tramp-cleanup-connection tramp-test-vec 'keep-debug) |
| 7458 | (setq mocked-input nil) | 7461 | (setq mocked-input nil) |
| 7459 | (should-error (file-exists-p tramp-test-temporary-file-directory)) | 7462 | (should-error (file-exists-p ert-remote-temporary-file-directory)) |
| 7460 | 7463 | ||
| 7461 | ;; A wrong password doesn't work either. | 7464 | ;; A wrong password doesn't work either. |
| 7462 | (tramp-cleanup-connection tramp-test-vec 'keep-debug) | 7465 | (tramp-cleanup-connection tramp-test-vec 'keep-debug) |
| 7463 | (setq mocked-input `(,(concat pass pass))) | 7466 | (setq mocked-input `(,(concat pass pass))) |
| 7464 | (should-error (file-exists-p tramp-test-temporary-file-directory)) | 7467 | (should-error (file-exists-p ert-remote-temporary-file-directory)) |
| 7465 | 7468 | ||
| 7466 | ;; Reading password from auth-source works. We use the netrc | 7469 | ;; Reading password from auth-source works. We use the netrc |
| 7467 | ;; backend; the other backends shall behave similar. | 7470 | ;; backend; the other backends shall behave similar. |
| @@ -7474,9 +7477,9 @@ process sentinels. They shall not disturb each other." | |||
| 7474 | :prefix "tramp-test" :suffix "" | 7477 | :prefix "tramp-test" :suffix "" |
| 7475 | :text (format | 7478 | :text (format |
| 7476 | "machine %s port mock password %s" | 7479 | "machine %s port mock password %s" |
| 7477 | (file-remote-p tramp-test-temporary-file-directory 'host) pass) | 7480 | (file-remote-p ert-remote-temporary-file-directory 'host) pass) |
| 7478 | (let ((auth-sources `(,netrc-file))) | 7481 | (let ((auth-sources `(,netrc-file))) |
| 7479 | (should (file-exists-p tramp-test-temporary-file-directory))))))))) | 7482 | (should (file-exists-p ert-remote-temporary-file-directory))))))))) |
| 7480 | 7483 | ||
| 7481 | ;; This test is inspired by Bug#29163. | 7484 | ;; This test is inspired by Bug#29163. |
| 7482 | (ert-deftest tramp-test47-auto-load () | 7485 | (ert-deftest tramp-test47-auto-load () |
| @@ -7492,7 +7495,7 @@ process sentinels. They shall not disturb each other." | |||
| 7492 | ;; Suppress method name check. | 7495 | ;; Suppress method name check. |
| 7493 | "(let ((non-essential t)) \ | 7496 | "(let ((non-essential t)) \ |
| 7494 | (message \"Tramp loaded: %%s\" (and (file-remote-p %S) t)))" | 7497 | (message \"Tramp loaded: %%s\" (and (file-remote-p %S) t)))" |
| 7495 | tramp-test-temporary-file-directory))) | 7498 | ert-remote-temporary-file-directory))) |
| 7496 | (should | 7499 | (should |
| 7497 | (string-match-p | 7500 | (string-match-p |
| 7498 | "Tramp loaded: t[\n\r]+" | 7501 | "Tramp loaded: t[\n\r]+" |
| @@ -7541,10 +7544,10 @@ process sentinels. They shall not disturb each other." | |||
| 7541 | (dolist (code | 7544 | (dolist (code |
| 7542 | (list | 7545 | (list |
| 7543 | (format | 7546 | (format |
| 7544 | "(expand-file-name %S)" tramp-test-temporary-file-directory) | 7547 | "(expand-file-name %S)" ert-remote-temporary-file-directory) |
| 7545 | (format | 7548 | (format |
| 7546 | "(let ((default-directory %S)) (expand-file-name %S))" | 7549 | "(let ((default-directory %S)) (expand-file-name %S))" |
| 7547 | tramp-test-temporary-file-directory | 7550 | ert-remote-temporary-file-directory |
| 7548 | temporary-file-directory))) | 7551 | temporary-file-directory))) |
| 7549 | (should-not | 7552 | (should-not |
| 7550 | (string-match-p | 7553 | (string-match-p |
diff --git a/test/lisp/shadowfile-tests.el b/test/lisp/shadowfile-tests.el index 46ab34535d4..e822bc9eb66 100644 --- a/test/lisp/shadowfile-tests.el +++ b/test/lisp/shadowfile-tests.el | |||
| @@ -37,37 +37,9 @@ | |||
| 37 | 37 | ||
| 38 | ;;; Code: | 38 | ;;; Code: |
| 39 | 39 | ||
| 40 | (require 'ert) | ||
| 41 | (require 'shadowfile) | ||
| 42 | (require 'tramp) | 40 | (require 'tramp) |
| 43 | 41 | (require 'ert-x) | |
| 44 | ;; There is no default value on w32 systems, which could work out of the box. | 42 | (require 'shadowfile) |
| 45 | (defconst shadow-test-remote-temporary-file-directory | ||
| 46 | (cond | ||
| 47 | ((getenv "REMOTE_TEMPORARY_FILE_DIRECTORY")) | ||
| 48 | ((eq system-type 'windows-nt) null-device) | ||
| 49 | (t (add-to-list | ||
| 50 | 'tramp-methods | ||
| 51 | '("mock" | ||
| 52 | (tramp-login-program "sh") | ||
| 53 | (tramp-login-args (("-i"))) | ||
| 54 | (tramp-remote-shell "/bin/sh") | ||
| 55 | (tramp-remote-shell-args ("-c")) | ||
| 56 | (tramp-connection-timeout 10))) | ||
| 57 | (add-to-list | ||
| 58 | 'tramp-default-host-alist | ||
| 59 | `("\\`mock\\'" nil ,(system-name))) | ||
| 60 | ;; Emacs' Makefile sets $HOME to a nonexistent value. Needed in | ||
| 61 | ;; batch mode only, therefore. `shadow-homedir' cannot be | ||
| 62 | ;; `temporary-directory', because the tests with "~" would fail. | ||
| 63 | (unless (and (null noninteractive) (file-directory-p "~/")) | ||
| 64 | (setenv "HOME" (file-name-unquote temporary-file-directory)) | ||
| 65 | (setq shadow-homedir invocation-directory) | ||
| 66 | (add-to-list | ||
| 67 | 'tramp-connection-properties | ||
| 68 | `(,(file-remote-p "/mock::") "~" ,invocation-directory))) | ||
| 69 | (format "/mock::%s" temporary-file-directory))) | ||
| 70 | "Temporary directory for Tramp tests.") | ||
| 71 | 43 | ||
| 72 | (setq auth-source-save-behavior nil | 44 | (setq auth-source-save-behavior nil |
| 73 | password-cache-expiry nil | 45 | password-cache-expiry nil |
| @@ -80,9 +52,8 @@ | |||
| 80 | tramp-verbose 0 | 52 | tramp-verbose 0 |
| 81 | ;; On macOS, `temporary-file-directory' is a symlinked directory. | 53 | ;; On macOS, `temporary-file-directory' is a symlinked directory. |
| 82 | temporary-file-directory (file-truename temporary-file-directory) | 54 | temporary-file-directory (file-truename temporary-file-directory) |
| 83 | shadow-test-remote-temporary-file-directory | 55 | ert-remote-temporary-file-directory |
| 84 | (ignore-errors | 56 | (ignore-errors (file-truename ert-remote-temporary-file-directory))) |
| 85 | (file-truename shadow-test-remote-temporary-file-directory))) | ||
| 86 | 57 | ||
| 87 | ;; This should happen on hydra only. | 58 | ;; This should happen on hydra only. |
| 88 | (when (getenv "EMACS_HYDRA_CI") | 59 | (when (getenv "EMACS_HYDRA_CI") |
| @@ -100,7 +71,7 @@ | |||
| 100 | "Reset all `shadowfile' internals." | 71 | "Reset all `shadowfile' internals." |
| 101 | ;; Cleanup Tramp. | 72 | ;; Cleanup Tramp. |
| 102 | (tramp-cleanup-connection | 73 | (tramp-cleanup-connection |
| 103 | (tramp-dissect-file-name shadow-test-remote-temporary-file-directory) t t) | 74 | (tramp-dissect-file-name ert-remote-temporary-file-directory) t t) |
| 104 | ;; Delete auto-saved files. | 75 | ;; Delete auto-saved files. |
| 105 | (with-current-buffer (find-file-noselect shadow-info-file 'nowarn) | 76 | (with-current-buffer (find-file-noselect shadow-info-file 'nowarn) |
| 106 | (ignore-errors (delete-file (make-auto-save-file-name))) | 77 | (ignore-errors (delete-file (make-auto-save-file-name))) |
| @@ -135,7 +106,7 @@ a cluster (or site). This is not tested here; it must be | |||
| 135 | guaranteed by the originator of a cluster definition." | 106 | guaranteed by the originator of a cluster definition." |
| 136 | :tags '(:expensive-test) | 107 | :tags '(:expensive-test) |
| 137 | (skip-unless (not (memq system-type '(windows-nt ms-dos)))) | 108 | (skip-unless (not (memq system-type '(windows-nt ms-dos)))) |
| 138 | (skip-unless (file-remote-p shadow-test-remote-temporary-file-directory)) | 109 | (skip-unless (file-remote-p ert-remote-temporary-file-directory)) |
| 139 | 110 | ||
| 140 | (let ((text-quoting-style 'grave) ;; We inspect the *Messages* buffer! | 111 | (let ((text-quoting-style 'grave) ;; We inspect the *Messages* buffer! |
| 141 | (inhibit-message t) | 112 | (inhibit-message t) |
| @@ -222,8 +193,7 @@ guaranteed by the originator of a cluster definition." | |||
| 222 | (shadow-cluster-regexp (shadow-get-cluster cluster)) regexp)) | 193 | (shadow-cluster-regexp (shadow-get-cluster cluster)) regexp)) |
| 223 | 194 | ||
| 224 | ;; Redefine the cluster. | 195 | ;; Redefine the cluster. |
| 225 | (setq primary | 196 | (setq primary (file-remote-p ert-remote-temporary-file-directory) |
| 226 | (file-remote-p shadow-test-remote-temporary-file-directory) | ||
| 227 | regexp (shadow-regexp-superquote primary) | 197 | regexp (shadow-regexp-superquote primary) |
| 228 | mocked-input `(,cluster ,primary ,regexp)) | 198 | mocked-input `(,cluster ,primary ,regexp)) |
| 229 | (call-interactively #'shadow-define-cluster) | 199 | (call-interactively #'shadow-define-cluster) |
| @@ -254,7 +224,7 @@ Per definition, all files are identical on the different hosts of | |||
| 254 | a cluster (or site). This is not tested here; it must be | 224 | a cluster (or site). This is not tested here; it must be |
| 255 | guaranteed by the originator of a cluster definition." | 225 | guaranteed by the originator of a cluster definition." |
| 256 | (skip-unless (not (memq system-type '(windows-nt ms-dos)))) | 226 | (skip-unless (not (memq system-type '(windows-nt ms-dos)))) |
| 257 | (skip-unless (file-remote-p shadow-test-remote-temporary-file-directory)) | 227 | (skip-unless (file-remote-p ert-remote-temporary-file-directory)) |
| 258 | 228 | ||
| 259 | (let ((shadow-info-file shadow-test-info-file) | 229 | (let ((shadow-info-file shadow-test-info-file) |
| 260 | (shadow-todo-file shadow-test-todo-file) | 230 | (shadow-todo-file shadow-test-todo-file) |
| @@ -286,14 +256,14 @@ guaranteed by the originator of a cluster definition." | |||
| 286 | (should (string-equal (system-name) (shadow-site-name primary1))) | 256 | (should (string-equal (system-name) (shadow-site-name primary1))) |
| 287 | (should | 257 | (should |
| 288 | (string-equal | 258 | (string-equal |
| 289 | (file-remote-p shadow-test-remote-temporary-file-directory) | 259 | (file-remote-p ert-remote-temporary-file-directory) |
| 290 | (shadow-name-site | 260 | (shadow-name-site |
| 291 | (file-remote-p shadow-test-remote-temporary-file-directory)))) | 261 | (file-remote-p ert-remote-temporary-file-directory)))) |
| 292 | (should | 262 | (should |
| 293 | (string-equal | 263 | (string-equal |
| 294 | (file-remote-p shadow-test-remote-temporary-file-directory) | 264 | (file-remote-p ert-remote-temporary-file-directory) |
| 295 | (shadow-site-name | 265 | (shadow-site-name |
| 296 | (file-remote-p shadow-test-remote-temporary-file-directory)))) | 266 | (file-remote-p ert-remote-temporary-file-directory)))) |
| 297 | 267 | ||
| 298 | (should (equal (shadow-site-cluster cluster1) | 268 | (should (equal (shadow-site-cluster cluster1) |
| 299 | (shadow-get-cluster cluster1))) | 269 | (shadow-get-cluster cluster1))) |
| @@ -324,8 +294,7 @@ guaranteed by the originator of a cluster definition." | |||
| 324 | 294 | ||
| 325 | ;; Define a second cluster. | 295 | ;; Define a second cluster. |
| 326 | (setq cluster2 "cluster2" | 296 | (setq cluster2 "cluster2" |
| 327 | primary2 | 297 | primary2 (file-remote-p ert-remote-temporary-file-directory) |
| 328 | (file-remote-p shadow-test-remote-temporary-file-directory) | ||
| 329 | regexp2 (format "^\\(%s\\|%s\\)$" shadow-system-name primary2)) | 298 | regexp2 (format "^\\(%s\\|%s\\)$" shadow-system-name primary2)) |
| 330 | (shadow-set-cluster cluster2 primary2 regexp2) | 299 | (shadow-set-cluster cluster2 primary2 regexp2) |
| 331 | 300 | ||
| @@ -356,7 +325,7 @@ guaranteed by the originator of a cluster definition." | |||
| 356 | (ert-deftest shadow-test02-files () | 325 | (ert-deftest shadow-test02-files () |
| 357 | "Check file manipulation functions." | 326 | "Check file manipulation functions." |
| 358 | (skip-unless (not (memq system-type '(windows-nt ms-dos)))) | 327 | (skip-unless (not (memq system-type '(windows-nt ms-dos)))) |
| 359 | (skip-unless (file-remote-p shadow-test-remote-temporary-file-directory)) | 328 | (skip-unless (file-remote-p ert-remote-temporary-file-directory)) |
| 360 | 329 | ||
| 361 | (let ((shadow-info-file shadow-test-info-file) | 330 | (let ((shadow-info-file shadow-test-info-file) |
| 362 | (shadow-todo-file shadow-test-todo-file) | 331 | (shadow-todo-file shadow-test-todo-file) |
| @@ -398,8 +367,7 @@ guaranteed by the originator of a cluster definition." | |||
| 398 | (string-equal (shadow-local-file (concat primary file)) file)) | 367 | (string-equal (shadow-local-file (concat primary file)) file)) |
| 399 | 368 | ||
| 400 | ;; Redefine the cluster. | 369 | ;; Redefine the cluster. |
| 401 | (setq primary | 370 | (setq primary (file-remote-p ert-remote-temporary-file-directory) |
| 402 | (file-remote-p shadow-test-remote-temporary-file-directory) | ||
| 403 | regexp (shadow-regexp-superquote primary)) | 371 | regexp (shadow-regexp-superquote primary)) |
| 404 | (shadow-set-cluster cluster primary regexp) | 372 | (shadow-set-cluster cluster primary regexp) |
| 405 | 373 | ||
| @@ -428,7 +396,7 @@ guaranteed by the originator of a cluster definition." | |||
| 428 | (ert-deftest shadow-test03-expand-cluster-in-file-name () | 396 | (ert-deftest shadow-test03-expand-cluster-in-file-name () |
| 429 | "Check canonical file name of a cluster or site." | 397 | "Check canonical file name of a cluster or site." |
| 430 | (skip-unless (not (memq system-type '(windows-nt ms-dos)))) | 398 | (skip-unless (not (memq system-type '(windows-nt ms-dos)))) |
| 431 | (skip-unless (file-remote-p shadow-test-remote-temporary-file-directory)) | 399 | (skip-unless (file-remote-p ert-remote-temporary-file-directory)) |
| 432 | 400 | ||
| 433 | (let ((shadow-info-file shadow-test-info-file) | 401 | (let ((shadow-info-file shadow-test-info-file) |
| 434 | (shadow-todo-file shadow-test-todo-file) | 402 | (shadow-todo-file shadow-test-todo-file) |
| @@ -453,8 +421,7 @@ guaranteed by the originator of a cluster definition." | |||
| 453 | file2 | 421 | file2 |
| 454 | (make-temp-name | 422 | (make-temp-name |
| 455 | (expand-file-name | 423 | (expand-file-name |
| 456 | "shadowfile-tests" | 424 | "shadowfile-tests" ert-remote-temporary-file-directory))) |
| 457 | shadow-test-remote-temporary-file-directory))) | ||
| 458 | 425 | ||
| 459 | ;; A local file name is kept. | 426 | ;; A local file name is kept. |
| 460 | (should | 427 | (should |
| @@ -473,8 +440,7 @@ guaranteed by the originator of a cluster definition." | |||
| 473 | (shadow-expand-cluster-in-file-name (concat primary file1)) file1)) | 440 | (shadow-expand-cluster-in-file-name (concat primary file1)) file1)) |
| 474 | 441 | ||
| 475 | ;; Redefine the cluster. | 442 | ;; Redefine the cluster. |
| 476 | (setq primary | 443 | (setq primary (file-remote-p ert-remote-temporary-file-directory) |
| 477 | (file-remote-p shadow-test-remote-temporary-file-directory) | ||
| 478 | regexp (shadow-regexp-superquote primary)) | 444 | regexp (shadow-regexp-superquote primary)) |
| 479 | (shadow-set-cluster cluster primary regexp) | 445 | (shadow-set-cluster cluster primary regexp) |
| 480 | 446 | ||
| @@ -495,7 +461,7 @@ guaranteed by the originator of a cluster definition." | |||
| 495 | (ert-deftest shadow-test04-contract-file-name () | 461 | (ert-deftest shadow-test04-contract-file-name () |
| 496 | "Check canonical file name of a cluster or site." | 462 | "Check canonical file name of a cluster or site." |
| 497 | (skip-unless (not (memq system-type '(windows-nt ms-dos)))) | 463 | (skip-unless (not (memq system-type '(windows-nt ms-dos)))) |
| 498 | (skip-unless (file-remote-p shadow-test-remote-temporary-file-directory)) | 464 | (skip-unless (file-remote-p ert-remote-temporary-file-directory)) |
| 499 | 465 | ||
| 500 | (let ((shadow-info-file shadow-test-info-file) | 466 | (let ((shadow-info-file shadow-test-info-file) |
| 501 | (shadow-todo-file shadow-test-todo-file) | 467 | (shadow-todo-file shadow-test-todo-file) |
| @@ -533,8 +499,7 @@ guaranteed by the originator of a cluster definition." | |||
| 533 | (concat "/cluster:" file))) | 499 | (concat "/cluster:" file))) |
| 534 | 500 | ||
| 535 | ;; Redefine the cluster. | 501 | ;; Redefine the cluster. |
| 536 | (setq primary | 502 | (setq primary (file-remote-p ert-remote-temporary-file-directory) |
| 537 | (file-remote-p shadow-test-remote-temporary-file-directory) | ||
| 538 | regexp (shadow-regexp-superquote primary)) | 503 | regexp (shadow-regexp-superquote primary)) |
| 539 | (shadow-set-cluster cluster primary regexp) | 504 | (shadow-set-cluster cluster primary regexp) |
| 540 | 505 | ||
| @@ -542,8 +507,7 @@ guaranteed by the originator of a cluster definition." | |||
| 542 | (should | 507 | (should |
| 543 | (string-equal | 508 | (string-equal |
| 544 | (shadow-contract-file-name | 509 | (shadow-contract-file-name |
| 545 | (concat | 510 | (concat (file-remote-p ert-remote-temporary-file-directory) file)) |
| 546 | (file-remote-p shadow-test-remote-temporary-file-directory) file)) | ||
| 547 | (concat "/cluster:" file)))) | 511 | (concat "/cluster:" file)))) |
| 548 | 512 | ||
| 549 | ;; Cleanup. | 513 | ;; Cleanup. |
| @@ -552,7 +516,7 @@ guaranteed by the originator of a cluster definition." | |||
| 552 | (ert-deftest shadow-test05-file-match () | 516 | (ert-deftest shadow-test05-file-match () |
| 553 | "Check `shadow-same-site' and `shadow-file-match'." | 517 | "Check `shadow-same-site' and `shadow-file-match'." |
| 554 | (skip-unless (not (memq system-type '(windows-nt ms-dos)))) | 518 | (skip-unless (not (memq system-type '(windows-nt ms-dos)))) |
| 555 | (skip-unless (file-remote-p shadow-test-remote-temporary-file-directory)) | 519 | (skip-unless (file-remote-p ert-remote-temporary-file-directory)) |
| 556 | 520 | ||
| 557 | (let ((shadow-info-file shadow-test-info-file) | 521 | (let ((shadow-info-file shadow-test-info-file) |
| 558 | (shadow-todo-file shadow-test-todo-file) | 522 | (shadow-todo-file shadow-test-todo-file) |
| @@ -588,17 +552,14 @@ guaranteed by the originator of a cluster definition." | |||
| 588 | (should (shadow-file-match (shadow-parse-name file) file)) | 552 | (should (shadow-file-match (shadow-parse-name file) file)) |
| 589 | 553 | ||
| 590 | ;; Redefine the cluster. | 554 | ;; Redefine the cluster. |
| 591 | (setq primary | 555 | (setq primary (file-remote-p ert-remote-temporary-file-directory) |
| 592 | (file-remote-p shadow-test-remote-temporary-file-directory) | ||
| 593 | regexp (shadow-regexp-superquote primary)) | 556 | regexp (shadow-regexp-superquote primary)) |
| 594 | (shadow-set-cluster cluster primary regexp) | 557 | (shadow-set-cluster cluster primary regexp) |
| 595 | 558 | ||
| 596 | (should | 559 | (should |
| 597 | (shadow-file-match | 560 | (shadow-file-match |
| 598 | (shadow-parse-name | 561 | (shadow-parse-name |
| 599 | (concat | 562 | (concat (file-remote-p ert-remote-temporary-file-directory) file)) |
| 600 | (file-remote-p shadow-test-remote-temporary-file-directory) | ||
| 601 | file)) | ||
| 602 | file))) | 563 | file))) |
| 603 | 564 | ||
| 604 | ;; Cleanup. | 565 | ;; Cleanup. |
| @@ -607,7 +568,7 @@ guaranteed by the originator of a cluster definition." | |||
| 607 | (ert-deftest shadow-test06-literal-groups () | 568 | (ert-deftest shadow-test06-literal-groups () |
| 608 | "Check literal group definitions." | 569 | "Check literal group definitions." |
| 609 | (skip-unless (not (memq system-type '(windows-nt ms-dos)))) | 570 | (skip-unless (not (memq system-type '(windows-nt ms-dos)))) |
| 610 | (skip-unless (file-remote-p shadow-test-remote-temporary-file-directory)) | 571 | (skip-unless (file-remote-p ert-remote-temporary-file-directory)) |
| 611 | 572 | ||
| 612 | (let ((shadow-info-file shadow-test-info-file) | 573 | (let ((shadow-info-file shadow-test-info-file) |
| 613 | (shadow-todo-file shadow-test-todo-file) | 574 | (shadow-todo-file shadow-test-todo-file) |
| @@ -632,8 +593,7 @@ guaranteed by the originator of a cluster definition." | |||
| 632 | (shadow-set-cluster cluster1 primary regexp) | 593 | (shadow-set-cluster cluster1 primary regexp) |
| 633 | 594 | ||
| 634 | (setq cluster2 "cluster2" | 595 | (setq cluster2 "cluster2" |
| 635 | primary | 596 | primary (file-remote-p ert-remote-temporary-file-directory) |
| 636 | (file-remote-p shadow-test-remote-temporary-file-directory) | ||
| 637 | regexp (format "^\\(%s\\|%s\\)$" shadow-system-name primary)) | 597 | regexp (format "^\\(%s\\|%s\\)$" shadow-system-name primary)) |
| 638 | (shadow-set-cluster cluster2 primary regexp) | 598 | (shadow-set-cluster cluster2 primary regexp) |
| 639 | 599 | ||
| @@ -644,8 +604,7 @@ guaranteed by the originator of a cluster definition." | |||
| 644 | file2 | 604 | file2 |
| 645 | (make-temp-name | 605 | (make-temp-name |
| 646 | (expand-file-name | 606 | (expand-file-name |
| 647 | "shadowfile-tests" | 607 | "shadowfile-tests" ert-remote-temporary-file-directory)) |
| 648 | shadow-test-remote-temporary-file-directory)) | ||
| 649 | mocked-input | 608 | mocked-input |
| 650 | `(,cluster1 ,file1 ,cluster2 ,file2 | 609 | `(,cluster1 ,file1 ,cluster2 ,file2 |
| 651 | ,primary ,file1 ,(kbd "RET"))) | 610 | ,primary ,file1 ,(kbd "RET"))) |
| @@ -694,7 +653,7 @@ guaranteed by the originator of a cluster definition." | |||
| 694 | (ert-deftest shadow-test07-regexp-groups () | 653 | (ert-deftest shadow-test07-regexp-groups () |
| 695 | "Check regexp group definitions." | 654 | "Check regexp group definitions." |
| 696 | (skip-unless (not (memq system-type '(windows-nt ms-dos)))) | 655 | (skip-unless (not (memq system-type '(windows-nt ms-dos)))) |
| 697 | (skip-unless (file-remote-p shadow-test-remote-temporary-file-directory)) | 656 | (skip-unless (file-remote-p ert-remote-temporary-file-directory)) |
| 698 | 657 | ||
| 699 | (let ((shadow-info-file shadow-test-info-file) | 658 | (let ((shadow-info-file shadow-test-info-file) |
| 700 | (shadow-todo-file shadow-test-todo-file) | 659 | (shadow-todo-file shadow-test-todo-file) |
| @@ -719,8 +678,7 @@ guaranteed by the originator of a cluster definition." | |||
| 719 | (shadow-set-cluster cluster1 primary regexp) | 678 | (shadow-set-cluster cluster1 primary regexp) |
| 720 | 679 | ||
| 721 | (setq cluster2 "cluster2" | 680 | (setq cluster2 "cluster2" |
| 722 | primary | 681 | primary (file-remote-p ert-remote-temporary-file-directory) |
| 723 | (file-remote-p shadow-test-remote-temporary-file-directory) | ||
| 724 | regexp (format "^\\(%s\\|%s\\)$" shadow-system-name primary)) | 682 | regexp (format "^\\(%s\\|%s\\)$" shadow-system-name primary)) |
| 725 | (shadow-set-cluster cluster2 primary regexp) | 683 | (shadow-set-cluster cluster2 primary regexp) |
| 726 | 684 | ||
| @@ -757,8 +715,8 @@ guaranteed by the originator of a cluster definition." | |||
| 757 | (ert-deftest shadow-test08-shadow-todo () | 715 | (ert-deftest shadow-test08-shadow-todo () |
| 758 | "Check that needed shadows are added to todo." | 716 | "Check that needed shadows are added to todo." |
| 759 | (skip-unless (not (memq system-type '(windows-nt ms-dos)))) | 717 | (skip-unless (not (memq system-type '(windows-nt ms-dos)))) |
| 760 | (skip-unless (file-remote-p shadow-test-remote-temporary-file-directory)) | 718 | (skip-unless (file-remote-p ert-remote-temporary-file-directory)) |
| 761 | (skip-unless (file-writable-p shadow-test-remote-temporary-file-directory)) | 719 | (skip-unless (file-writable-p ert-remote-temporary-file-directory)) |
| 762 | 720 | ||
| 763 | (let ((backup-inhibited t) | 721 | (let ((backup-inhibited t) |
| 764 | create-lockfiles | 722 | create-lockfiles |
| @@ -778,7 +736,7 @@ guaranteed by the originator of a cluster definition." | |||
| 778 | (message | 736 | (message |
| 779 | "%s %s %s %s %s" | 737 | "%s %s %s %s %s" |
| 780 | temporary-file-directory | 738 | temporary-file-directory |
| 781 | shadow-test-remote-temporary-file-directory | 739 | ert-remote-temporary-file-directory |
| 782 | shadow-homedir shadow-info-file shadow-todo-file)) | 740 | shadow-homedir shadow-info-file shadow-todo-file)) |
| 783 | 741 | ||
| 784 | ;; Define clusters. | 742 | ;; Define clusters. |
| @@ -792,8 +750,7 @@ guaranteed by the originator of a cluster definition." | |||
| 792 | cluster1 primary regexp shadow-clusters)) | 750 | cluster1 primary regexp shadow-clusters)) |
| 793 | 751 | ||
| 794 | (setq cluster2 "cluster2" | 752 | (setq cluster2 "cluster2" |
| 795 | primary | 753 | primary (file-remote-p ert-remote-temporary-file-directory) |
| 796 | (file-remote-p shadow-test-remote-temporary-file-directory) | ||
| 797 | regexp (shadow-regexp-superquote primary)) | 754 | regexp (shadow-regexp-superquote primary)) |
| 798 | (shadow-set-cluster cluster2 primary regexp) | 755 | (shadow-set-cluster cluster2 primary regexp) |
| 799 | (when shadow-debug | 756 | (when shadow-debug |
| @@ -903,8 +860,8 @@ guaranteed by the originator of a cluster definition." | |||
| 903 | "Check that needed shadow files are copied." | 860 | "Check that needed shadow files are copied." |
| 904 | :tags '(:expensive-test) | 861 | :tags '(:expensive-test) |
| 905 | (skip-unless (not (memq system-type '(windows-nt ms-dos)))) | 862 | (skip-unless (not (memq system-type '(windows-nt ms-dos)))) |
| 906 | (skip-unless (file-remote-p shadow-test-remote-temporary-file-directory)) | 863 | (skip-unless (file-remote-p ert-remote-temporary-file-directory)) |
| 907 | (skip-unless (file-writable-p shadow-test-remote-temporary-file-directory)) | 864 | (skip-unless (file-writable-p ert-remote-temporary-file-directory)) |
| 908 | 865 | ||
| 909 | (let ((backup-inhibited t) | 866 | (let ((backup-inhibited t) |
| 910 | create-lockfiles | 867 | create-lockfiles |
| @@ -928,8 +885,7 @@ guaranteed by the originator of a cluster definition." | |||
| 928 | (shadow-set-cluster cluster1 primary regexp) | 885 | (shadow-set-cluster cluster1 primary regexp) |
| 929 | 886 | ||
| 930 | (setq cluster2 "cluster2" | 887 | (setq cluster2 "cluster2" |
| 931 | primary | 888 | primary (file-remote-p ert-remote-temporary-file-directory) |
| 932 | (file-remote-p shadow-test-remote-temporary-file-directory) | ||
| 933 | regexp (shadow-regexp-superquote primary)) | 889 | regexp (shadow-regexp-superquote primary)) |
| 934 | (shadow-set-cluster cluster2 primary regexp) | 890 | (shadow-set-cluster cluster2 primary regexp) |
| 935 | 891 | ||