diff options
| author | Michael Albinus | 2021-12-27 19:51:58 +0100 |
|---|---|---|
| committer | Michael Albinus | 2021-12-27 19:51:58 +0100 |
| commit | 01df347947c8785c7c21d5a2baa12de2ffde80dd (patch) | |
| tree | 8c77c69f78b208ad6bca2f2fd7892cd5a04e1b4d /test | |
| parent | 8df3a71c526c28b17926f7b56860f9798ab6d933 (diff) | |
| download | emacs-01df347947c8785c7c21d5a2baa12de2ffde80dd.tar.gz emacs-01df347947c8785c7c21d5a2baa12de2ffde80dd.zip | |
Use `permission-denied' in Tramp tests, and more
* lisp/net/tramp-crypt.el (tramp-crypt-maybe-open-connection):
Simplify code.
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-system-info):
Adapt for "mtp" method.
* test/lisp/net/tramp-tests.el (tramp-test18-file-attributes):
Use `permission-denied' error. Simplify code.
(tramp-test24-file-acl, tramp-test26-file-name-completion):
Simplify code.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index f14d63af4cd..7ba5a870766 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -3405,12 +3405,12 @@ This tests also `access-file', `file-readable-p', | |||
| 3405 | (when (tramp--test-supports-set-file-modes-p) | 3405 | (when (tramp--test-supports-set-file-modes-p) |
| 3406 | (write-region "foo" nil tmp-name1) | 3406 | (write-region "foo" nil tmp-name1) |
| 3407 | ;; A file is always accessible for user "root". | 3407 | ;; A file is always accessible for user "root". |
| 3408 | (when (not (zerop (file-attribute-user-id | 3408 | (unless |
| 3409 | (file-attributes tmp-name1)))) | 3409 | (zerop (file-attribute-user-id (file-attributes tmp-name1))) |
| 3410 | (set-file-modes tmp-name1 0) | 3410 | (set-file-modes tmp-name1 0) |
| 3411 | (should-error | 3411 | (should-error |
| 3412 | (access-file tmp-name1 "error") | 3412 | (access-file tmp-name1 "error") |
| 3413 | :type 'file-error) | 3413 | :type tramp-permission-denied) |
| 3414 | (set-file-modes tmp-name1 #o777)) | 3414 | (set-file-modes tmp-name1 #o777)) |
| 3415 | (delete-file tmp-name1)) | 3415 | (delete-file tmp-name1)) |
| 3416 | (should-error | 3416 | (should-error |
| @@ -4095,7 +4095,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4095 | (should (file-acl tmp-name2)) | 4095 | (should (file-acl tmp-name2)) |
| 4096 | (should (string-equal (file-acl tmp-name1) (file-acl tmp-name2))) | 4096 | (should (string-equal (file-acl tmp-name1) (file-acl tmp-name2))) |
| 4097 | ;; Different permissions mean different ACLs. | 4097 | ;; Different permissions mean different ACLs. |
| 4098 | (when (not (tramp--test-windows-nt-or-smb-p)) | 4098 | (unless (tramp--test-windows-nt-or-smb-p) |
| 4099 | (set-file-modes tmp-name1 #o777) | 4099 | (set-file-modes tmp-name1 #o777) |
| 4100 | (set-file-modes tmp-name2 #o444) | 4100 | (set-file-modes tmp-name2 #o444) |
| 4101 | (should-not | 4101 | (should-not |
| @@ -4297,7 +4297,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4297 | 4297 | ||
| 4298 | ;; Method and host name in completion mode. This kind of completion | 4298 | ;; Method and host name in completion mode. This kind of completion |
| 4299 | ;; does not work on MS Windows. | 4299 | ;; does not work on MS Windows. |
| 4300 | (when (not (memq system-type '(cygwin windows-nt))) | 4300 | (unless (memq system-type '(cygwin windows-nt)) |
| 4301 | (let ((method (file-remote-p tramp-test-temporary-file-directory 'method)) | 4301 | (let ((method (file-remote-p tramp-test-temporary-file-directory 'method)) |
| 4302 | (host (file-remote-p tramp-test-temporary-file-directory 'host)) | 4302 | (host (file-remote-p tramp-test-temporary-file-directory 'host)) |
| 4303 | (orig-syntax tramp-syntax)) | 4303 | (orig-syntax tramp-syntax)) |