1 ;;; tramp-tests.el --- Tests of remote file access
3 ;; Copyright (C) 2013 Free Software Foundation, Inc.
5 ;; Author: Michael Albinus <michael.albinus@gmx.de>
7 ;; This program is free software: you can redistribute it and/or
8 ;; modify it under the terms of the GNU General Public License as
9 ;; published by the Free Software Foundation, either version 3 of the
10 ;; License, or (at your option) any later version.
12 ;; This program is distributed in the hope that it will be useful, but
13 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 ;; General Public License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with this program. If not, see `http://www.gnu.org/licenses/'.
22 ;; The tests require a recent ert.el from Emacs 24.4.
24 ;; Some of the tests require access to a remote host files. Set
25 ;; $REMOTE_TEMPORARY_FILE_DIRECTORY to a suitable value in order
26 ;; to overwrite the default value. If you want to skip tests
27 ;; accessing a remote host, set this environment variable to
28 ;; "/dev/null" or whatever is appropriate on your system.
30 ;; When running the tests in batch mode, it must NOT require an
31 ;; interactive password prompt unless the environment variable
32 ;; $REMOTE_ALLOW_PASSWORD is set.
34 ;; A whole test run can be performed calling the command `tramp-test-all'.
41 ;; There is no default value on w32 systems, which could work out of the box.
42 (defconst tramp-test-temporary-file-directory
44 ((getenv "REMOTE_TEMPORARY_FILE_DIRECTORY"))
45 ((eq system-type
'windows-nt
) null-device
)
46 (t (format "/ssh::%s" temporary-file-directory
)))
47 "Temporary directory for Tramp tests.")
50 tramp-message-show-message nil
)
52 ;; Disable interactive passwords in batch mode.
53 (when (and noninteractive
(not (getenv "REMOTE_ALLOW_PASSWORD")))
54 (defalias 'tramp-read-passwd
'ignore
))
56 ;; This shall happen on hydra only.
57 (when (getenv "NIX_STORE")
58 (add-to-list 'tramp-remote-path
'tramp-own-remote-path
))
60 (defvar tramp--test-enabled-checked nil
61 "Cached result of `tramp--test-enabled'.
62 If the function did run, the value is a cons cell, the `cdr'
65 (defun tramp--test-enabled ()
66 "Whether remote file access is enabled."
67 (unless (consp tramp--test-enabled-checked
)
69 tramp--test-enabled-checked
73 (file-remote-p tramp-test-temporary-file-directory
)
74 (file-directory-p tramp-test-temporary-file-directory
)
75 (file-writable-p tramp-test-temporary-file-directory
))))))
77 (cdr tramp--test-enabled-checked
))
79 (defun tramp--test-make-temp-name ()
80 "Create a temporary file name for test."
82 (make-temp-name "tramp-test") tramp-test-temporary-file-directory
))
84 (ert-deftest tramp-test00-availability
()
85 "Test availability of Tramp functions."
86 :expected-result
(if (tramp--test-enabled) :passed
:failed
)
87 (should (ignore-errors
89 (file-remote-p tramp-test-temporary-file-directory
)
90 (file-directory-p tramp-test-temporary-file-directory
)
91 (file-writable-p tramp-test-temporary-file-directory
)))))
93 (ert-deftest tramp-test01-file-name-syntax
()
94 "Check remote file name syntax."
96 (should (tramp-tramp-file-p "/method::"))
97 (should (tramp-tramp-file-p "/host:"))
98 (should (tramp-tramp-file-p "/user@:"))
99 (should (tramp-tramp-file-p "/user@host:"))
100 (should (tramp-tramp-file-p "/method:host:"))
101 (should (tramp-tramp-file-p "/method:user@:"))
102 (should (tramp-tramp-file-p "/method:user@host:"))
103 (should (tramp-tramp-file-p "/method:user@email@host:"))
106 (should (tramp-tramp-file-p "/host#1234:"))
107 (should (tramp-tramp-file-p "/user@host#1234:"))
108 (should (tramp-tramp-file-p "/method:host#1234:"))
109 (should (tramp-tramp-file-p "/method:user@host#1234:"))
111 ;; Using an IPv4 address.
112 (should (tramp-tramp-file-p "/1.2.3.4:"))
113 (should (tramp-tramp-file-p "/user@1.2.3.4:"))
114 (should (tramp-tramp-file-p "/method:1.2.3.4:"))
115 (should (tramp-tramp-file-p "/method:user@1.2.3.4:"))
117 ;; Using an IPv6 address.
118 (should (tramp-tramp-file-p "/[]:"))
119 (should (tramp-tramp-file-p "/[::1]:"))
120 (should (tramp-tramp-file-p "/user@[::1]:"))
121 (should (tramp-tramp-file-p "/method:[::1]:"))
122 (should (tramp-tramp-file-p "/method:user@[::1]:"))
124 ;; Local file name part.
125 (should (tramp-tramp-file-p "/host:/:"))
126 (should (tramp-tramp-file-p "/method:::"))
127 (should (tramp-tramp-file-p "/method::/path/to/file"))
128 (should (tramp-tramp-file-p "/method::file"))
131 (should (tramp-tramp-file-p "/method1:|method2::"))
132 (should (tramp-tramp-file-p "/method1:host1|host2:"))
133 (should (tramp-tramp-file-p "/method1:host1|method2:host2:"))
134 (should (tramp-tramp-file-p "/method1:user1@host1|method2:user2@host2:"))
135 (should (tramp-tramp-file-p
136 "/method1:user1@host1|method2:user2@host2|method3:user3@host3:"))
139 (should-not (tramp-tramp-file-p nil
))
140 (should-not (tramp-tramp-file-p 'symbol
))
141 ;; "/:" suppresses file name handlers.
142 (should-not (tramp-tramp-file-p "/::"))
143 (should-not (tramp-tramp-file-p "/:@:"))
144 (should-not (tramp-tramp-file-p "/:[]:"))
145 ;; Multihops require a method.
146 (should-not (tramp-tramp-file-p "/host1|host2:"))
147 ;; Methods or hostnames shall be at least two characters on MS Windows.
148 (when (memq system-type
'(cygwin windows-nt
))
149 (should-not (tramp-tramp-file-p "/c:/path/to/file"))
150 (should-not (tramp-tramp-file-p "/c::/path/to/file"))))
152 (ert-deftest tramp-test02-file-name-dissect
()
153 "Check remote file name components."
154 (let ((tramp-default-method "default-method")
155 (tramp-default-user "default-user")
156 (tramp-default-host "default-host"))
157 ;; Expand `tramp-default-user' and `tramp-default-host'.
158 (should (string-equal
159 (file-remote-p "/method::")
160 (format "/%s:%s@%s:" "method" "default-user" "default-host")))
161 (should (string-equal (file-remote-p "/method::" 'method
) "method"))
162 (should (string-equal (file-remote-p "/method::" 'user
) "default-user"))
163 (should (string-equal (file-remote-p "/method::" 'host
) "default-host"))
164 (should (string-equal (file-remote-p "/method::" 'localname
) ""))
166 ;; Expand `tramp-default-method' and `tramp-default-user'.
167 (should (string-equal
168 (file-remote-p "/host:")
169 (format "/%s:%s@%s:" "default-method" "default-user" "host")))
170 (should (string-equal (file-remote-p "/host:" 'method
) "default-method"))
171 (should (string-equal (file-remote-p "/host:" 'user
) "default-user"))
172 (should (string-equal (file-remote-p "/host:" 'host
) "host"))
173 (should (string-equal (file-remote-p "/host:" 'localname
) ""))
175 ;; Expand `tramp-default-method' and `tramp-default-host'.
176 (should (string-equal
177 (file-remote-p "/user@:")
178 (format "/%s:%s@%s:" "default-method""user" "default-host")))
179 (should (string-equal (file-remote-p "/user@:" 'method
) "default-method"))
180 (should (string-equal (file-remote-p "/user@:" 'user
) "user"))
181 (should (string-equal (file-remote-p "/user@:" 'host
) "default-host"))
182 (should (string-equal (file-remote-p "/user@:" 'localname
) ""))
184 ;; Expand `tramp-default-method'.
185 (should (string-equal
186 (file-remote-p "/user@host:")
187 (format "/%s:%s@%s:" "default-method" "user" "host")))
188 (should (string-equal
189 (file-remote-p "/user@host:" 'method
) "default-method"))
190 (should (string-equal (file-remote-p "/user@host:" 'user
) "user"))
191 (should (string-equal (file-remote-p "/user@host:" 'host
) "host"))
192 (should (string-equal (file-remote-p "/user@host:" 'localname
) ""))
194 ;; Expand `tramp-default-user'.
195 (should (string-equal
196 (file-remote-p "/method:host:")
197 (format "/%s:%s@%s:" "method" "default-user" "host")))
198 (should (string-equal (file-remote-p "/method:host:" 'method
) "method"))
199 (should (string-equal (file-remote-p "/method:host:" 'user
) "default-user"))
200 (should (string-equal (file-remote-p "/method:host:" 'host
) "host"))
201 (should (string-equal (file-remote-p "/method:host:" 'localname
) ""))
203 ;; Expand `tramp-default-host'.
204 (should (string-equal
205 (file-remote-p "/method:user@:")
206 (format "/%s:%s@%s:" "method" "user" "default-host")))
207 (should (string-equal (file-remote-p "/method:user@:" 'method
) "method"))
208 (should (string-equal (file-remote-p "/method:user@:" 'user
) "user"))
209 (should (string-equal (file-remote-p "/method:user@:" 'host
)
211 (should (string-equal (file-remote-p "/method:user@:" 'localname
) ""))
214 (should (string-equal
215 (file-remote-p "/method:user@host:")
216 (format "/%s:%s@%s:" "method" "user" "host")))
217 (should (string-equal
218 (file-remote-p "/method:user@host:" 'method
) "method"))
219 (should (string-equal (file-remote-p "/method:user@host:" 'user
) "user"))
220 (should (string-equal (file-remote-p "/method:user@host:" 'host
) "host"))
221 (should (string-equal (file-remote-p "/method:user@host:" 'localname
) ""))
224 (should (string-equal
225 (file-remote-p "/method:user@email@host:")
226 (format "/%s:%s@%s:" "method" "user@email" "host")))
227 (should (string-equal
228 (file-remote-p "/method:user@email@host:" 'method
) "method"))
229 (should (string-equal
230 (file-remote-p "/method:user@email@host:" 'user
) "user@email"))
231 (should (string-equal
232 (file-remote-p "/method:user@email@host:" 'host
) "host"))
233 (should (string-equal
234 (file-remote-p "/method:user@email@host:" 'localname
) ""))
236 ;; Expand `tramp-default-method' and `tramp-default-user'.
237 (should (string-equal
238 (file-remote-p "/host#1234:")
239 (format "/%s:%s@%s:" "default-method" "default-user" "host#1234")))
240 (should (string-equal
241 (file-remote-p "/host#1234:" 'method
) "default-method"))
242 (should (string-equal (file-remote-p "/host#1234:" 'user
) "default-user"))
243 (should (string-equal (file-remote-p "/host#1234:" 'host
) "host#1234"))
244 (should (string-equal (file-remote-p "/host#1234:" 'localname
) ""))
246 ;; Expand `tramp-default-method'.
247 (should (string-equal
248 (file-remote-p "/user@host#1234:")
249 (format "/%s:%s@%s:" "default-method" "user" "host#1234")))
250 (should (string-equal
251 (file-remote-p "/user@host#1234:" 'method
) "default-method"))
252 (should (string-equal (file-remote-p "/user@host#1234:" 'user
) "user"))
253 (should (string-equal (file-remote-p "/user@host#1234:" 'host
) "host#1234"))
254 (should (string-equal (file-remote-p "/user@host#1234:" 'localname
) ""))
256 ;; Expand `tramp-default-user'.
257 (should (string-equal
258 (file-remote-p "/method:host#1234:")
259 (format "/%s:%s@%s:" "method" "default-user" "host#1234")))
260 (should (string-equal
261 (file-remote-p "/method:host#1234:" 'method
) "method"))
262 (should (string-equal
263 (file-remote-p "/method:host#1234:" 'user
) "default-user"))
264 (should (string-equal
265 (file-remote-p "/method:host#1234:" 'host
) "host#1234"))
266 (should (string-equal (file-remote-p "/method:host#1234:" 'localname
) ""))
269 (should (string-equal
270 (file-remote-p "/method:user@host#1234:")
271 (format "/%s:%s@%s:" "method" "user" "host#1234")))
272 (should (string-equal
273 (file-remote-p "/method:user@host#1234:" 'method
) "method"))
274 (should (string-equal
275 (file-remote-p "/method:user@host#1234:" 'user
) "user"))
276 (should (string-equal
277 (file-remote-p "/method:user@host#1234:" 'host
) "host#1234"))
278 (should (string-equal
279 (file-remote-p "/method:user@host#1234:" 'localname
) ""))
281 ;; Expand `tramp-default-method' and `tramp-default-user'.
282 (should (string-equal
283 (file-remote-p "/1.2.3.4:")
284 (format "/%s:%s@%s:" "default-method" "default-user" "1.2.3.4")))
285 (should (string-equal (file-remote-p "/1.2.3.4:" 'method
) "default-method"))
286 (should (string-equal (file-remote-p "/1.2.3.4:" 'user
) "default-user"))
287 (should (string-equal (file-remote-p "/1.2.3.4:" 'host
) "1.2.3.4"))
288 (should (string-equal (file-remote-p "/1.2.3.4:" 'localname
) ""))
290 ;; Expand `tramp-default-method'.
291 (should (string-equal
292 (file-remote-p "/user@1.2.3.4:")
293 (format "/%s:%s@%s:" "default-method" "user" "1.2.3.4")))
294 (should (string-equal
295 (file-remote-p "/user@1.2.3.4:" 'method
) "default-method"))
296 (should (string-equal (file-remote-p "/user@1.2.3.4:" 'user
) "user"))
297 (should (string-equal (file-remote-p "/user@1.2.3.4:" 'host
) "1.2.3.4"))
298 (should (string-equal (file-remote-p "/user@1.2.3.4:" 'localname
) ""))
300 ;; Expand `tramp-default-user'.
301 (should (string-equal
302 (file-remote-p "/method:1.2.3.4:")
303 (format "/%s:%s@%s:" "method" "default-user" "1.2.3.4")))
304 (should (string-equal (file-remote-p "/method:1.2.3.4:" 'method
) "method"))
305 (should (string-equal
306 (file-remote-p "/method:1.2.3.4:" 'user
) "default-user"))
307 (should (string-equal (file-remote-p "/method:1.2.3.4:" 'host
) "1.2.3.4"))
308 (should (string-equal (file-remote-p "/method:1.2.3.4:" 'localname
) ""))
311 (should (string-equal
312 (file-remote-p "/method:user@1.2.3.4:")
313 (format "/%s:%s@%s:" "method" "user" "1.2.3.4")))
314 (should (string-equal
315 (file-remote-p "/method:user@1.2.3.4:" 'method
) "method"))
316 (should (string-equal (file-remote-p "/method:user@1.2.3.4:" 'user
) "user"))
317 (should (string-equal
318 (file-remote-p "/method:user@1.2.3.4:" 'host
) "1.2.3.4"))
319 (should (string-equal
320 (file-remote-p "/method:user@1.2.3.4:" 'localname
) ""))
322 ;; Expand `tramp-default-method', `tramp-default-user' and
323 ;; `tramp-default-host'.
324 (should (string-equal
325 (file-remote-p "/[]:")
327 "/%s:%s@%s:" "default-method" "default-user" "default-host")))
328 (should (string-equal (file-remote-p "/[]:" 'method
) "default-method"))
329 (should (string-equal (file-remote-p "/[]:" 'user
) "default-user"))
330 (should (string-equal (file-remote-p "/[]:" 'host
) "default-host"))
331 (should (string-equal (file-remote-p "/[]:" 'localname
) ""))
333 ;; Expand `tramp-default-method' and `tramp-default-user'.
334 (let ((tramp-default-host "::1"))
335 (should (string-equal
336 (file-remote-p "/[]:")
337 (format "/%s:%s@%s:" "default-method" "default-user" "[::1]")))
338 (should (string-equal (file-remote-p "/[]:" 'method
) "default-method"))
339 (should (string-equal (file-remote-p "/[]:" 'user
) "default-user"))
340 (should (string-equal (file-remote-p "/[]:" 'host
) "::1"))
341 (should (string-equal (file-remote-p "/[]:" 'localname
) "")))
343 ;; Expand `tramp-default-method' and `tramp-default-user'.
344 (should (string-equal
345 (file-remote-p "/[::1]:")
346 (format "/%s:%s@%s:" "default-method" "default-user" "[::1]")))
347 (should (string-equal (file-remote-p "/[::1]:" 'method
) "default-method"))
348 (should (string-equal (file-remote-p "/[::1]:" 'user
) "default-user"))
349 (should (string-equal (file-remote-p "/[::1]:" 'host
) "::1"))
350 (should (string-equal (file-remote-p "/[::1]:" 'localname
) ""))
352 ;; Expand `tramp-default-method'.
353 (should (string-equal
354 (file-remote-p "/user@[::1]:")
355 (format "/%s:%s@%s:" "default-method" "user" "[::1]")))
356 (should (string-equal
357 (file-remote-p "/user@[::1]:" 'method
) "default-method"))
358 (should (string-equal (file-remote-p "/user@[::1]:" 'user
) "user"))
359 (should (string-equal (file-remote-p "/user@[::1]:" 'host
) "::1"))
360 (should (string-equal (file-remote-p "/user@[::1]:" 'localname
) ""))
362 ;; Expand `tramp-default-user'.
363 (should (string-equal
364 (file-remote-p "/method:[::1]:")
365 (format "/%s:%s@%s:" "method" "default-user" "[::1]")))
366 (should (string-equal (file-remote-p "/method:[::1]:" 'method
) "method"))
367 (should (string-equal
368 (file-remote-p "/method:[::1]:" 'user
) "default-user"))
369 (should (string-equal (file-remote-p "/method:[::1]:" 'host
) "::1"))
370 (should (string-equal (file-remote-p "/method:[::1]:" 'localname
) ""))
373 (should (string-equal
374 (file-remote-p "/method:user@[::1]:")
375 (format "/%s:%s@%s:" "method" "user" "[::1]")))
376 (should (string-equal
377 (file-remote-p "/method:user@[::1]:" 'method
) "method"))
378 (should (string-equal (file-remote-p "/method:user@[::1]:" 'user
) "user"))
379 (should (string-equal (file-remote-p "/method:user@[::1]:" 'host
) "::1"))
380 (should (string-equal
381 (file-remote-p "/method:user@[::1]:" 'localname
) ""))
383 ;; Local file name part.
384 (should (string-equal (file-remote-p "/host:/:" 'localname
) "/:"))
385 (should (string-equal (file-remote-p "/method:::" 'localname
) ":"))
386 (should (string-equal (file-remote-p "/method:: " 'localname
) " "))
387 (should (string-equal (file-remote-p "/method::file" 'localname
) "file"))
388 (should (string-equal
389 (file-remote-p "/method::/path/to/file" 'localname
)
395 (file-remote-p "/method1:user1@host1|method2:user2@host2:/path/to/file")
396 (format "/%s:%s@%s:" "method2" "user2" "host2")))
400 "/method1:user1@host1|method2:user2@host2:/path/to/file" 'method
)
405 "/method1:user1@host1|method2:user2@host2:/path/to/file" 'user
)
410 "/method1:user1@host1|method2:user2@host2:/path/to/file" 'host
)
415 "/method1:user1@host1|method2:user2@host2:/path/to/file" 'localname
)
421 "/method1:user1@host1|method2:user2@host2|method3:user3@host3:/path/to/file")
422 (format "/%s:%s@%s:" "method3" "user3" "host3")))
426 "/method1:user1@host1|method2:user2@host2|method3:user3@host3:/path/to/file"
432 "/method1:user1@host1|method2:user2@host2|method3:user3@host3:/path/to/file"
438 "/method1:user1@host1|method2:user2@host2|method3:user3@host3:/path/to/file"
444 "/method1:user1@host1|method2:user2@host2|method3:user3@host3:/path/to/file"
448 (ert-deftest tramp-test03-file-name-defaults
()
449 "Check default values for some methods."
450 ;; Default values in tramp-adb.el.
451 (should (string-equal (file-remote-p "/adb::" 'host
) ""))
452 ;; Default values in tramp-ftp.el.
453 (should (string-equal (file-remote-p "/ftp.host:" 'method
) "ftp"))
454 (dolist (u '("ftp" "anonymous"))
455 (should (string-equal (file-remote-p (format "/%s@:" u
) 'method
) "ftp")))
456 ;; Default values in tramp-gvfs.el.
457 (when (and (load "tramp-gvfs" 'noerror
'nomessage
)
458 (symbol-value 'tramp-gvfs-enabled
))
459 (should (string-equal (file-remote-p "/synce::" 'user
) nil
)))
460 ;; Default values in tramp-gw.el.
461 (dolist (m '("tunnel" "socks"))
463 (string-equal (file-remote-p (format "/%s::" m
) 'user
) (user-login-name))))
464 ;; Default values in tramp-sh.el.
465 (dolist (h `("127.0.0.1" "[::1]" "localhost" "localhost6" ,(system-name)))
466 (should (string-equal (file-remote-p (format "/root@%s:" h
) 'method
) "su")))
467 (dolist (m '("su" "sudo" "ksu"))
468 (should (string-equal (file-remote-p (format "/%s::" m
) 'user
) "root")))
469 (dolist (m '("rcp" "remcp" "rsh" "telnet" "krlogin" "fcp"))
471 (string-equal (file-remote-p (format "/%s::" m
) 'user
) (user-login-name))))
472 ;; Default values in tramp-smb.el.
473 (should (string-equal (file-remote-p "/user%domain@host:" 'method
) "smb"))
474 (should (string-equal (file-remote-p "/smb::" 'user
) nil
)))
476 (ert-deftest tramp-test04-substitute-in-file-name
()
477 "Check `substitute-in-file-name'."
478 (should (string-equal (substitute-in-file-name "/method:host://foo") "/foo"))
481 (substitute-in-file-name "/method:host:/path//foo") "/method:host:/foo"))
483 (string-equal (substitute-in-file-name "/method:host:/path///foo") "/foo"))
486 (substitute-in-file-name "/method:host:/path/~/foo") "/method:host:~/foo"))
488 (string-equal (substitute-in-file-name "/method:host:/path//~/foo") "~/foo"))
489 (let (process-environment)
492 (substitute-in-file-name "/method:host:/path/$FOO")
493 "/method:host:/path/$FOO"))
497 (substitute-in-file-name "/method:host:/path/$FOO")
498 "/method:host:/path/bla"))
501 (substitute-in-file-name "/method:host:/path/$$FOO")
502 "/method:host:/path/$FOO"))))
504 (ert-deftest tramp-test05-expand-file-name
()
505 "Check `expand-file-name'."
508 (expand-file-name "/method:host:/path/./file") "/method:host:/path/file"))
511 (expand-file-name "/method:host:/path/../file") "/method:host:/file")))
513 (ert-deftest tramp-test06-directory-file-name
()
514 "Check `directory-file-name'.
515 This checks also `file-name-as-directory', `file-name-directory'
516 and `file-name-nondirectory'."
519 (directory-file-name "/method:host:/path/to/file")
520 "/method:host:/path/to/file"))
523 (directory-file-name "/method:host:/path/to/file/")
524 "/method:host:/path/to/file"))
527 (file-name-as-directory "/method:host:/path/to/file")
528 "/method:host:/path/to/file/"))
531 (file-name-as-directory "/method:host:/path/to/file/")
532 "/method:host:/path/to/file/"))
535 (file-name-directory "/method:host:/path/to/file")
536 "/method:host:/path/to/"))
539 (file-name-directory "/method:host:/path/to/file/")
540 "/method:host:/path/to/file/"))
542 (string-equal (file-name-nondirectory "/method:host:/path/to/file") "file"))
544 (string-equal (file-name-nondirectory "/method:host:/path/to/file/") ""))
547 (unhandled-file-name-directory "/method:host:/path/to/file"))))
549 (ert-deftest tramp-test07-file-exists-p
()
550 "Check `file-exist-p', `write-region' and `delete-file'."
551 (skip-unless (tramp--test-enabled))
552 (tramp-cleanup-connection
553 (tramp-dissect-file-name tramp-test-temporary-file-directory
)
556 (let ((tmp-name (tramp--test-make-temp-name)))
557 (should-not (file-exists-p tmp-name
))
558 (write-region "foo" nil tmp-name
)
559 (should (file-exists-p tmp-name
))
560 (delete-file tmp-name
)
561 (should-not (file-exists-p tmp-name
))))
563 (ert-deftest tramp-test08-file-local-copy
()
564 "Check `file-local-copy'."
565 (skip-unless (tramp--test-enabled))
566 (tramp-cleanup-connection
567 (tramp-dissect-file-name tramp-test-temporary-file-directory
)
570 (let ((tmp-name1 (tramp--test-make-temp-name))
574 (write-region "foo" nil tmp-name1
)
575 (should (setq tmp-name2
(file-local-copy tmp-name1
)))
577 (insert-file-contents tmp-name2
)
578 (should (string-equal (buffer-string) "foo"))))
580 (delete-file tmp-name1
)
581 (delete-file tmp-name2
)))))
583 (ert-deftest tramp-test09-insert-file-contents
()
584 "Check `insert-file-contents'."
585 (skip-unless (tramp--test-enabled))
586 (tramp-cleanup-connection
587 (tramp-dissect-file-name tramp-test-temporary-file-directory
)
590 (let ((tmp-name (tramp--test-make-temp-name)))
593 (write-region "foo" nil tmp-name
)
595 (insert-file-contents tmp-name
)
596 (should (string-equal (buffer-string) "foo"))
597 (insert-file-contents tmp-name
)
598 (should (string-equal (buffer-string) "foofoo"))
600 (insert-file-contents tmp-name nil
1 3)
601 (should (string-equal (buffer-string) "oofoofoo"))
603 (insert-file-contents tmp-name nil nil nil
'replace
)
604 (should (string-equal (buffer-string) "foo"))))
605 (ignore-errors (delete-file tmp-name
)))))
607 (ert-deftest tramp-test10-write-region
()
608 "Check `write-region'."
609 (skip-unless (tramp--test-enabled))
610 (tramp-cleanup-connection
611 (tramp-dissect-file-name tramp-test-temporary-file-directory
)
614 (let ((tmp-name (tramp--test-make-temp-name)))
619 (write-region nil nil tmp-name
))
621 (insert-file-contents tmp-name
)
622 (should (string-equal (buffer-string) "foo")))
626 (write-region nil nil tmp-name
'append
))
628 (insert-file-contents tmp-name
)
629 (should (string-equal (buffer-string) "foobla")))
631 (write-region "foo" nil tmp-name
)
633 (insert-file-contents tmp-name
)
634 (should (string-equal (buffer-string) "foo")))
638 (write-region 3 5 tmp-name
))
640 (insert-file-contents tmp-name
)
641 (should (string-equal (buffer-string) "34"))))
642 (ignore-errors (delete-file tmp-name
)))))
644 (ert-deftest tramp-test11-copy-file
()
646 (skip-unless (tramp--test-enabled))
647 (tramp-cleanup-connection
648 (tramp-dissect-file-name tramp-test-temporary-file-directory
)
651 (let ((tmp-name1 (tramp--test-make-temp-name))
652 (tmp-name2 (tramp--test-make-temp-name)))
655 (write-region "foo" nil tmp-name1
)
656 (copy-file tmp-name1 tmp-name2
)
657 (should (file-exists-p tmp-name2
))
659 (insert-file-contents tmp-name2
)
660 (should (string-equal (buffer-string) "foo"))))
662 (delete-file tmp-name1
)
663 (delete-file tmp-name2
)))))
665 (ert-deftest tramp-test12-rename-file
()
666 "Check `rename-file'."
667 (skip-unless (tramp--test-enabled))
668 (tramp-cleanup-connection
669 (tramp-dissect-file-name tramp-test-temporary-file-directory
)
672 (let ((tmp-name1 (tramp--test-make-temp-name))
673 (tmp-name2 (tramp--test-make-temp-name)))
676 (write-region "foo" nil tmp-name1
)
677 (rename-file tmp-name1 tmp-name2
)
678 (should-not (file-exists-p tmp-name1
))
679 (should (file-exists-p tmp-name2
))
681 (insert-file-contents tmp-name2
)
682 (should (string-equal (buffer-string) "foo"))))
683 (ignore-errors (delete-file tmp-name2
)))))
685 (ert-deftest tramp-test13-make-directory
()
686 "Check `make-directory'.
687 This tests also `file-directory-p' and `file-accessible-directory-p'."
688 (skip-unless (tramp--test-enabled))
689 (tramp-cleanup-connection
690 (tramp-dissect-file-name tramp-test-temporary-file-directory
)
693 (let ((tmp-name (tramp--test-make-temp-name)))
696 (make-directory tmp-name
)
697 (should (file-directory-p tmp-name
))
698 (should (file-accessible-directory-p tmp-name
)))
699 (ignore-errors (delete-directory tmp-name
)))))
701 (ert-deftest tramp-test14-delete-directory
()
702 "Check `delete-directory'."
703 (skip-unless (tramp--test-enabled))
704 (tramp-cleanup-connection
705 (tramp-dissect-file-name tramp-test-temporary-file-directory
)
708 (let ((tmp-name (tramp--test-make-temp-name)))
709 ;; Delete empty directory.
710 (make-directory tmp-name
)
711 (should (file-directory-p tmp-name
))
712 (delete-directory tmp-name
)
713 (should-not (file-directory-p tmp-name
))
714 ;; Delete non-empty directory.
715 (make-directory tmp-name
)
716 (write-region "foo" nil
(expand-file-name "bla" tmp-name
))
717 (should-error (delete-directory tmp-name
))
718 (delete-directory tmp-name
'recursive
)
719 (should-not (file-directory-p tmp-name
))))
721 (ert-deftest tramp-test15-copy-directory
()
722 "Check `copy-directory'."
723 (skip-unless (tramp--test-enabled))
724 (tramp-cleanup-connection
725 (tramp-dissect-file-name tramp-test-temporary-file-directory
)
728 (let* ((tmp-name1 (tramp--test-make-temp-name))
729 (tmp-name2 (tramp--test-make-temp-name))
730 (tmp-name3 (expand-file-name
731 (file-name-nondirectory tmp-name1
) tmp-name2
))
732 (tmp-name4 (expand-file-name "foo" tmp-name1
))
733 (tmp-name5 (expand-file-name "foo" tmp-name2
))
734 (tmp-name6 (expand-file-name "foo" tmp-name3
)))
737 ;; Copy empty directory.
738 (make-directory tmp-name1
)
739 (write-region "foo" nil tmp-name4
)
740 (should (file-directory-p tmp-name1
))
741 (should (file-exists-p tmp-name4
))
742 (copy-directory tmp-name1 tmp-name2
)
743 (should (file-directory-p tmp-name2
))
744 (should (file-exists-p tmp-name5
))
745 ;; Target directory does exist already.
746 (copy-directory tmp-name1 tmp-name2
)
747 (should (file-directory-p tmp-name3
))
748 (should (file-exists-p tmp-name6
)))
750 (delete-directory tmp-name1
'recursive
)
751 (delete-directory tmp-name2
'recursive
)))))
753 (ert-deftest tramp-test16-directory-files
()
754 "Check `directory-files'."
755 (skip-unless (tramp--test-enabled))
756 (tramp-cleanup-connection
757 (tramp-dissect-file-name tramp-test-temporary-file-directory
)
760 (let* ((tmp-name1 (tramp--test-make-temp-name))
761 (tmp-name2 (expand-file-name "bla" tmp-name1
))
762 (tmp-name3 (expand-file-name "foo" tmp-name1
)))
765 (make-directory tmp-name1
)
766 (write-region "foo" nil tmp-name2
)
767 (write-region "bla" nil tmp-name3
)
768 (should (file-directory-p tmp-name1
))
769 (should (file-exists-p tmp-name2
))
770 (should (file-exists-p tmp-name3
))
771 (should (equal (directory-files tmp-name1
) '("." ".." "bla" "foo")))
772 (should (equal (directory-files tmp-name1
'full
)
773 `(,(concat tmp-name1
"/.")
774 ,(concat tmp-name1
"/..")
775 ,tmp-name2
,tmp-name3
)))
776 (should (equal (directory-files
777 tmp-name1 nil directory-files-no-dot-files-regexp
)
779 (should (equal (directory-files
780 tmp-name1
'full directory-files-no-dot-files-regexp
)
781 `(,tmp-name2
,tmp-name3
))))
782 (ignore-errors (delete-directory tmp-name1
'recursive
)))))
784 (ert-deftest tramp-test17-insert-directory
()
785 "Check `insert-directory'."
786 (skip-unless (tramp--test-enabled))
787 (tramp-cleanup-connection
788 (tramp-dissect-file-name tramp-test-temporary-file-directory
)
791 (let* ((tmp-name1 (tramp--test-make-temp-name))
792 (tmp-name2 (expand-file-name "foo" tmp-name1
)))
795 (make-directory tmp-name1
)
796 (write-region "foo" nil tmp-name2
)
797 (should (file-directory-p tmp-name1
))
798 (should (file-exists-p tmp-name2
))
800 (insert-directory tmp-name1 nil
)
801 (goto-char (point-min))
802 (should (looking-at-p (regexp-quote tmp-name1
))))
804 (insert-directory tmp-name1
"-al")
805 (goto-char (point-min))
806 (should (looking-at-p (format "^.+ %s$" (regexp-quote tmp-name1
)))))
808 (insert-directory (file-name-as-directory tmp-name1
) "-al")
809 (goto-char (point-min))
811 (looking-at-p (format "^.+ %s/$" (regexp-quote tmp-name1
)))))
814 (file-name-as-directory tmp-name1
) "-al" nil
'full-directory-p
)
815 (goto-char (point-min))
817 (looking-at-p "total +[[:digit:]]+\n.+ \\.\n.+ \\.\\.\n.+ foo$"))))
818 (ignore-errors (delete-directory tmp-name1
'recursive
)))))
820 (ert-deftest tramp-test18-file-attributes
()
821 "Check `file-attributes'.
822 This tests also `file-readable-p' and `file-regular-p'."
823 (skip-unless (tramp--test-enabled))
824 (tramp-cleanup-connection
825 (tramp-dissect-file-name tramp-test-temporary-file-directory
)
828 (let ((tmp-name (tramp--test-make-temp-name))
832 (write-region "foo" nil tmp-name
)
833 (should (file-exists-p tmp-name
))
834 (setq attr
(file-attributes tmp-name
))
835 (should (consp attr
))
836 (should (file-exists-p tmp-name
))
837 (should (file-readable-p tmp-name
))
838 (should (file-regular-p tmp-name
))
839 ;; We do not test inodes and device numbers.
840 (should (null (car attr
)))
841 (should (numberp (nth 1 attr
))) ;; Link.
842 (should (numberp (nth 2 attr
))) ;; Uid.
843 (should (numberp (nth 3 attr
))) ;; Gid.
845 (should (stringp (current-time-string (nth 4 attr
))))
846 ;; Last modification time.
847 (should (stringp (current-time-string (nth 5 attr
))))
848 ;; Last status change time.
849 (should (stringp (current-time-string (nth 6 attr
))))
850 (should (numberp (nth 7 attr
))) ;; Size.
851 (should (stringp (nth 8 attr
))) ;; Modes.
853 (setq attr
(file-attributes tmp-name
'string
))
854 (should (stringp (nth 2 attr
))) ;; Uid.
855 (should (stringp (nth 3 attr
))) ;; Gid.
856 (delete-file tmp-name
)
858 (make-directory tmp-name
)
859 (should (file-exists-p tmp-name
))
860 (should (file-readable-p tmp-name
))
861 (should-not (file-regular-p tmp-name
))
862 (setq attr
(file-attributes tmp-name
))
863 (should (eq (car attr
) t
)))
864 (ignore-errors (delete-directory tmp-name
)))))
866 (ert-deftest tramp-test19-directory-files-and-attributes
()
867 "Check `directory-files-and-attributes'."
868 (skip-unless (tramp--test-enabled))
869 (tramp-cleanup-connection
870 (tramp-dissect-file-name tramp-test-temporary-file-directory
)
873 (let ((tmp-name (tramp--test-make-temp-name))
877 (make-directory tmp-name
)
878 (should (file-directory-p tmp-name
))
879 (write-region "foo" nil
(expand-file-name "foo" tmp-name
))
880 (write-region "bar" nil
(expand-file-name "bar" tmp-name
))
881 (write-region "boz" nil
(expand-file-name "boz" tmp-name
))
882 (setq attr
(directory-files-and-attributes tmp-name
))
883 (should (consp attr
))
886 (equal (file-attributes (expand-file-name (car elt
) tmp-name
))
888 (setq attr
(directory-files-and-attributes tmp-name
'full
))
891 (equal (file-attributes (car elt
)) (cdr elt
))))
892 (setq attr
(directory-files-and-attributes tmp-name nil
"^b"))
893 (should (equal (mapcar 'car attr
) '("bar" "boz"))))
894 (ignore-errors (delete-directory tmp-name
'recursive
)))))
896 (ert-deftest tramp-test20-file-modes
()
898 This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
899 (skip-unless (tramp--test-enabled))
900 (tramp-cleanup-connection
901 (tramp-dissect-file-name tramp-test-temporary-file-directory
)
904 (let ((tmp-name (tramp--test-make-temp-name)))
907 (write-region "foo" nil tmp-name
)
908 (should (file-exists-p tmp-name
))
909 (set-file-modes tmp-name
#o777
)
910 (should (= (file-modes tmp-name
) #o777
))
911 (should (file-executable-p tmp-name
))
912 (should (file-writable-p tmp-name
))
913 (set-file-modes tmp-name
#o444
)
914 (should (= (file-modes tmp-name
) #o444
))
915 (should-not (file-executable-p tmp-name
))
916 ;; A file is always writable for user "root".
917 (unless (string-equal (file-remote-p tmp-name
'user
) "root")
918 (should-not (file-writable-p tmp-name
))))
919 (ignore-errors (delete-file tmp-name
)))))
921 (ert-deftest tramp-test21-file-links
()
922 "Check `file-symlink-p'.
923 This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
924 (skip-unless (tramp--test-enabled))
925 (tramp-cleanup-connection
926 (tramp-dissect-file-name tramp-test-temporary-file-directory
)
929 (let ((tmp-name1 (tramp--test-make-temp-name))
930 (tmp-name2 (tramp--test-make-temp-name))
931 (tmp-name3 (make-temp-name "tramp-")))
934 (write-region "foo" nil tmp-name1
)
935 (should (file-exists-p tmp-name1
))
936 (make-symbolic-link tmp-name1 tmp-name2
)
937 (should (file-symlink-p tmp-name2
))
938 (should-error (make-symbolic-link tmp-name1 tmp-name2
))
939 (make-symbolic-link tmp-name1 tmp-name2
'ok-if-already-exists
)
940 (should (file-symlink-p tmp-name2
))
941 ;; `tmp-name3' is a local file name.
942 (should-error (make-symbolic-link tmp-name1 tmp-name3
)))
944 (delete-file tmp-name1
)
945 (delete-file tmp-name2
)))
949 (write-region "foo" nil tmp-name1
)
950 (should (file-exists-p tmp-name1
))
951 (add-name-to-file tmp-name1 tmp-name2
)
952 (should-not (file-symlink-p tmp-name2
))
953 (should-error (add-name-to-file tmp-name1 tmp-name2
))
954 (add-name-to-file tmp-name1 tmp-name2
'ok-if-already-exists
)
955 (should-not (file-symlink-p tmp-name2
))
956 ;; `tmp-name3' is a local file name.
957 (should-error (add-name-to-file tmp-name1 tmp-name3
)))
959 (delete-file tmp-name1
)
960 (delete-file tmp-name2
)))
964 (write-region "foo" nil tmp-name1
)
965 (should (file-exists-p tmp-name1
))
966 (make-symbolic-link tmp-name1 tmp-name2
)
967 (should (file-symlink-p tmp-name2
))
968 (should-not (string-equal tmp-name2
(file-truename tmp-name2
)))
970 (string-equal (file-truename tmp-name1
) (file-truename tmp-name2
))))
972 (delete-file tmp-name1
)
973 (delete-file tmp-name2
)))))
975 (ert-deftest tramp-test22-file-times
()
976 "Check `set-file-times' and `file-newer-than-file-p'."
977 (skip-unless (tramp--test-enabled))
978 (tramp-cleanup-connection
979 (tramp-dissect-file-name tramp-test-temporary-file-directory
)
982 (let ((tmp-name1 (tramp--test-make-temp-name))
983 (tmp-name2 (tramp--test-make-temp-name))
984 (tmp-name3 (tramp--test-make-temp-name)))
987 (write-region "foo" nil tmp-name1
)
988 (should (file-exists-p tmp-name1
))
989 (should (consp (nth 5 (file-attributes tmp-name1
))))
990 ;; '(0 0) means don't know, and will be replaced by `current-time'.
991 (set-file-times tmp-name1
'(0 1))
992 (should (equal (nth 5 (file-attributes tmp-name1
)) '(0 1)))
993 (write-region "bla" nil tmp-name2
)
994 (should (file-exists-p tmp-name2
))
995 (should (file-newer-than-file-p tmp-name2 tmp-name1
))
996 ;; `tmp-name3' does not exist.
997 (should (file-newer-than-file-p tmp-name2 tmp-name3
))
998 (should-not (file-newer-than-file-p tmp-name3 tmp-name1
)))
1000 (delete-file tmp-name1
)
1001 (delete-file tmp-name2
)))))
1003 (ert-deftest tramp-test23-visited-file-modtime
()
1004 "Check `set-visited-file-modtime' and `verify-visited-file-modtime'."
1005 (skip-unless (tramp--test-enabled))
1006 (tramp-cleanup-connection
1007 (tramp-dissect-file-name tramp-test-temporary-file-directory
)
1010 (let ((tmp-name (tramp--test-make-temp-name)))
1013 (write-region "foo" nil tmp-name
)
1014 (should (file-exists-p tmp-name
))
1016 (insert-file-contents tmp-name
)
1017 (should (verify-visited-file-modtime))
1018 (set-visited-file-modtime '(0 1))
1019 (should (verify-visited-file-modtime))
1020 (should (equal (visited-file-modtime) '(0 1 0 0)))))
1021 (ignore-errors (delete-file tmp-name
)))))
1023 (ert-deftest tramp-test24-file-name-completion
()
1024 "Check `file-name-completion' and `file-name-all-completions'."
1025 (skip-unless (tramp--test-enabled))
1026 (tramp-cleanup-connection
1027 (tramp-dissect-file-name tramp-test-temporary-file-directory
)
1030 (let ((tmp-name (tramp--test-make-temp-name)))
1033 (make-directory tmp-name
)
1034 (should (file-directory-p tmp-name
))
1035 (write-region "foo" nil
(expand-file-name "foo" tmp-name
))
1036 (write-region "bar" nil
(expand-file-name "bold" tmp-name
))
1037 (make-directory (expand-file-name "boz" tmp-name
))
1038 (should (equal (file-name-completion "fo" tmp-name
) "foo"))
1039 (should (equal (file-name-completion "b" tmp-name
) "bo"))
1041 (equal (file-name-completion "b" tmp-name
'file-directory-p
) "boz/"))
1042 (should (equal (file-name-all-completions "fo" tmp-name
) '("foo")))
1044 (equal (sort (file-name-all-completions "b" tmp-name
) 'string-lessp
)
1046 (ignore-errors (delete-directory tmp-name
'recursive
)))))
1048 (ert-deftest tramp-test25-load
()
1050 (skip-unless (tramp--test-enabled))
1051 (tramp-cleanup-connection
1052 (tramp-dissect-file-name tramp-test-temporary-file-directory
)
1055 (let ((tmp-name (tramp--test-make-temp-name)))
1058 (load tmp-name
'noerror
'nomessage
)
1059 (should-not (featurep 'tramp-test-load
))
1060 (write-region "(provide 'tramp-test-load)" nil tmp-name
)
1061 ;; `load' in lread.c does not pass `must-suffix'. Why?
1062 ;(should-error (load tmp-name nil 'nomessage 'nosuffix 'must-suffix))
1063 (load tmp-name nil
'nomessage
'nosuffix
)
1064 (should (featurep 'tramp-test-load
)))
1066 (and (featurep 'tramp-test-load
) (unload-feature 'tramp-test-load
))
1067 (delete-file tmp-name
)))))
1069 (ert-deftest tramp-test26-process-file
()
1070 "Check `process-file'."
1071 (skip-unless (tramp--test-enabled))
1072 (tramp-cleanup-connection
1073 (tramp-dissect-file-name tramp-test-temporary-file-directory
)
1076 (let ((tmp-name (tramp--test-make-temp-name))
1077 (default-directory tramp-test-temporary-file-directory
))
1080 ;; We cannot use "/bin/true" and "/bin/false"; those paths
1081 ;; do not exist on hydra.
1082 (should (zerop (process-file "true")))
1083 (should-not (zerop (process-file "false")))
1084 (should-not (zerop (process-file "binary-does-not-exist")))
1086 (write-region "foo" nil tmp-name
)
1087 (should (zerop (process-file "ls" nil t
)))
1088 (should (> (point-max) (point-min)))))
1089 (ignore-errors (delete-file tmp-name
)))))
1091 (ert-deftest tramp-test27-start-file-process
()
1092 "Check `start-file-process'."
1093 (skip-unless (tramp--test-enabled))
1094 (tramp-cleanup-connection
1095 (tramp-dissect-file-name tramp-test-temporary-file-directory
)
1098 (let ((default-directory tramp-test-temporary-file-directory
)
1099 (tmp-name (tramp--test-make-temp-name))
1100 kill-buffer-query-functions proc
)
1103 (setq proc
(start-file-process "test1" (current-buffer) "cat"))
1104 (should (processp proc
))
1105 (should (equal (process-status proc
) 'run
))
1106 (process-send-string proc
"foo")
1107 (process-send-eof proc
)
1108 (accept-process-output proc
1)
1109 (should (string-equal (buffer-string) "foo")))
1110 (ignore-errors (delete-process proc
)))
1114 (write-region "foo" nil tmp-name
)
1115 (should (file-exists-p tmp-name
))
1118 "test2" (current-buffer)
1119 "cat" (file-name-nondirectory tmp-name
)))
1120 (should (processp proc
))
1121 (accept-process-output proc
1)
1122 (should (string-equal (buffer-string) "foo")))
1124 (delete-process proc
)
1125 (delete-file tmp-name
)))
1129 (setq proc
(start-file-process "test3" nil
"cat"))
1130 (should (processp proc
))
1131 (should (equal (process-status proc
) 'run
))
1133 proc
(lambda (p s
) (should (string-equal s
"foo"))))
1134 (process-send-string proc
"foo")
1135 (process-send-eof proc
)
1136 (accept-process-output proc
1))
1137 (ignore-errors (delete-process proc
)))))
1139 (ert-deftest tramp-test28-shell-command
()
1140 "Check `shell-command'."
1141 (skip-unless (tramp--test-enabled))
1142 (tramp-cleanup-connection
1143 (tramp-dissect-file-name tramp-test-temporary-file-directory
)
1146 (let ((tmp-name (tramp--test-make-temp-name))
1147 (default-directory tramp-test-temporary-file-directory
))
1150 (write-region "foo" nil tmp-name
)
1151 (shell-command "ls" (current-buffer))
1152 (should (> (point-max) (point-min))))
1153 (ignore-errors (delete-file tmp-name
)))))
1155 (ert-deftest tramp-test29-utf8
()
1156 "Check UTF8 encoding in file names and file contents."
1157 (skip-unless (tramp--test-enabled))
1158 (tramp-cleanup-connection
1159 (tramp-dissect-file-name tramp-test-temporary-file-directory
)
1162 (let ((tmp-name (tramp--test-make-temp-name))
1163 (arabic "أصبح بوسعك الآن تنزيل نسخة كاملة من موسوعة ويكيبيديا العربية لتصفحها بلا اتصال بالإنترنت")
1164 (chinese "银河系漫游指南系列")
1165 (russian "Автостопом по гала́ктике"))
1168 (make-directory tmp-name
)
1169 (dolist (lang `(,arabic
,chinese
,russian
))
1170 (let ((file (expand-file-name lang tmp-name
)))
1171 (write-region lang nil file
)
1172 (should (file-exists-p file
))
1173 ;; Check file contents.
1175 (insert-file-contents file
)
1176 (should (string-equal (buffer-string) lang
)))))
1177 ;; Check file names.
1178 (should (equal (directory-files
1179 tmp-name nil directory-files-no-dot-files-regexp
)
1180 (sort `(,arabic
,chinese
,russian
) 'string-lessp
))))
1181 (ignore-errors (delete-directory tmp-name
'recursive
)))))
1185 ;; * dired-compress-file
1188 ;; * file-ownership-preserved-p
1189 ;; * file-selinux-context
1190 ;; * find-backup-file-name
1191 ;; * make-auto-save-file-name
1193 ;; * set-file-selinux-context
1196 ;; * Fix `tramp-test17-insert-directory' for
1197 ;; `ls-lisp-insert-directory' ("plink" and friends).
1198 ;; * Fix `tramp-test27-start-file-process' on MS Windows
1199 ;; (`process-send-eof'?).
1200 ;; * Fix `tramp-test29-utf8' on MS Windows.
1202 (defun tramp-test-all (&optional interactive
)
1203 "Run all tests for \\[tramp]."
1206 (if interactive
'ert-run-tests-interactively
'ert-run-tests-batch
) "^tramp"))
1208 (provide 'tramp-tests
)
1209 ;;; tramp-tests.el ends here