;;; tramp-tests.el --- Tests of remote file access
-;; Copyright (C) 2013-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2016 Free Software Foundation, Inc.
;; Author: Michael Albinus <michael.albinus@gmx.de>
(require 'vc-git)
(require 'vc-hg)
+(autoload 'dired-uncache "dired")
(declare-function tramp-find-executable "tramp-sh")
(declare-function tramp-get-remote-path "tramp-sh")
(declare-function tramp-get-remote-stat "tramp-sh")
(declare-function tramp-get-remote-perl "tramp-sh")
(defvar tramp-copy-size-limit)
+(defvar tramp-persistency-file-name)
(defvar tramp-remote-process-environment)
;; There is no default value on w32 systems, which could work out of the box.
(setq password-cache-expiry nil
tramp-verbose 0
tramp-copy-size-limit nil
- tramp-message-show-message nil)
+ tramp-message-show-message nil
+ tramp-persistency-file-name nil)
;; This shall happen on hydra only.
(when (getenv "NIX_STORE")
(declare (indent 1) (debug (natnump body)))
`(let ((tramp-verbose ,verbose)
(tramp-message-show-message t)
- (tramp-debug-on-error t))
+ (tramp-debug-on-error t)
+ (debug-ignored-errors
+ (cons "^make-symbolic-link not supported$" debug-ignored-errors)))
(unwind-protect
(progn ,@body)
(when (> tramp-verbose 3)
(should (string-equal (file-remote-p "/method::" 'user) "default-user"))
(should (string-equal (file-remote-p "/method::" 'host) "default-host"))
(should (string-equal (file-remote-p "/method::" 'localname) ""))
+ (should (string-equal (file-remote-p "/method::" 'hop) nil))
;; Expand `tramp-default-method' and `tramp-default-user'.
(should (string-equal
(should (string-equal (file-remote-p "/host:" 'user) "default-user"))
(should (string-equal (file-remote-p "/host:" 'host) "host"))
(should (string-equal (file-remote-p "/host:" 'localname) ""))
+ (should (string-equal (file-remote-p "/host:" 'hop) nil))
;; Expand `tramp-default-method' and `tramp-default-host'.
(should (string-equal
(should (string-equal (file-remote-p "/user@:" 'user) "user"))
(should (string-equal (file-remote-p "/user@:" 'host) "default-host"))
(should (string-equal (file-remote-p "/user@:" 'localname) ""))
+ (should (string-equal (file-remote-p "/user@:" 'hop) nil))
;; Expand `tramp-default-method'.
(should (string-equal
(should (string-equal (file-remote-p "/user@host:" 'user) "user"))
(should (string-equal (file-remote-p "/user@host:" 'host) "host"))
(should (string-equal (file-remote-p "/user@host:" 'localname) ""))
+ (should (string-equal (file-remote-p "/user@host:" 'hop) nil))
;; Expand `tramp-default-user'.
(should (string-equal
(should (string-equal (file-remote-p "/method:host:" 'user) "default-user"))
(should (string-equal (file-remote-p "/method:host:" 'host) "host"))
(should (string-equal (file-remote-p "/method:host:" 'localname) ""))
+ (should (string-equal (file-remote-p "/method:host:" 'hop) nil))
;; Expand `tramp-default-host'.
(should (string-equal
(should (string-equal (file-remote-p "/method:user@:" 'host)
"default-host"))
(should (string-equal (file-remote-p "/method:user@:" 'localname) ""))
+ (should (string-equal (file-remote-p "/method:user@:" 'hop) nil))
;; No expansion.
(should (string-equal
(should (string-equal (file-remote-p "/method:user@host:" 'user) "user"))
(should (string-equal (file-remote-p "/method:user@host:" 'host) "host"))
(should (string-equal (file-remote-p "/method:user@host:" 'localname) ""))
+ (should (string-equal (file-remote-p "/method:user@host:" 'hop) nil))
;; No expansion.
(should (string-equal
(file-remote-p "/method:user@email@host:" 'host) "host"))
(should (string-equal
(file-remote-p "/method:user@email@host:" 'localname) ""))
+ (should (string-equal
+ (file-remote-p "/method:user@email@host:" 'hop) nil))
;; Expand `tramp-default-method' and `tramp-default-user'.
(should (string-equal
(should (string-equal (file-remote-p "/host#1234:" 'user) "default-user"))
(should (string-equal (file-remote-p "/host#1234:" 'host) "host#1234"))
(should (string-equal (file-remote-p "/host#1234:" 'localname) ""))
+ (should (string-equal (file-remote-p "/host#1234:" 'hop) nil))
;; Expand `tramp-default-method'.
(should (string-equal
(should (string-equal (file-remote-p "/user@host#1234:" 'user) "user"))
(should (string-equal (file-remote-p "/user@host#1234:" 'host) "host#1234"))
(should (string-equal (file-remote-p "/user@host#1234:" 'localname) ""))
+ (should (string-equal (file-remote-p "/user@host#1234:" 'hop) nil))
;; Expand `tramp-default-user'.
(should (string-equal
(should (string-equal
(file-remote-p "/method:host#1234:" 'host) "host#1234"))
(should (string-equal (file-remote-p "/method:host#1234:" 'localname) ""))
+ (should (string-equal (file-remote-p "/method:host#1234:" 'hop) nil))
;; No expansion.
(should (string-equal
(file-remote-p "/method:user@host#1234:" 'host) "host#1234"))
(should (string-equal
(file-remote-p "/method:user@host#1234:" 'localname) ""))
+ (should (string-equal
+ (file-remote-p "/method:user@host#1234:" 'hop) nil))
;; Expand `tramp-default-method' and `tramp-default-user'.
(should (string-equal
(should (string-equal (file-remote-p "/1.2.3.4:" 'user) "default-user"))
(should (string-equal (file-remote-p "/1.2.3.4:" 'host) "1.2.3.4"))
(should (string-equal (file-remote-p "/1.2.3.4:" 'localname) ""))
+ (should (string-equal (file-remote-p "/1.2.3.4:" 'hop) nil))
;; Expand `tramp-default-method'.
(should (string-equal
(should (string-equal (file-remote-p "/user@1.2.3.4:" 'user) "user"))
(should (string-equal (file-remote-p "/user@1.2.3.4:" 'host) "1.2.3.4"))
(should (string-equal (file-remote-p "/user@1.2.3.4:" 'localname) ""))
+ (should (string-equal (file-remote-p "/user@1.2.3.4:" 'hop) nil))
;; Expand `tramp-default-user'.
(should (string-equal
(file-remote-p "/method:1.2.3.4:" 'user) "default-user"))
(should (string-equal (file-remote-p "/method:1.2.3.4:" 'host) "1.2.3.4"))
(should (string-equal (file-remote-p "/method:1.2.3.4:" 'localname) ""))
+ (should (string-equal (file-remote-p "/method:1.2.3.4:" 'hop) nil))
;; No expansion.
(should (string-equal
(file-remote-p "/method:user@1.2.3.4:" 'host) "1.2.3.4"))
(should (string-equal
(file-remote-p "/method:user@1.2.3.4:" 'localname) ""))
+ (should (string-equal
+ (file-remote-p "/method:user@1.2.3.4:" 'hop) nil))
;; Expand `tramp-default-method', `tramp-default-user' and
;; `tramp-default-host'.
(should (string-equal (file-remote-p "/[]:" 'user) "default-user"))
(should (string-equal (file-remote-p "/[]:" 'host) "default-host"))
(should (string-equal (file-remote-p "/[]:" 'localname) ""))
+ (should (string-equal (file-remote-p "/[]:" 'hop) nil))
;; Expand `tramp-default-method' and `tramp-default-user'.
(let ((tramp-default-host "::1"))
(should (string-equal (file-remote-p "/[]:" 'method) "default-method"))
(should (string-equal (file-remote-p "/[]:" 'user) "default-user"))
(should (string-equal (file-remote-p "/[]:" 'host) "::1"))
- (should (string-equal (file-remote-p "/[]:" 'localname) "")))
+ (should (string-equal (file-remote-p "/[]:" 'localname) ""))
+ (should (string-equal (file-remote-p "/[]:" 'hop) nil)))
;; Expand `tramp-default-method' and `tramp-default-user'.
(should (string-equal
(should (string-equal (file-remote-p "/[::1]:" 'user) "default-user"))
(should (string-equal (file-remote-p "/[::1]:" 'host) "::1"))
(should (string-equal (file-remote-p "/[::1]:" 'localname) ""))
+ (should (string-equal (file-remote-p "/[::1]:" 'hop) nil))
;; Expand `tramp-default-method'.
(should (string-equal
(should (string-equal (file-remote-p "/user@[::1]:" 'user) "user"))
(should (string-equal (file-remote-p "/user@[::1]:" 'host) "::1"))
(should (string-equal (file-remote-p "/user@[::1]:" 'localname) ""))
+ (should (string-equal (file-remote-p "/user@[::1]:" 'hop) nil))
;; Expand `tramp-default-user'.
(should (string-equal
(file-remote-p "/method:[::1]:" 'user) "default-user"))
(should (string-equal (file-remote-p "/method:[::1]:" 'host) "::1"))
(should (string-equal (file-remote-p "/method:[::1]:" 'localname) ""))
+ (should (string-equal (file-remote-p "/method:[::1]:" 'hop) nil))
;; No expansion.
(should (string-equal
(should (string-equal (file-remote-p "/method:user@[::1]:" 'host) "::1"))
(should (string-equal
(file-remote-p "/method:user@[::1]:" 'localname) ""))
+ (should (string-equal (file-remote-p "/method:user@[::1]:" 'hop) nil))
;; Local file name part.
(should (string-equal (file-remote-p "/host:/:" 'localname) "/:"))
(should
(string-equal
(file-remote-p "/method1:user1@host1|method2:user2@host2:/path/to/file")
- (format "/%s:%s@%s:" "method2" "user2" "host2")))
+ (format "/%s:%s@%s|%s:%s@%s:"
+ "method1" "user1" "host1" "method2" "user2" "host2")))
(should
(string-equal
(file-remote-p
(file-remote-p
"/method1:user1@host1|method2:user2@host2:/path/to/file" 'localname)
"/path/to/file"))
+ (should
+ (string-equal
+ (file-remote-p
+ "/method1:user1@host1|method2:user2@host2:/path/to/file" 'hop)
+ (format "%s:%s@%s|"
+ "method1" "user1" "host1")))
(should
(string-equal
(file-remote-p
"/method1:user1@host1|method2:user2@host2|method3:user3@host3:/path/to/file")
- (format "/%s:%s@%s:" "method3" "user3" "host3")))
+ (format "/%s:%s@%s|%s:%s@%s|%s:%s@%s:"
+ "method1" "user1" "host1"
+ "method2" "user2" "host2"
+ "method3" "user3" "host3")))
(should
(string-equal
(file-remote-p
(file-remote-p
"/method1:user1@host1|method2:user2@host2|method3:user3@host3:/path/to/file"
'localname)
- "/path/to/file"))))
+ "/path/to/file"))
+ (should
+ (string-equal
+ (file-remote-p
+ "/method1:user1@host1|method2:user2@host2|method3:user3@host3:/path/to/file"
+ 'hop)
+ (format "%s:%s@%s|%s:%s@%s|"
+ "method1" "user1" "host1" "method2" "user2" "host2")))))
(ert-deftest tramp-test03-file-name-defaults ()
"Check default values for some methods."
This tests also `file-directory-p' and `file-accessible-directory-p'."
(skip-unless (tramp--test-enabled))
- (let ((tmp-name (tramp--test-make-temp-name)))
+ (let* ((tmp-name1 (tramp--test-make-temp-name))
+ (tmp-name2 (expand-file-name "foo/bar" tmp-name1)))
(unwind-protect
(progn
- (make-directory tmp-name)
- (should (file-directory-p tmp-name))
- (should (file-accessible-directory-p tmp-name))
- (should-error
- (make-directory (expand-file-name "foo/bar" tmp-name))
- :type 'file-error)
- (make-directory (expand-file-name "foo/bar" tmp-name) 'parents)
- (should (file-directory-p (expand-file-name "foo/bar" tmp-name)))
- (should
- (file-accessible-directory-p (expand-file-name "foo/bar" tmp-name))))
+ (make-directory tmp-name1)
+ (should (file-directory-p tmp-name1))
+ (should (file-accessible-directory-p tmp-name1))
+ (should-error (make-directory tmp-name2) :type 'file-error)
+ (make-directory tmp-name2 'parents)
+ (should (file-directory-p tmp-name2))
+ (should (file-accessible-directory-p tmp-name2)))
;; Cleanup.
- (ignore-errors (delete-directory tmp-name 'recursive)))))
+ (ignore-errors (delete-directory tmp-name1 'recursive)))))
(ert-deftest tramp-test14-delete-directory ()
"Check `delete-directory'."
(file-truename tramp-test-temporary-file-directory))
(tmp-name1 (tramp--test-make-temp-name))
(tmp-name2 (tramp--test-make-temp-name))
+ ;; File name with "//".
+ (tmp-name3
+ (format
+ "%s%s"
+ (file-remote-p tmp-name1)
+ (replace-regexp-in-string
+ "/" "//" (file-remote-p tmp-name1 'localname))))
attr)
(unwind-protect
(progn
(file-error
(should (string-equal (error-message-string err)
"make-symbolic-link not supported"))))
- (delete-file tmp-name1)
+ ;; Check, that "//" in symlinks are handled properly.
+ (with-temp-buffer
+ (let ((default-directory tramp-test-temporary-file-directory))
+ (shell-command
+ (format
+ "ln -s %s %s"
+ (tramp-file-name-localname (tramp-dissect-file-name tmp-name3))
+ (tramp-file-name-localname (tramp-dissect-file-name tmp-name2)))
+ t)))
+ (when (file-symlink-p tmp-name2)
+ (setq attr (file-attributes tmp-name2))
+ (should
+ (string-equal
+ (car attr)
+ (tramp-file-name-localname (tramp-dissect-file-name tmp-name3))))
+ (delete-file tmp-name2))
+
+ (delete-file tmp-name1)
(make-directory tmp-name1)
(should (file-exists-p tmp-name1))
(should (file-readable-p tmp-name1))
(should (eq (car attr) t)))
;; Cleanup.
- (ignore-errors (delete-directory tmp-name1)))))
+ (ignore-errors (delete-directory tmp-name1))
+ (ignore-errors (delete-file tmp-name1))
+ (ignore-errors (delete-file tmp-name2)))))
(ert-deftest tramp-test19-directory-files-and-attributes ()
"Check `directory-files-and-attributes'."
(tmp-name1 (tramp--test-make-temp-name))
(tmp-name2 (tramp--test-make-temp-name))
(tmp-name3 (tramp--test-make-temp-name 'local)))
+
+ ;; Check `make-symbolic-link'.
(unwind-protect
(progn
(write-region "foo" nil tmp-name1)
(delete-file tmp-name1)
(delete-file tmp-name2)))
+ ;; Check `add-name-to-file'.
(unwind-protect
(progn
(write-region "foo" nil tmp-name1)
(delete-file tmp-name1)
(delete-file tmp-name2)))
+ ;; Check `file-truename'.
(unwind-protect
(progn
(write-region "foo" nil tmp-name1)
(ert-deftest tramp-test26-process-file ()
"Check `process-file'."
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(skip-unless
(not
(should-not (get-buffer-window (current-buffer) t))
;; Second run. The output must be appended.
+ (goto-char (point-max))
(should (zerop (process-file "ls" nil t t fnnd)))
;; `ls' could produce colorized output.
(goto-char (point-min))
(ert-deftest tramp-test27-start-file-process ()
"Check `start-file-process'."
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(skip-unless
(not
(ert-deftest tramp-test28-shell-command ()
"Check `shell-command'."
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(skip-unless
(not
(ert-deftest tramp-test29-vc-registered ()
"Check `vc-registered'."
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(skip-unless
(eq
(vc-handled-backends
(with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
(cond
+ ((tramp-find-executable v vc-git-program (tramp-get-remote-path v))
+ '(Git))
+ ((tramp-find-executable v vc-hg-program (tramp-get-remote-path v))
+ '(Hg))
((tramp-find-executable v vc-bzr-program (tramp-get-remote-path v))
(setq tramp-remote-process-environment
(cons (format "BZR_HOME=%s"
(tramp-dissect-file-name tramp-test-temporary-file-directory)
nil 'keep-password)
'(Bzr))
- ((tramp-find-executable v vc-git-program (tramp-get-remote-path v))
- '(Git))
- ((tramp-find-executable v vc-hg-program (tramp-get-remote-path v))
- '(Hg))
(t nil)))))
(skip-unless vc-handled-backends)
(message "%s" vc-handled-backends)
(let ((default-directory tmp-name1))
;; Create empty repository, and register the file.
- (vc-create-repo (car vc-handled-backends))
+ ;; Sometimes, creation of repository fails (bzr!); we skip
+ ;; the test then.
+ (condition-case nil
+ (vc-create-repo (car vc-handled-backends))
+ (error (skip-unless nil)))
;; The structure of VC-FILESET is not documented. Let's
;; hope it won't change.
(condition-case nil
(error
(vc-register
nil (list (car vc-handled-backends)
- (list (file-name-nondirectory tmp-name2)))))))
- (should (vc-registered tmp-name2)))
+ (list (file-name-nondirectory tmp-name2))))))
+ ;; vc-git uses an own process sentinel, Tramp's sentinel
+ ;; for flushing the cache isn't used.
+ (dired-uncache (concat (file-remote-p default-directory) "/"))
+ (should (vc-registered (file-name-nondirectory tmp-name2)))))
;; Cleanup.
(ignore-errors (delete-directory tmp-name1 'recursive)))))
(defun tramp--test-adb-p ()
"Check, whether the remote host runs Android.
This requires restrictions of file name syntax."
- (eq (tramp-find-foreign-file-name-handler
- tramp-test-temporary-file-directory)
- 'tramp-adb-file-name-handler))
+ (tramp-adb-file-name-p tramp-test-temporary-file-directory))
+
+(defun tramp--test-ftp-p ()
+ "Check, whether an FTP-like method is used.
+This does not support globbing characters in file names (yet)."
+ ;; Globbing characters are ??, ?* and ?\[.
+ (and (eq (tramp-find-foreign-file-name-handler
+ tramp-test-temporary-file-directory)
+ 'tramp-sh-file-name-handler)
+ (string-match
+ "ftp$" (file-remote-p tramp-test-temporary-file-directory 'method))))
+
+(defun tramp--test-gvfs-p ()
+ "Check, whether the remote host runs a GVFS based method.
+This requires restrictions of file name syntax."
+ (tramp-gvfs-file-name-p tramp-test-temporary-file-directory))
(defun tramp--test-smb-or-windows-nt-p ()
"Check, whether the locale or remote host runs MS Windows.
This requires restrictions of file name syntax."
(or (eq system-type 'windows-nt)
- (eq (tramp-find-foreign-file-name-handler
- tramp-test-temporary-file-directory)
- 'tramp-smb-file-name-handler)))
+ (tramp-smb-file-name-p tramp-test-temporary-file-directory)))
+
+(defun tramp--test-hpux-p ()
+ "Check, whether the remote host runs HP-UX.
+Several special characters do not work properly there."
+ ;; We must refill the cache. `file-truename' does it.
+ (with-parsed-tramp-file-name
+ (file-truename tramp-test-temporary-file-directory) nil
+ (string-match "^HP-UX" (tramp-get-connection-property v "uname" ""))))
(defun tramp--test-check-files (&rest files)
"Run a simple but comprehensive test over every file in FILES."
(ignore-errors (delete-directory tmp-name2 'recursive)))))
(defun tramp--test-special-characters ()
- "Perform the test in `tramp-test30-special-characters*'."
+ "Perform the test in `tramp-test31-special-characters*'."
;; Newlines, slashes and backslashes in file names are not
;; supported. So we don't test. And we don't test the tab
;; character on Windows or Cygwin, because the backslash is
;; interpreted as a path separator, preventing "\t" from being
;; expanded to <TAB>.
(tramp--test-check-files
- (if (tramp--test-smb-or-windows-nt-p)
+ (if (or (tramp--test-gvfs-p) (tramp--test-smb-or-windows-nt-p))
"foo bar baz"
(if (or (tramp--test-adb-p) (eq system-type 'cygwin))
" foo bar baz "
"-foo-bar-baz-"
"%foo%bar%baz%"
"&foo&bar&baz&"
- (unless (tramp--test-smb-or-windows-nt-p) "?foo?bar?baz?")
- (unless (tramp--test-smb-or-windows-nt-p) "*foo*bar*baz*")
- (if (tramp--test-smb-or-windows-nt-p) "'foo'bar'baz'" "'foo\"bar'baz\"")
+ (unless (or (tramp--test-ftp-p)
+ (tramp--test-gvfs-p)
+ (tramp--test-smb-or-windows-nt-p))
+ "?foo?bar?baz?")
+ (unless (or (tramp--test-ftp-p)
+ (tramp--test-gvfs-p)
+ (tramp--test-smb-or-windows-nt-p))
+ "*foo*bar*baz*")
+ (if (or (tramp--test-gvfs-p) (tramp--test-smb-or-windows-nt-p))
+ "'foo'bar'baz'"
+ "'foo\"bar'baz\"")
"#foo~bar#baz~"
- (if (tramp--test-smb-or-windows-nt-p) "!foo!bar!baz!" "!foo|bar!baz|")
- (if (tramp--test-smb-or-windows-nt-p) ";foo;bar;baz;" ":foo;bar:baz;")
- (unless (tramp--test-smb-or-windows-nt-p) "<foo>bar<baz>")
+ (if (or (tramp--test-gvfs-p) (tramp--test-smb-or-windows-nt-p))
+ "!foo!bar!baz!"
+ "!foo|bar!baz|")
+ (if (or (tramp--test-gvfs-p) (tramp--test-smb-or-windows-nt-p))
+ ";foo;bar;baz;"
+ ":foo;bar:baz;")
+ (unless (or (tramp--test-gvfs-p) (tramp--test-smb-or-windows-nt-p))
+ "<foo>bar<baz>")
"(foo)bar(baz)"
- "[foo]bar[baz]"
+ (unless (or (tramp--test-ftp-p) (tramp--test-gvfs-p)) "[foo]bar[baz]")
"{foo}bar{baz}"))
;; These tests are inspired by Bug#17238.
(ert-deftest tramp-test31-special-characters-with-stat ()
"Check special characters in file names.
Use the `stat' command."
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(skip-unless
(eq
(with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
(skip-unless (tramp-get-remote-stat v)))
- (unwind-protect
- (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
- (tramp-set-connection-property v "perl" nil)
- (tramp--test-special-characters))
-
- ;; Reset suppressed properties.
- (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
- (tramp-set-connection-property v "perl" 'undef))))
+ (let ((tramp-connection-properties
+ (append
+ `((,(regexp-quote (file-remote-p tramp-test-temporary-file-directory))
+ "perl" nil))
+ tramp-connection-properties)))
+ (tramp--test-special-characters)))
(ert-deftest tramp-test31-special-characters-with-perl ()
"Check special characters in file names.
Use the `perl' command."
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(skip-unless
(eq
(with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
(skip-unless (tramp-get-remote-perl v)))
- (unwind-protect
- (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
- (tramp-set-connection-property v "stat" nil)
- (tramp--test-special-characters))
-
- ;; Reset suppressed properties.
- (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
- (tramp-set-connection-property v "stat" 'undef))))
+ (let ((tramp-connection-properties
+ (append
+ `((,(regexp-quote (file-remote-p tramp-test-temporary-file-directory))
+ "stat" nil)
+ ;; See `tramp-sh-handle-file-truename'.
+ (,(regexp-quote (file-remote-p tramp-test-temporary-file-directory))
+ "readlink" nil))
+ tramp-connection-properties)))
+ (tramp--test-special-characters)))
(ert-deftest tramp-test31-special-characters-with-ls ()
"Check special characters in file names.
Use the `ls' command."
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(skip-unless
(eq
(tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory)
'tramp-sh-file-name-handler))
- (unwind-protect
- (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
- (tramp-set-connection-property v "stat" nil)
- (tramp-set-connection-property v "perl" nil)
- (tramp--test-special-characters))
-
- ;; Reset suppressed properties.
- (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
- (tramp-set-connection-property v "stat" 'undef)
- (tramp-set-connection-property v "perl" 'undef))))
+ (let ((tramp-connection-properties
+ (append
+ `((,(regexp-quote (file-remote-p tramp-test-temporary-file-directory))
+ "perl" nil)
+ (,(regexp-quote (file-remote-p tramp-test-temporary-file-directory))
+ "stat" nil)
+ ;; See `tramp-sh-handle-file-truename'.
+ (,(regexp-quote (file-remote-p tramp-test-temporary-file-directory))
+ "readlink" nil))
+ tramp-connection-properties)))
+ (tramp--test-special-characters)))
(defun tramp--test-utf8 ()
- "Perform the test in `tramp-test31-utf8*'."
- (let ((coding-system-for-read 'utf-8)
- (coding-system-for-write 'utf-8)
- (file-name-coding-system 'utf-8))
+ "Perform the test in `tramp-test32-utf8*'."
+ (let* ((utf8 (if (and (eq system-type 'darwin)
+ (memq 'utf-8-hfs (coding-system-list)))
+ 'utf-8-hfs 'utf-8))
+ (coding-system-for-read utf8)
+ (coding-system-for-write utf8)
+ (file-name-coding-system utf8))
(tramp--test-check-files
- "Γυρίστε το Γαλαξία με Ώτο Στοπ"
- "أصبح بوسعك الآن تنزيل نسخة كاملة من موسوعة ويكيبيديا العربية لتصفحها بلا اتصال بالإنترنت"
+ (unless (tramp--test-hpux-p) "Γυρίστε το Γαλαξία με Ώτο Στοπ")
+ (unless (tramp--test-hpux-p)
+ "أصبح بوسعك الآن تنزيل نسخة كاملة من موسوعة ويكيبيديا العربية لتصفحها بلا اتصال بالإنترنت")
"银河系漫游指南系列"
"Автостопом по гала́ктике")))
(ert-deftest tramp-test32-utf8-with-stat ()
"Check UTF8 encoding in file names and file contents.
Use the `stat' command."
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(skip-unless
(eq
(with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
(skip-unless (tramp-get-remote-stat v)))
- (unwind-protect
- (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
- (tramp-set-connection-property v "perl" nil)
- (tramp--test-utf8))
-
- ;; Reset suppressed properties.
- (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
- (tramp-set-connection-property v "perl" 'undef))))
+ (let ((tramp-connection-properties
+ (append
+ `((,(regexp-quote (file-remote-p tramp-test-temporary-file-directory))
+ "perl" nil))
+ tramp-connection-properties)))
+ (tramp--test-utf8)))
(ert-deftest tramp-test32-utf8-with-perl ()
"Check UTF8 encoding in file names and file contents.
Use the `perl' command."
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(skip-unless
(eq
(with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
(skip-unless (tramp-get-remote-perl v)))
- (unwind-protect
- (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
- (tramp-set-connection-property v "stat" nil)
- (tramp--test-utf8))
-
- ;; Reset suppressed properties.
- (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
- (tramp-set-connection-property v "stat" 'undef))))
+ (let ((tramp-connection-properties
+ (append
+ `((,(regexp-quote (file-remote-p tramp-test-temporary-file-directory))
+ "stat" nil)
+ ;; See `tramp-sh-handle-file-truename'.
+ (,(regexp-quote (file-remote-p tramp-test-temporary-file-directory))
+ "readlink" nil))
+ tramp-connection-properties)))
+ (tramp--test-utf8)))
(ert-deftest tramp-test32-utf8-with-ls ()
"Check UTF8 encoding in file names and file contents.
Use the `ls' command."
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(skip-unless
(eq
(tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory)
'tramp-sh-file-name-handler))
- (unwind-protect
- (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
- (tramp-set-connection-property v "stat" nil)
- (tramp-set-connection-property v "perl" nil)
- (tramp--test-utf8))
-
- ;; Reset suppressed properties.
- (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
- (tramp-set-connection-property v "stat" 'undef)
- (tramp-set-connection-property v "perl" 'undef))))
+ (let ((tramp-connection-properties
+ (append
+ `((,(regexp-quote (file-remote-p tramp-test-temporary-file-directory))
+ "perl" nil)
+ (,(regexp-quote (file-remote-p tramp-test-temporary-file-directory))
+ "stat" nil)
+ ;; See `tramp-sh-handle-file-truename'.
+ (,(regexp-quote (file-remote-p tramp-test-temporary-file-directory))
+ "readlink" nil))
+ tramp-connection-properties)))
+ (tramp--test-utf8)))
;; This test is inspired by Bug#16928.
(ert-deftest tramp-test33-asynchronous-requests ()
process sentinels. They shall not disturb each other."
;; Mark as failed until bug has been fixed.
:expected-result :failed
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(skip-unless
(eq
Since it unloads Tramp, it shall be the last test to run."
;; Mark as failed until all symbols are unbound.
:expected-result (if (featurep 'tramp) :failed :passed)
+ :tags '(:expensive-test)
(when (featurep 'tramp)
(unload-feature 'tramp 'force)
;; No Tramp feature must be left.
;; * Work on skipped tests. Make a comment, when it is impossible.
;; * Fix `tramp-test15-copy-directory' for `smb'. Using tar in a pipe
;; doesn't work well when an interactive password must be provided.
-;; * Fix `tramp-test27-start-file-process' for `nc' and on MS
-;; Windows (`process-send-eof'?).
-;; * Fix `tramp-test30-special-characters' for `nc'.
-;; * Fix `tramp-test31-utf8' for `nc'/`telnet' (when target is a dumb
-;; busybox). Seems to be in `directory-files'.
-;; * Fix Bug#16928. Set expected error of `tramp-test32-asynchronous-requests'.
-;; * Fix `tramp-test34-unload' (Not all symbols are unbound). Set
+;; * Fix `tramp-test27-start-file-process' on MS Windows (`process-send-eof'?).
+;; * Fix Bug#16928. Set expected error of `tramp-test33-asynchronous-requests'.
+;; * Fix `tramp-test35-unload' (Not all symbols are unbound). Set
;; expected error.
(defun tramp-test-all (&optional interactive)