aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus2015-07-21 14:59:18 +0200
committerMichael Albinus2015-07-21 14:59:18 +0200
commitb0dbf4c038d53ccce6ecf592c6d5b1ffcc084ad0 (patch)
tree91b0521e809dee52fbc509feb1a4b59dd5679a84 /test
parentb6ac30ab435596f1be6023ad22471bf570a11c4a (diff)
downloademacs-b0dbf4c038d53ccce6ecf592c6d5b1ffcc084ad0.tar.gz
emacs-b0dbf4c038d53ccce6ecf592c6d5b1ffcc084ad0.zip
Sync with Tramp repository
* doc/misc/tramp.texi (Configuration): Note, that Tramp must be required prior changing its configuration. (Connection caching, Predefined connection information) (Remote shell setup): Fix typos. (Predefined connection information): Describe, how to overwrite parameters of `tramp-methods'. (Remote programs, Remote processes, Traces and Profiles): Simplify example. (Remote programs): Remove superfluous comment. * doc/misc/trampver.texi: Update release number. * lisp/net/tramp-cache.el (tramp-connection-properties): Adapt docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): New defun. (tramp-gvfs-handle-copy-file, tramp-gvfs-handle-rename-file): Use it. (tramp-gvfs-handle-make-directory): Reimplement PARENTS handling, "gvfs-mkdir -p ..." does not work robust. (tramp-gvfs-maybe-open-connection): Adapt `tramp-get-method-parameter' call. * lisp/net/tramp-sh.el (tramp-methods): Add `tramp-remote-shell-login' parameter where it fits. (tramp-get-remote-path): Use it. (tramp-make-copy-program-file-name): Fix quoting for "psftp" method. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-get-method-parameter): Replace argument METHOD by VEC. Check also for hits in `tramp-connection-properties'. Adapt docstring. (tramp-get-remote-tmpdir): Cache only the local name of tmpdir. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/trampver.el Update release number. * test/automated/tramp-tests.el (tramp--instrument-test-case): Add "^make-symbolic-link not supported$" to `debug-ignored-errors'. (tramp-test13-make-directory, tramp--test-adb-p) (tramp--test-smb-or-windows-nt-p): Simplify. (tramp--test-ftp-p, tramp--test-gvfs-p): New defuns. (tramp--test-special-characters): Fix docstring. Add gvfs and ftp tests. (tramp--test-utf8): Fix docstring.
Diffstat (limited to 'test')
-rw-r--r--test/automated/tramp-tests.el90
1 files changed, 57 insertions, 33 deletions
diff --git a/test/automated/tramp-tests.el b/test/automated/tramp-tests.el
index e1039392ea7..24cfa247c93 100644
--- a/test/automated/tramp-tests.el
+++ b/test/automated/tramp-tests.el
@@ -117,7 +117,9 @@ shall not contain a timeout."
117 (declare (indent 1) (debug (natnump body))) 117 (declare (indent 1) (debug (natnump body)))
118 `(let ((tramp-verbose ,verbose) 118 `(let ((tramp-verbose ,verbose)
119 (tramp-message-show-message t) 119 (tramp-message-show-message t)
120 (tramp-debug-on-error t)) 120 (tramp-debug-on-error t)
121 (debug-ignored-errors
122 (cons "^make-symbolic-link not supported$" debug-ignored-errors)))
121 (unwind-protect 123 (unwind-protect
122 (progn ,@body) 124 (progn ,@body)
123 (when (> tramp-verbose 3) 125 (when (> tramp-verbose 3)
@@ -859,22 +861,20 @@ This checks also `file-name-as-directory', `file-name-directory',
859This tests also `file-directory-p' and `file-accessible-directory-p'." 861This tests also `file-directory-p' and `file-accessible-directory-p'."
860 (skip-unless (tramp--test-enabled)) 862 (skip-unless (tramp--test-enabled))
861 863
862 (let ((tmp-name (tramp--test-make-temp-name))) 864 (let* ((tmp-name1 (tramp--test-make-temp-name))
865 (tmp-name2 (expand-file-name "foo/bar" tmp-name1)))
863 (unwind-protect 866 (unwind-protect
864 (progn 867 (progn
865 (make-directory tmp-name) 868 (make-directory tmp-name1)
866 (should (file-directory-p tmp-name)) 869 (should (file-directory-p tmp-name1))
867 (should (file-accessible-directory-p tmp-name)) 870 (should (file-accessible-directory-p tmp-name1))
868 (should-error 871 (should-error (make-directory tmp-name2) :type 'file-error)
869 (make-directory (expand-file-name "foo/bar" tmp-name)) 872 (make-directory tmp-name2 'parents)
870 :type 'file-error) 873 (should (file-directory-p tmp-name2))
871 (make-directory (expand-file-name "foo/bar" tmp-name) 'parents) 874 (should (file-accessible-directory-p tmp-name2)))
872 (should (file-directory-p (expand-file-name "foo/bar" tmp-name)))
873 (should
874 (file-accessible-directory-p (expand-file-name "foo/bar" tmp-name))))
875 875
876 ;; Cleanup. 876 ;; Cleanup.
877 (ignore-errors (delete-directory tmp-name 'recursive))))) 877 (ignore-errors (delete-directory tmp-name1 'recursive)))))
878 878
879(ert-deftest tramp-test14-delete-directory () 879(ert-deftest tramp-test14-delete-directory ()
880 "Check `delete-directory'." 880 "Check `delete-directory'."
@@ -1667,17 +1667,28 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
1667(defun tramp--test-adb-p () 1667(defun tramp--test-adb-p ()
1668 "Check, whether the remote host runs Android. 1668 "Check, whether the remote host runs Android.
1669This requires restrictions of file name syntax." 1669This requires restrictions of file name syntax."
1670 (eq (tramp-find-foreign-file-name-handler 1670 (tramp-adb-file-name-p tramp-test-temporary-file-directory))
1671 tramp-test-temporary-file-directory) 1671
1672 'tramp-adb-file-name-handler)) 1672(defun tramp--test-ftp-p ()
1673 "Check, whether an FTP-like method is used.
1674This does not support globbing characters in file names (yet)."
1675 ;; Globbing characters are ??, ?* and ?\[.
1676 (and (eq (tramp-find-foreign-file-name-handler
1677 tramp-test-temporary-file-directory)
1678 'tramp-sh-file-name-handler)
1679 (string-match
1680 "ftp$" (file-remote-p tramp-test-temporary-file-directory 'method))))
1681
1682(defun tramp--test-gvfs-p ()
1683 "Check, whether the remote host runs a GVFS based method.
1684This requires restrictions of file name syntax."
1685 (tramp-gvfs-file-name-p tramp-test-temporary-file-directory))
1673 1686
1674(defun tramp--test-smb-or-windows-nt-p () 1687(defun tramp--test-smb-or-windows-nt-p ()
1675 "Check, whether the locale or remote host runs MS Windows. 1688 "Check, whether the locale or remote host runs MS Windows.
1676This requires restrictions of file name syntax." 1689This requires restrictions of file name syntax."
1677 (or (eq system-type 'windows-nt) 1690 (or (eq system-type 'windows-nt)
1678 (eq (tramp-find-foreign-file-name-handler 1691 (tramp-smb-file-name-p tramp-test-temporary-file-directory)))
1679 tramp-test-temporary-file-directory)
1680 'tramp-smb-file-name-handler)))
1681 1692
1682(defun tramp--test-check-files (&rest files) 1693(defun tramp--test-check-files (&rest files)
1683 "Run a simple but comprehensive test over every file in FILES." 1694 "Run a simple but comprehensive test over every file in FILES."
@@ -1815,14 +1826,14 @@ This requires restrictions of file name syntax."
1815 (ignore-errors (delete-directory tmp-name2 'recursive))))) 1826 (ignore-errors (delete-directory tmp-name2 'recursive)))))
1816 1827
1817(defun tramp--test-special-characters () 1828(defun tramp--test-special-characters ()
1818 "Perform the test in `tramp-test30-special-characters*'." 1829 "Perform the test in `tramp-test31-special-characters*'."
1819 ;; Newlines, slashes and backslashes in file names are not 1830 ;; Newlines, slashes and backslashes in file names are not
1820 ;; supported. So we don't test. And we don't test the tab 1831 ;; supported. So we don't test. And we don't test the tab
1821 ;; character on Windows or Cygwin, because the backslash is 1832 ;; character on Windows or Cygwin, because the backslash is
1822 ;; interpreted as a path separator, preventing "\t" from being 1833 ;; interpreted as a path separator, preventing "\t" from being
1823 ;; expanded to <TAB>. 1834 ;; expanded to <TAB>.
1824 (tramp--test-check-files 1835 (tramp--test-check-files
1825 (if (tramp--test-smb-or-windows-nt-p) 1836 (if (or (tramp--test-gvfs-p) (tramp--test-smb-or-windows-nt-p))
1826 "foo bar baz" 1837 "foo bar baz"
1827 (if (or (tramp--test-adb-p) (eq system-type 'cygwin)) 1838 (if (or (tramp--test-adb-p) (eq system-type 'cygwin))
1828 " foo bar baz " 1839 " foo bar baz "
@@ -1831,15 +1842,28 @@ This requires restrictions of file name syntax."
1831 "-foo-bar-baz-" 1842 "-foo-bar-baz-"
1832 "%foo%bar%baz%" 1843 "%foo%bar%baz%"
1833 "&foo&bar&baz&" 1844 "&foo&bar&baz&"
1834 (unless (tramp--test-smb-or-windows-nt-p) "?foo?bar?baz?") 1845 (unless (or (tramp--test-ftp-p)
1835 (unless (tramp--test-smb-or-windows-nt-p) "*foo*bar*baz*") 1846 (tramp--test-gvfs-p)
1836 (if (tramp--test-smb-or-windows-nt-p) "'foo'bar'baz'" "'foo\"bar'baz\"") 1847 (tramp--test-smb-or-windows-nt-p))
1848 "?foo?bar?baz?")
1849 (unless (or (tramp--test-ftp-p)
1850 (tramp--test-gvfs-p)
1851 (tramp--test-smb-or-windows-nt-p))
1852 "*foo*bar*baz*")
1853 (if (or (tramp--test-gvfs-p) (tramp--test-smb-or-windows-nt-p))
1854 "'foo'bar'baz'"
1855 "'foo\"bar'baz\"")
1837 "#foo~bar#baz~" 1856 "#foo~bar#baz~"
1838 (if (tramp--test-smb-or-windows-nt-p) "!foo!bar!baz!" "!foo|bar!baz|") 1857 (if (or (tramp--test-gvfs-p) (tramp--test-smb-or-windows-nt-p))
1839 (if (tramp--test-smb-or-windows-nt-p) ";foo;bar;baz;" ":foo;bar:baz;") 1858 "!foo!bar!baz!"
1840 (unless (tramp--test-smb-or-windows-nt-p) "<foo>bar<baz>") 1859 "!foo|bar!baz|")
1860 (if (or (tramp--test-gvfs-p) (tramp--test-smb-or-windows-nt-p))
1861 ";foo;bar;baz;"
1862 ":foo;bar:baz;")
1863 (unless (or (tramp--test-gvfs-p) (tramp--test-smb-or-windows-nt-p))
1864 "<foo>bar<baz>")
1841 "(foo)bar(baz)" 1865 "(foo)bar(baz)"
1842 "[foo]bar[baz]" 1866 (unless (or (tramp--test-ftp-p) (tramp--test-gvfs-p)) "[foo]bar[baz]")
1843 "{foo}bar{baz}")) 1867 "{foo}bar{baz}"))
1844 1868
1845;; These tests are inspired by Bug#17238. 1869;; These tests are inspired by Bug#17238.
@@ -1910,7 +1934,7 @@ Use the `ls' command."
1910 (tramp-set-connection-property v "perl" 'undef)))) 1934 (tramp-set-connection-property v "perl" 'undef))))
1911 1935
1912(defun tramp--test-utf8 () 1936(defun tramp--test-utf8 ()
1913 "Perform the test in `tramp-test31-utf8*'." 1937 "Perform the test in `tramp-test32-utf8*'."
1914 (let ((coding-system-for-read 'utf-8) 1938 (let ((coding-system-for-read 'utf-8)
1915 (coding-system-for-write 'utf-8) 1939 (coding-system-for-write 'utf-8)
1916 (file-name-coding-system 'utf-8)) 1940 (file-name-coding-system 'utf-8))
@@ -2147,11 +2171,11 @@ Since it unloads Tramp, it shall be the last test to run."
2147;; doesn't work well when an interactive password must be provided. 2171;; doesn't work well when an interactive password must be provided.
2148;; * Fix `tramp-test27-start-file-process' for `nc' and on MS 2172;; * Fix `tramp-test27-start-file-process' for `nc' and on MS
2149;; Windows (`process-send-eof'?). 2173;; Windows (`process-send-eof'?).
2150;; * Fix `tramp-test30-special-characters' for `nc'. 2174;; * Fix `tramp-test31-special-characters' for `nc'.
2151;; * Fix `tramp-test31-utf8' for `nc'/`telnet' (when target is a dumb 2175;; * Fix `tramp-test32-utf8' for `nc'/`telnet' (when target is a dumb
2152;; busybox). Seems to be in `directory-files'. 2176;; busybox). Seems to be in `directory-files'.
2153;; * Fix Bug#16928. Set expected error of `tramp-test32-asynchronous-requests'. 2177;; * Fix Bug#16928. Set expected error of `tramp-test33-asynchronous-requests'.
2154;; * Fix `tramp-test34-unload' (Not all symbols are unbound). Set 2178;; * Fix `tramp-test35-unload' (Not all symbols are unbound). Set
2155;; expected error. 2179;; expected error.
2156 2180
2157(defun tramp-test-all (&optional interactive) 2181(defun tramp-test-all (&optional interactive)