aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus2020-06-07 16:57:32 +0200
committerMichael Albinus2020-06-07 16:57:32 +0200
commita6b0e7202d5ea747d99731e1228badcead80eee6 (patch)
treecd32f4e76d5f41a7b542482221ca0031eff6fb20 /test
parent54e840a8b44712eff63929c01a916531051c3e0b (diff)
downloademacs-a6b0e7202d5ea747d99731e1228badcead80eee6.tar.gz
emacs-a6b0e7202d5ea747d99731e1228badcead80eee6.zip
Add file encryption to Tramp
* lisp/net/tramp-crypt.el: New file. * lisp/net/tramp.el (tramp-run-real-handler): Add `tramp-crypt-file-name-handler'. (tramp-register-file-name-handlers): Call `tramp-register-crypt-file-name-handler'. (tramp-handle-insert-file-contents, tramp-local-host-p): Check for `tramp-crypt-enabled' * test/lisp/net/tramp-tests.el (tramp--test-crypt-p): New defun. (tramp-test24-file-acl, tramp-test25-file-selinux) (tramp-test28-process-file, tramp-test29-start-file-process) (tramp-test30-make-process, tramp-test31-interrupt-process) (tramp-test32-shell-command) (tramp-test32-shell-command-dont-erase-buffer) (tramp-test33-environment-variables) (tramp-test33-environment-variables-and-port-numbers) (tramp-test34-explicit-shell-file-name, tramp-test35-exec-path) (tramp-test35-remote-path, tramp-test36-vc-registered) (tramp--test-check-files, tramp-test43-asynchronous-requests): Use it.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/tramp-tests.el20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 1f56baad7ce..7faa409f2f0 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -3815,6 +3815,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
3815 "Check that `file-acl' and `set-file-acl' work proper." 3815 "Check that `file-acl' and `set-file-acl' work proper."
3816 (skip-unless (tramp--test-enabled)) 3816 (skip-unless (tramp--test-enabled))
3817 (skip-unless (file-acl tramp-test-temporary-file-directory)) 3817 (skip-unless (file-acl tramp-test-temporary-file-directory))
3818 (skip-unless (null (tramp--test-crypt-p)))
3818 3819
3819 ;; `filename-non-special' has been fixed in Emacs 27.1, see Bug#29579. 3820 ;; `filename-non-special' has been fixed in Emacs 27.1, see Bug#29579.
3820 (dolist (quoted (if (and (tramp--test-expensive-test) (tramp--test-emacs27-p)) 3821 (dolist (quoted (if (and (tramp--test-expensive-test) (tramp--test-emacs27-p))
@@ -3893,6 +3894,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
3893 (skip-unless 3894 (skip-unless
3894 (not (equal (file-selinux-context tramp-test-temporary-file-directory) 3895 (not (equal (file-selinux-context tramp-test-temporary-file-directory)
3895 '(nil nil nil nil)))) 3896 '(nil nil nil nil))))
3897 (skip-unless (null (tramp--test-crypt-p)))
3896 3898
3897 ;; `filename-non-special' has been fixed in Emacs 27.1, see Bug#29579. 3899 ;; `filename-non-special' has been fixed in Emacs 27.1, see Bug#29579.
3898 (dolist (quoted (if (and (tramp--test-expensive-test) (tramp--test-emacs27-p)) 3900 (dolist (quoted (if (and (tramp--test-expensive-test) (tramp--test-emacs27-p))
@@ -4196,6 +4198,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4196 :tags '(:expensive-test) 4198 :tags '(:expensive-test)
4197 (skip-unless (tramp--test-enabled)) 4199 (skip-unless (tramp--test-enabled))
4198 (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p))) 4200 (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p)))
4201 (skip-unless (null (tramp--test-crypt-p)))
4199 4202
4200 (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil))) 4203 (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil)))
4201 (let* ((tmp-name (tramp--test-make-temp-name nil quoted)) 4204 (let* ((tmp-name (tramp--test-make-temp-name nil quoted))
@@ -4274,6 +4277,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4274 :tags '(:expensive-test) 4277 :tags '(:expensive-test)
4275 (skip-unless (tramp--test-enabled)) 4278 (skip-unless (tramp--test-enabled))
4276 (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p))) 4279 (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p)))
4280 (skip-unless (null (tramp--test-crypt-p)))
4277 4281
4278 (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil))) 4282 (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil)))
4279 (let ((default-directory tramp-test-temporary-file-directory) 4283 (let ((default-directory tramp-test-temporary-file-directory)
@@ -4347,6 +4351,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4347 :tags '(:expensive-test) 4351 :tags '(:expensive-test)
4348 (skip-unless (tramp--test-enabled)) 4352 (skip-unless (tramp--test-enabled))
4349 (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p))) 4353 (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p)))
4354 (skip-unless (null (tramp--test-crypt-p)))
4350 ;; `make-process' supports file name handlers since Emacs 27. 4355 ;; `make-process' supports file name handlers since Emacs 27.
4351 (skip-unless (tramp--test-emacs27-p)) 4356 (skip-unless (tramp--test-emacs27-p))
4352 4357
@@ -4517,6 +4522,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4517 :tags '(:expensive-test) 4522 :tags '(:expensive-test)
4518 (skip-unless (tramp--test-enabled)) 4523 (skip-unless (tramp--test-enabled))
4519 (skip-unless (tramp--test-sh-p)) 4524 (skip-unless (tramp--test-sh-p))
4525 (skip-unless (null (tramp--test-crypt-p)))
4520 ;; Since Emacs 26.1. 4526 ;; Since Emacs 26.1.
4521 (skip-unless (boundp 'interrupt-process-functions)) 4527 (skip-unless (boundp 'interrupt-process-functions))
4522 4528
@@ -4577,6 +4583,7 @@ INPUT, if non-nil, is a string sent to the process."
4577 ;; remote processes in Emacs. That doesn't work for tramp-adb.el. 4583 ;; remote processes in Emacs. That doesn't work for tramp-adb.el.
4578 (skip-unless (or (and (tramp--test-adb-p) (tramp--test-emacs27-p)) 4584 (skip-unless (or (and (tramp--test-adb-p) (tramp--test-emacs27-p))
4579 (tramp--test-sh-p))) 4585 (tramp--test-sh-p)))
4586 (skip-unless (null (tramp--test-crypt-p)))
4580 4587
4581 (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil))) 4588 (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil)))
4582 (let ((tmp-name (tramp--test-make-temp-name nil quoted)) 4589 (let ((tmp-name (tramp--test-make-temp-name nil quoted))
@@ -4668,6 +4675,7 @@ INPUT, if non-nil, is a string sent to the process."
4668 :tags '(:expensive-test) 4675 :tags '(:expensive-test)
4669 (skip-unless (tramp--test-enabled)) 4676 (skip-unless (tramp--test-enabled))
4670 (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p))) 4677 (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p)))
4678 (skip-unless (null (tramp--test-crypt-p)))
4671 ;; Prior Emacs 27, `shell-command-dont-erase-buffer' wasn't working properly. 4679 ;; Prior Emacs 27, `shell-command-dont-erase-buffer' wasn't working properly.
4672 (skip-unless (tramp--test-emacs27-p)) 4680 (skip-unless (tramp--test-emacs27-p))
4673 4681
@@ -4880,6 +4888,7 @@ INPUT, if non-nil, is a string sent to the process."
4880 :tags '(:expensive-test) 4888 :tags '(:expensive-test)
4881 (skip-unless (tramp--test-enabled)) 4889 (skip-unless (tramp--test-enabled))
4882 (skip-unless (tramp--test-sh-p)) 4890 (skip-unless (tramp--test-sh-p))
4891 (skip-unless (null (tramp--test-crypt-p)))
4883 4892
4884 (dolist (this-shell-command-to-string 4893 (dolist (this-shell-command-to-string
4885 '(;; Synchronously. 4894 '(;; Synchronously.
@@ -4966,6 +4975,7 @@ INPUT, if non-nil, is a string sent to the process."
4966 ;; We test it only for the mock-up connection; otherwise there might 4975 ;; We test it only for the mock-up connection; otherwise there might
4967 ;; be problems with the used ports. 4976 ;; be problems with the used ports.
4968 (skip-unless (and (eq tramp-syntax 'default) (tramp--test-mock-p))) 4977 (skip-unless (and (eq tramp-syntax 'default) (tramp--test-mock-p)))
4978 (skip-unless (null (tramp--test-crypt-p)))
4969 4979
4970 ;; We force a reconnect, in order to have a clean environment. 4980 ;; We force a reconnect, in order to have a clean environment.
4971 (dolist (dir `(,tramp-test-temporary-file-directory 4981 (dolist (dir `(,tramp-test-temporary-file-directory
@@ -5070,6 +5080,7 @@ INPUT, if non-nil, is a string sent to the process."
5070 ;; remote processes in Emacs. That doesn't work for tramp-adb.el. 5080 ;; remote processes in Emacs. That doesn't work for tramp-adb.el.
5071 (skip-unless (or (and (tramp--test-adb-p) (tramp--test-emacs27-p)) 5081 (skip-unless (or (and (tramp--test-adb-p) (tramp--test-emacs27-p))
5072 (tramp--test-sh-p))) 5082 (tramp--test-sh-p)))
5083 (skip-unless (null (tramp--test-crypt-p)))
5073 ;; Since Emacs 26.1. 5084 ;; Since Emacs 26.1.
5074 (skip-unless (and (fboundp 'connection-local-set-profile-variables) 5085 (skip-unless (and (fboundp 'connection-local-set-profile-variables)
5075 (fboundp 'connection-local-set-profiles))) 5086 (fboundp 'connection-local-set-profiles)))
@@ -5126,6 +5137,7 @@ INPUT, if non-nil, is a string sent to the process."
5126 "Check `exec-path' and `executable-find'." 5137 "Check `exec-path' and `executable-find'."
5127 (skip-unless (tramp--test-enabled)) 5138 (skip-unless (tramp--test-enabled))
5128 (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p))) 5139 (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p)))
5140 (skip-unless (null (tramp--test-crypt-p)))
5129 ;; Since Emacs 27.1. 5141 ;; Since Emacs 27.1.
5130 (skip-unless (fboundp 'exec-path)) 5142 (skip-unless (fboundp 'exec-path))
5131 5143
@@ -5169,6 +5181,7 @@ INPUT, if non-nil, is a string sent to the process."
5169 "Check loooong `tramp-remote-path'." 5181 "Check loooong `tramp-remote-path'."
5170 (skip-unless (tramp--test-enabled)) 5182 (skip-unless (tramp--test-enabled))
5171 (skip-unless (tramp--test-sh-p)) 5183 (skip-unless (tramp--test-sh-p))
5184 (skip-unless (null (tramp--test-crypt-p)))
5172 ;; Since Emacs 27.1. 5185 ;; Since Emacs 27.1.
5173 (skip-unless (fboundp 'exec-path)) 5186 (skip-unless (fboundp 'exec-path))
5174 5187
@@ -5233,6 +5246,7 @@ INPUT, if non-nil, is a string sent to the process."
5233 :tags '(:expensive-test) 5246 :tags '(:expensive-test)
5234 (skip-unless (tramp--test-enabled)) 5247 (skip-unless (tramp--test-enabled))
5235 (skip-unless (tramp--test-sh-p)) 5248 (skip-unless (tramp--test-sh-p))
5249 (skip-unless (null (tramp--test-crypt-p)))
5236 5250
5237 (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil))) 5251 (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil)))
5238 ;; We must use `file-truename' for the temporary directory, in 5252 ;; We must use `file-truename' for the temporary directory, in
@@ -5581,6 +5595,10 @@ This does not support some special file names."
5581 (string-equal 5595 (string-equal
5582 "docker" (file-remote-p tramp-test-temporary-file-directory 'method))) 5596 "docker" (file-remote-p tramp-test-temporary-file-directory 'method)))
5583 5597
5598(defun tramp--test-crypt-p ()
5599 "Check, whether the remote directory is crypted"
5600 (tramp-crypt-file-name-p tramp-test-temporary-file-directory))
5601
5584(defun tramp--test-ftp-p () 5602(defun tramp--test-ftp-p ()
5585 "Check, whether an FTP-like method is used. 5603 "Check, whether an FTP-like method is used.
5586This does not support globbing characters in file names (yet)." 5604This does not support globbing characters in file names (yet)."
@@ -5817,6 +5835,7 @@ This requires restrictions of file name syntax."
5817 ;; We do not run on macOS due to encoding problems. See 5835 ;; We do not run on macOS due to encoding problems. See
5818 ;; Bug#36940. 5836 ;; Bug#36940.
5819 (when (and (tramp--test-expensive-test) (tramp--test-sh-p) 5837 (when (and (tramp--test-expensive-test) (tramp--test-sh-p)
5838 (null (tramp--test-crypt-p))
5820 (not (eq system-type 'darwin))) 5839 (not (eq system-type 'darwin)))
5821 (dolist (elt files) 5840 (dolist (elt files)
5822 (let ((envvar (concat "VAR_" (upcase (md5 elt)))) 5841 (let ((envvar (concat "VAR_" (upcase (md5 elt))))
@@ -6149,6 +6168,7 @@ process sentinels. They shall not disturb each other."
6149 ;; remote processes in Emacs. That doesn't work for tramp-adb.el. 6168 ;; remote processes in Emacs. That doesn't work for tramp-adb.el.
6150 (skip-unless (or (and (tramp--test-adb-p) (tramp--test-emacs27-p)) 6169 (skip-unless (or (and (tramp--test-adb-p) (tramp--test-emacs27-p))
6151 (tramp--test-sh-p))) 6170 (tramp--test-sh-p)))
6171 (skip-unless (null (tramp--test-crypt-p)))
6152 6172
6153 (with-timeout 6173 (with-timeout
6154 (tramp--test-asynchronous-requests-timeout (tramp--test-timeout-handler)) 6174 (tramp--test-asynchronous-requests-timeout (tramp--test-timeout-handler))