aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus2018-12-16 15:49:07 +0100
committerMichael Albinus2018-12-16 15:49:07 +0100
commite8199e765f81968be840d8e7e3978f5974c1be9d (patch)
tree354c9b7af9c126a49e614b716225c49135d702b4 /test
parent4f230e8dd551d711433e2a8095a19c2ce00c9b4c (diff)
downloademacs-e8199e765f81968be840d8e7e3978f5974c1be9d.tar.gz
emacs-e8199e765f81968be840d8e7e3978f5974c1be9d.zip
Add Tramp sudoedit method
* doc/misc/tramp.texi (Quick Start Guide): New section "Using sudoedit". (External methods) <sudoedit>: Describe. * lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): * lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler-alist): * lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist) * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist): Add handler. * lisp/net/tramp-sh.el (tramp-sh-handle-set-file-uid-gid): Rename from `tramp-sh-handle-set-file-uid-gid'. Handle only remote file names. * lisp/net/tramp-sudoedit.el: New file. * lisp/net/tramp.el (tramp-file-name-for-operation): Handle also `tramp-set-file-uid-gid'. (tramp-set-file-uid-gid): New defun. (tramp-get-local-uid, tramp-get-local-gid): Cache result. * test/lisp/net/tramp-tests.el (tramp--test-sudoedit-p): New defun. (tramp-test20-file-modes, tramp-test22-file-times) (tramp--test-sudoedit-p): Use it.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/tramp-tests.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index d68804a1c4e..056b6ce8360 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -3009,7 +3009,7 @@ This tests also `file-readable-p', `file-regular-p' and
3009 "Check `file-modes'. 3009 "Check `file-modes'.
3010This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." 3010This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
3011 (skip-unless (tramp--test-enabled)) 3011 (skip-unless (tramp--test-enabled))
3012 (skip-unless (tramp--test-sh-p)) 3012 (skip-unless (or (tramp--test-sh-p) (tramp--test-sudoedit-p)))
3013 3013
3014 (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil))) 3014 (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil)))
3015 (let ((tmp-name (tramp--test-make-temp-name nil quoted))) 3015 (let ((tmp-name (tramp--test-make-temp-name nil quoted)))
@@ -3309,7 +3309,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
3309(ert-deftest tramp-test22-file-times () 3309(ert-deftest tramp-test22-file-times ()
3310 "Check `set-file-times' and `file-newer-than-file-p'." 3310 "Check `set-file-times' and `file-newer-than-file-p'."
3311 (skip-unless (tramp--test-enabled)) 3311 (skip-unless (tramp--test-enabled))
3312 (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p))) 3312 (skip-unless
3313 (or (tramp--test-adb-p) (tramp--test-sh-p) (tramp--test-sudoedit-p)))
3313 3314
3314 (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil))) 3315 (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil)))
3315 (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) 3316 (let ((tmp-name1 (tramp--test-make-temp-name nil quoted))
@@ -4567,6 +4568,10 @@ This does not support special file names."
4567 (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory) 4568 (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory)
4568 'tramp-sh-file-name-handler)) 4569 'tramp-sh-file-name-handler))
4569 4570
4571(defun tramp--test-sudoedit-p ()
4572 "Check, whether the sudoedit method is used."
4573 (tramp-sudoedit-file-name-p tramp-test-temporary-file-directory))
4574
4570(defun tramp--test-windows-nt () 4575(defun tramp--test-windows-nt ()
4571 "Check, whether the locale host runs MS Windows." 4576 "Check, whether the locale host runs MS Windows."
4572 (eq system-type 'windows-nt)) 4577 (eq system-type 'windows-nt))
@@ -4761,6 +4766,7 @@ This requires restrictions of file name syntax."
4761 (list 4766 (list
4762 (if (or (tramp--test-gvfs-p) 4767 (if (or (tramp--test-gvfs-p)
4763 (tramp--test-rclone-p) 4768 (tramp--test-rclone-p)
4769 (tramp--test-sudoedit-p)
4764 (tramp--test-windows-nt-or-smb-p)) 4770 (tramp--test-windows-nt-or-smb-p))
4765 "foo bar baz" 4771 "foo bar baz"
4766 (if (or (tramp--test-adb-p) 4772 (if (or (tramp--test-adb-p)