:type 'file-already-exists)
(should (file-directory-p tmp-name1))
(should (file-accessible-directory-p tmp-name1))
- (when (tramp--test-supports-file-modes-p)
+ (when (tramp--test-supports-set-file-modes-p)
(should (equal (format "%#o" unusual-file-mode-1)
(format "%#o" (file-modes tmp-name1)))))
(should-error
(make-directory tmp-name2 'parents))
(should (file-directory-p tmp-name2))
(should (file-accessible-directory-p tmp-name2))
- (when (tramp--test-supports-file-modes-p)
+ (when (tramp--test-supports-set-file-modes-p)
(should (equal (format "%#o" unusual-file-mode-2)
(format "%#o" (file-modes tmp-name2)))))
;; If PARENTS is non-nil, `make-directory' shall not
(length (directory-files tmp-name1)))))))
;; Check error cases.
- (when (and (tramp--test-supports-file-modes-p)
+ (when (and (tramp--test-supports-set-file-modes-p)
;; With "sshfs", directories with zero file
;; modes are still "accessible".
(not (tramp--test-sshfs-p))
(tramp-get-remote-gid tramp-test-vec 'integer)))
(delete-file tmp-name1))
- (when (and (tramp--test-supports-file-modes-p)
+ (when (and (tramp--test-supports-set-file-modes-p)
;; A file is always accessible for user "root".
(not (zerop (tramp-compat-file-attribute-user-id
(file-attributes
"Check `file-modes'.
This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
(skip-unless (tramp--test-enabled))
- (skip-unless (tramp--test-supports-file-modes-p))
+ (skip-unless (tramp--test-supports-set-file-modes-p))
+
(dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil)))
(let ((tmp-name1 (tramp--test-make-temp-name nil quoted))
(tmp-name2 (tramp--test-make-temp-name nil quoted)))
(make-symbolic-link tmp-name2 tmp-name1)
(should (file-symlink-p tmp-name1))
(if (tramp--test-smb-p)
- ;; The symlink command of `smbclient' detects the
+ ;; The symlink command of "smbclient" detects the
;; cycle already.
(should-error
(make-symbolic-link tmp-name1 tmp-name2)
(ert-deftest tramp-test24-file-acl ()
"Check that `file-acl' and `set-file-acl' work proper."
(skip-unless (tramp--test-enabled))
+ ;; The following test checks also whether `set-file-modes' will work.
(skip-unless (file-acl tramp-test-temporary-file-directory))
(skip-unless (not (tramp--test-crypt-p)))
(write-region "foo" nil tmp-name)
(should (file-exists-p tmp-name))
(should (zerop (process-file "ls" nil t nil fnnd)))
- ;; `ls' could produce colorized output.
+ ;; "ls" could produce colorized output.
(goto-char (point-min))
(while
(re-search-forward tramp-display-escape-sequence-regexp nil 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.
+ ;; "ls" could produce colorized output.
(goto-char (point-min))
(while
(re-search-forward tramp-display-escape-sequence-regexp nil t)
;; Cleanup.
(ignore-errors (delete-file tmp-name))))))
-;; Must be a command, because used as `sigusr' handler.
+;; Must be a command, because used as `sigusr1' handler.
(defun tramp--test-timeout-handler (&rest _ignore)
"Timeout handler, reporting a failed test."
(interactive)
;; Cleanup.
(ignore-errors (delete-process proc)))
- ;; `telnet' does not cooperate with disabled filter.
- (unless (tramp--test-telnet-p)
+ ;; "telnet" and "sshfs" do not cooperate with disabled filter.
+ (unless (or (tramp--test-telnet-p) (tramp--test-sshfs-p))
(unwind-protect
(with-temp-buffer
(setq proc (start-file-process "test3" (current-buffer) "cat"))
(if (and (memq process-connection-type '(nil pipe))
(not (tramp--test-macos-p)))
;; On macOS, there is always newline conversion.
- ;; `telnet' converts \r to <CR><NUL> if `crlf'
+ ;; "telnet" converts \r to <CR><NUL> if `crlf'
;; flag is FALSE. See telnet(1) man page.
"66\n6F\n6F\n0D\\(\n00\\)?\n0A\n"
"66\n6F\n6F\n0A\\(\n00\\)?\n0A\n")
;; Cleanup.
(ignore-errors (delete-process proc)))
- ;; `telnet' does not cooperate with disabled filter.
- (unless (tramp--test-telnet-p)
+ ;; "telnet" and "sshfs" do not cooperate with disabled filter.
+ (unless (or (tramp--test-telnet-p) (tramp--test-sshfs-p))
(unwind-protect
(with-temp-buffer
(setq proc
;; Cleanup.
(ignore-errors (delete-process proc)))
- ;; Process with stderr buffer. `telnet' does not cooperate with
+ ;; Process with stderr buffer. "telnet" does not cooperate with
;; three processes.
(unless (or (tramp--test-telnet-p) (tramp-direct-async-process-p))
(let ((stderr (generate-new-buffer "*stderr*")))
'(nil pipe))
(not (tramp--test-macos-p)))
;; On macOS, there is always newline conversion.
- ;; `telnet' converts \r to <CR><NUL> if `crlf'
+ ;; "telnet" converts \r to <CR><NUL> if `crlf'
;; flag is FALSE. See telnet(1) man page.
"66\n6F\n6F\n0D\\(\n00\\)?\n0A\n"
"66\n6F\n6F\n0A\\(\n00\\)?\n0A\n")
this-shell-command
(format "ls %s" (file-name-nondirectory tmp-name))
(current-buffer))
- ;; `ls' could produce colorized output.
+ ;; "ls" could produce colorized output.
(goto-char (point-min))
(while
(re-search-forward tramp-display-escape-sequence-regexp nil t)
(ert-deftest tramp-test35-exec-path ()
"Check `exec-path' and `executable-find'."
(skip-unless (tramp--test-enabled))
- (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p) (tramp--test-sshfs-p)))
- (skip-unless (not (tramp--test-crypt-p)))
+ (skip-unless (tramp--test-supports-set-file-modes-p))
;; Since Emacs 27.1.
(skip-unless (fboundp 'exec-path))
;; found.
(write-region "foo" nil tmp-name)
(should (file-exists-p tmp-name))
+
(set-file-modes tmp-name #o777)
(should (file-executable-p tmp-name))
(should
This requires restrictions of file name syntax."
(tramp-smb-file-name-p tramp-test-temporary-file-directory))
-(defun tramp--test-supports-file-modes-p ()
- "Return whether the method under test supports file modes."
+(defun tramp--test-supports-set-file-modes-p ()
+ "Return whether the method under test supports setting file modes."
;; "smb" does not unless the SMB server supports "posix" extensions.
;; "adb" does not unless the Android device is rooted.
(or (tramp--test-sh-p) (tramp--test-sshfs-p) (tramp--test-sudoedit-p)
(kill-buffer buffer)
;; `substitute-in-file-name' could return different
- ;; values. For `adb', there could be strange file
+ ;; values. For "adb", there could be strange file
;; permissions preventing overwriting a file. We don't
- ;; care in this testcase.
+ ;; care in this test case.
(dolist (elt files)
(let ((file1
(substitute-in-file-name (expand-file-name elt tmp-name1)))
(ert-deftest tramp-test41-special-characters-with-stat ()
"Check special characters in file names.
-Use the `stat' command."
+Use the \"stat\" command."
:tags '(:expensive-test)
(skip-unless (not (getenv "EMACS_HYDRA_CI"))) ; SLOW ~ 287s
(skip-unless (tramp--test-enabled))
(ert-deftest tramp-test41-special-characters-with-perl ()
"Check special characters in file names.
-Use the `perl' command."
+Use the \"perl\" command."
:tags '(:expensive-test)
(skip-unless (not (getenv "EMACS_HYDRA_CI"))) ; SLOW ~ 266s
(skip-unless (tramp--test-enabled))
(ert-deftest tramp-test41-special-characters-with-ls ()
"Check special characters in file names.
-Use the `ls' command."
+Use the \"ls\" command."
:tags '(:expensive-test)
(skip-unless (not (getenv "EMACS_HYDRA_CI"))) ; SLOW ~ 287s
(skip-unless (tramp--test-enabled))
(ert-deftest tramp-test42-utf8-with-stat ()
"Check UTF8 encoding in file names and file contents.
-Use the `stat' command."
+Use the \"stat\" command."
:tags '(:expensive-test)
(skip-unless (not (getenv "EMACS_HYDRA_CI"))) ; SLOW ~ 595s
(skip-unless (tramp--test-enabled))
(ert-deftest tramp-test42-utf8-with-perl ()
"Check UTF8 encoding in file names and file contents.
-Use the `perl' command."
+Use the \"perl\" command."
:tags '(:expensive-test)
(skip-unless (not (getenv "EMACS_HYDRA_CI"))) ; SLOW ~ 620s
(skip-unless (tramp--test-enabled))
(ert-deftest tramp-test42-utf8-with-ls ()
"Check UTF8 encoding in file names and file contents.
-Use the `ls' command."
+Use the \"ls\" command."
:tags '(:expensive-test)
(skip-unless (not (getenv "EMACS_HYDRA_CI"))) ; SLOW ~ 690s
(skip-unless (tramp--test-enabled))
;; * Work on skipped tests. Make a comment, when it is impossible.
;; * Revisit expensive tests, once problems in `tramp-error' are solved.
-;; * Fix `tramp-test06-directory-file-name' for `ftp'.
-;; * Implement `tramp-test31-interrupt-process' for `adb', `sshfs' and
+;; * Fix `tramp-test06-directory-file-name' for "ftp".
+;; * Implement `tramp-test31-interrupt-process' for "adb", "sshfs" and
;; for direct async processes.
;; * Check, why direct async processes do not work for
;; `tramp-test44-asynchronous-requests'.