diff options
| author | Michael Albinus | 2017-08-20 21:18:05 +0200 |
|---|---|---|
| committer | Michael Albinus | 2017-08-20 21:18:05 +0200 |
| commit | 296472f5c5db2b5c046af67f74dff2640e7127c2 (patch) | |
| tree | dcbb6795ed345c4a11af70a83bc3245ab911f78b | |
| parent | cf74c27ba1401aba216267b5a9900e659d1b2a25 (diff) | |
| download | emacs-296472f5c5db2b5c046af67f74dff2640e7127c2.tar.gz emacs-296472f5c5db2b5c046af67f74dff2640e7127c2.zip | |
Implement `interrupt-process' for remote processes (Bug#28066)
* lisp/net/tramp-sh.el (tramp-sh-handle-start-file-process):
Support sending signals remotely.
(tramp-open-connection-setup-interactive-shell):
Trace "remote-tty" connection property.
* lisp/net/tramp.el (tramp-advice-interrupt-process): New defun.
(top): Add advice to `interrupt-process'. (Bug#28066)
* test/lisp/net/tramp-tests.el (tramp-test28-interrupt-process):
New test.
(tramp-test29-shell-command)
(tramp-test30-environment-variables)
(tramp-test30-environment-variables-and-port-numbers)
(tramp-test31-explicit-shell-file-name)
(tramp-test32-vc-registered)
(tramp-test33-make-auto-save-file-name)
(tramp-test34-make-nearby-temp-file)
(tramp-test35-special-characters)
(tramp-test35-special-characters-with-stat)
(tramp-test35-special-characters-with-perl)
(tramp-test35-special-characters-with-ls, tramp-test36-utf8)
(tramp-test36-utf8-with-stat, tramp-test36-utf8-with-perl)
(tramp-test36-utf8-with-ls)
(tramp-test37-asynchronous-requests)
(tramp-test38-recursive-load, tramp-test39-remote-load-path)
(tramp-test40-unload): Rename.
(tramp-test40-unload): Test also removal of advice.
| -rw-r--r-- | lisp/net/tramp-sh.el | 39 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 31 | ||||
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 68 |
3 files changed, 97 insertions, 41 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 6b365c10e25..50b380100ba 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -2875,7 +2875,8 @@ the result will be a local, non-Tramp, file name." | |||
| 2875 | ;; We do not want to raise an error when | 2875 | ;; We do not want to raise an error when |
| 2876 | ;; `start-file-process' has been started several times in | 2876 | ;; `start-file-process' has been started several times in |
| 2877 | ;; `eshell' and friends. | 2877 | ;; `eshell' and friends. |
| 2878 | (tramp-current-connection nil)) | 2878 | (tramp-current-connection nil) |
| 2879 | p) | ||
| 2879 | 2880 | ||
| 2880 | (while (get-process name1) | 2881 | (while (get-process name1) |
| 2881 | ;; NAME must be unique as process name. | 2882 | ;; NAME must be unique as process name. |
| @@ -2905,33 +2906,37 @@ the result will be a local, non-Tramp, file name." | |||
| 2905 | ;; to cleanup the prompt afterwards. | 2906 | ;; to cleanup the prompt afterwards. |
| 2906 | (catch 'suppress | 2907 | (catch 'suppress |
| 2907 | (tramp-maybe-open-connection v) | 2908 | (tramp-maybe-open-connection v) |
| 2909 | (setq p (tramp-get-connection-process v)) | ||
| 2910 | ;; Set the pid of the remote shell. This is | ||
| 2911 | ;; needed when sending signals remotely. | ||
| 2912 | (let ((pid (tramp-send-command-and-read v "echo $$"))) | ||
| 2913 | (process-put p 'remote-pid pid) | ||
| 2914 | (tramp-set-connection-property p "remote-pid" pid)) | ||
| 2908 | (widen) | 2915 | (widen) |
| 2909 | (delete-region mark (point)) | 2916 | (delete-region mark (point-max)) |
| 2910 | (narrow-to-region (point-max) (point-max)) | 2917 | (narrow-to-region (point-max) (point-max)) |
| 2911 | ;; Now do it. | 2918 | ;; Now do it. |
| 2912 | (if command | 2919 | (if command |
| 2913 | ;; Send the command. | 2920 | ;; Send the command. |
| 2914 | (tramp-send-command v command nil t) ; nooutput | 2921 | (tramp-send-command v command nil t) ; nooutput |
| 2915 | ;; Check, whether a pty is associated. | 2922 | ;; Check, whether a pty is associated. |
| 2916 | (unless (process-get | 2923 | (unless (process-get p 'remote-tty) |
| 2917 | (tramp-get-connection-process v) 'remote-tty) | ||
| 2918 | (tramp-error | 2924 | (tramp-error |
| 2919 | v 'file-error | 2925 | v 'file-error |
| 2920 | "pty association is not supported for `%s'" name)))) | 2926 | "pty association is not supported for `%s'" name)))) |
| 2921 | (let ((p (tramp-get-connection-process v))) | 2927 | ;; Set query flag and process marker for this |
| 2922 | ;; Set query flag and process marker for this | 2928 | ;; process. We ignore errors, because the process |
| 2923 | ;; process. We ignore errors, because the process | 2929 | ;; could have finished already. |
| 2924 | ;; could have finished already. | 2930 | (ignore-errors |
| 2925 | (ignore-errors | 2931 | (set-process-query-on-exit-flag p t) |
| 2926 | (set-process-query-on-exit-flag p t) | 2932 | (set-marker (process-mark p) (point))) |
| 2927 | (set-marker (process-mark p) (point))) | 2933 | ;; Return process. |
| 2928 | ;; Return process. | 2934 | p))) |
| 2929 | p)))) | ||
| 2930 | 2935 | ||
| 2931 | ;; Save exit. | 2936 | ;; Save exit. |
| 2932 | (if (string-match tramp-temp-buffer-name (buffer-name)) | 2937 | (if (string-match tramp-temp-buffer-name (buffer-name)) |
| 2933 | (ignore-errors | 2938 | (ignore-errors |
| 2934 | (set-process-buffer (tramp-get-connection-process v) nil) | 2939 | (set-process-buffer p nil) |
| 2935 | (kill-buffer (current-buffer))) | 2940 | (kill-buffer (current-buffer))) |
| 2936 | (set-buffer-modified-p bmp)) | 2941 | (set-buffer-modified-p bmp)) |
| 2937 | (tramp-set-connection-property v "process-name" nil) | 2942 | (tramp-set-connection-property v "process-name" nil) |
| @@ -4111,7 +4116,8 @@ process to set up. VEC specifies the connection." | |||
| 4111 | ;; Set `remote-tty' process property. | 4116 | ;; Set `remote-tty' process property. |
| 4112 | (let ((tty (tramp-send-command-and-read vec "echo \\\"`tty`\\\"" 'noerror))) | 4117 | (let ((tty (tramp-send-command-and-read vec "echo \\\"`tty`\\\"" 'noerror))) |
| 4113 | (unless (zerop (length tty)) | 4118 | (unless (zerop (length tty)) |
| 4114 | (process-put proc 'remote-tty tty))) | 4119 | (process-put proc 'remote-tty tty) |
| 4120 | (tramp-set-connection-property proc "remote-tty" tty))) | ||
| 4115 | 4121 | ||
| 4116 | ;; Dump stty settings in the traces. | 4122 | ;; Dump stty settings in the traces. |
| 4117 | (when (>= tramp-verbose 9) | 4123 | (when (>= tramp-verbose 9) |
| @@ -5687,9 +5693,6 @@ function cell is returned to be applied on a buffer." | |||
| 5687 | ;; * Reconnect directly to a compliant shell without first going | 5693 | ;; * Reconnect directly to a compliant shell without first going |
| 5688 | ;; through the user's default shell. (Pete Forman) | 5694 | ;; through the user's default shell. (Pete Forman) |
| 5689 | ;; | 5695 | ;; |
| 5690 | ;; * How can I interrupt the remote process with a signal | ||
| 5691 | ;; (interrupt-process seems not to work)? (Markus Triska) | ||
| 5692 | ;; | ||
| 5693 | ;; * Avoid the local shell entirely for starting remote processes. If | 5696 | ;; * Avoid the local shell entirely for starting remote processes. If |
| 5694 | ;; so, I think even a signal, when delivered directly to the local | 5697 | ;; so, I think even a signal, when delivered directly to the local |
| 5695 | ;; SSH instance, would correctly be propagated to the remote process | 5698 | ;; SSH instance, would correctly be propagated to the remote process |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 8d7fbc068b8..3469d45ff2a 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -4378,6 +4378,37 @@ Only works for Bourne-like shells." | |||
| 4378 | t t result))) | 4378 | t t result))) |
| 4379 | result)))) | 4379 | result)))) |
| 4380 | 4380 | ||
| 4381 | ;;; Signal handling. This works for remote processes, which have set | ||
| 4382 | ;;; the process property `remote-pid'. | ||
| 4383 | |||
| 4384 | (defun tramp-advice-interrupt-process (orig-fun &rest args) | ||
| 4385 | "Interrupt remote process PROC." | ||
| 4386 | (let* ((arg0 (car args)) | ||
| 4387 | (proc (cond | ||
| 4388 | ((processp arg0) arg0) | ||
| 4389 | ((bufferp arg0) (get-buffer-process arg0)) | ||
| 4390 | ((stringp arg0) (or (get-process arg0) | ||
| 4391 | (get-buffer-process arg0))) | ||
| 4392 | ((null arg0) (get-buffer-process (current-buffer))) | ||
| 4393 | (t arg0))) | ||
| 4394 | pid) | ||
| 4395 | ;; If it's a Tramp process, send the INT signal remotely. | ||
| 4396 | (if (and (processp proc) | ||
| 4397 | (setq pid (process-get proc 'remote-pid))) | ||
| 4398 | (progn | ||
| 4399 | (tramp-message proc 5 "%s %s" proc pid) | ||
| 4400 | (tramp-send-command | ||
| 4401 | (tramp-get-connection-property proc "vector" nil) | ||
| 4402 | (format "kill -2 %d" pid))) | ||
| 4403 | ;; Otherwise, just run the original function. | ||
| 4404 | (apply orig-fun args)))) | ||
| 4405 | |||
| 4406 | (advice-add 'interrupt-process :around 'tramp-advice-interrupt-process) | ||
| 4407 | (add-hook | ||
| 4408 | 'tramp-unload-hook | ||
| 4409 | (lambda () | ||
| 4410 | (advice-remove 'interrupt-process 'tramp-advice-interrupt-process))) | ||
| 4411 | |||
| 4381 | ;;; Integration of eshell.el: | 4412 | ;;; Integration of eshell.el: |
| 4382 | 4413 | ||
| 4383 | ;; eshell.el keeps the path in `eshell-path-env'. We must change it | 4414 | ;; eshell.el keeps the path in `eshell-path-env'. We must change it |
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 9dc276b2a93..dba553a2c5e 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -2900,7 +2900,26 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 2900 | ;; Cleanup. | 2900 | ;; Cleanup. |
| 2901 | (ignore-errors (delete-process proc)))))) | 2901 | (ignore-errors (delete-process proc)))))) |
| 2902 | 2902 | ||
| 2903 | (ert-deftest tramp-test28-shell-command () | 2903 | (ert-deftest tramp-test28-interrupt-process () |
| 2904 | "Check `interrupt-process'." | ||
| 2905 | :tags '(:expensive-test) | ||
| 2906 | (skip-unless (tramp--test-enabled)) | ||
| 2907 | (skip-unless (tramp--test-sh-p)) | ||
| 2908 | |||
| 2909 | (let ((default-directory tramp-test-temporary-file-directory) | ||
| 2910 | kill-buffer-query-functions proc) | ||
| 2911 | (unwind-protect | ||
| 2912 | (with-temp-buffer | ||
| 2913 | (setq proc (start-file-process "test" (current-buffer) "sleep" "10")) | ||
| 2914 | (should (processp proc)) | ||
| 2915 | (should (equal (process-status proc) 'run)) | ||
| 2916 | (interrupt-process proc) | ||
| 2917 | (should (equal (process-status proc) 'signal))) | ||
| 2918 | |||
| 2919 | ;; Cleanup. | ||
| 2920 | (ignore-errors (delete-process proc))))) | ||
| 2921 | |||
| 2922 | (ert-deftest tramp-test29-shell-command () | ||
| 2904 | "Check `shell-command'." | 2923 | "Check `shell-command'." |
| 2905 | :tags '(:expensive-test) | 2924 | :tags '(:expensive-test) |
| 2906 | (skip-unless (tramp--test-enabled)) | 2925 | (skip-unless (tramp--test-enabled)) |
| @@ -3004,7 +3023,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3004 | (buffer-substring-no-properties (point-min) (point-max)))) | 3023 | (buffer-substring-no-properties (point-min) (point-max)))) |
| 3005 | 3024 | ||
| 3006 | ;; This test is inspired by Bug#23952. | 3025 | ;; This test is inspired by Bug#23952. |
| 3007 | (ert-deftest tramp-test29-environment-variables () | 3026 | (ert-deftest tramp-test30-environment-variables () |
| 3008 | "Check that remote processes set / unset environment variables properly." | 3027 | "Check that remote processes set / unset environment variables properly." |
| 3009 | :tags '(:expensive-test) | 3028 | :tags '(:expensive-test) |
| 3010 | (skip-unless (tramp--test-enabled)) | 3029 | (skip-unless (tramp--test-enabled)) |
| @@ -3082,7 +3101,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3082 | (funcall this-shell-command-to-string "set"))))))))) | 3101 | (funcall this-shell-command-to-string "set"))))))))) |
| 3083 | 3102 | ||
| 3084 | ;; This test is inspired by Bug#27009. | 3103 | ;; This test is inspired by Bug#27009. |
| 3085 | (ert-deftest tramp-test29-environment-variables-and-port-numbers () | 3104 | (ert-deftest tramp-test30-environment-variables-and-port-numbers () |
| 3086 | "Check that two connections with separate ports are different." | 3105 | "Check that two connections with separate ports are different." |
| 3087 | (skip-unless (tramp--test-enabled)) | 3106 | (skip-unless (tramp--test-enabled)) |
| 3088 | ;; We test it only for the mock-up connection; otherwise there might | 3107 | ;; We test it only for the mock-up connection; otherwise there might |
| @@ -3121,7 +3140,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3121 | (tramp-cleanup-connection (tramp-dissect-file-name dir))))) | 3140 | (tramp-cleanup-connection (tramp-dissect-file-name dir))))) |
| 3122 | 3141 | ||
| 3123 | ;; The functions were introduced in Emacs 26.1. | 3142 | ;; The functions were introduced in Emacs 26.1. |
| 3124 | (ert-deftest tramp-test30-explicit-shell-file-name () | 3143 | (ert-deftest tramp-test31-explicit-shell-file-name () |
| 3125 | "Check that connection-local `explicit-shell-file-name' is set." | 3144 | "Check that connection-local `explicit-shell-file-name' is set." |
| 3126 | :tags '(:expensive-test) | 3145 | :tags '(:expensive-test) |
| 3127 | (skip-unless (tramp--test-enabled)) | 3146 | (skip-unless (tramp--test-enabled)) |
| @@ -3165,7 +3184,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3165 | (put 'explicit-shell-file-name 'permanent-local nil) | 3184 | (put 'explicit-shell-file-name 'permanent-local nil) |
| 3166 | (kill-buffer "*shell*")))) | 3185 | (kill-buffer "*shell*")))) |
| 3167 | 3186 | ||
| 3168 | (ert-deftest tramp-test31-vc-registered () | 3187 | (ert-deftest tramp-test32-vc-registered () |
| 3169 | "Check `vc-registered'." | 3188 | "Check `vc-registered'." |
| 3170 | :tags '(:expensive-test) | 3189 | :tags '(:expensive-test) |
| 3171 | (skip-unless (tramp--test-enabled)) | 3190 | (skip-unless (tramp--test-enabled)) |
| @@ -3238,7 +3257,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3238 | ;; Cleanup. | 3257 | ;; Cleanup. |
| 3239 | (ignore-errors (delete-directory tmp-name1 'recursive)))))) | 3258 | (ignore-errors (delete-directory tmp-name1 'recursive)))))) |
| 3240 | 3259 | ||
| 3241 | (ert-deftest tramp-test32-make-auto-save-file-name () | 3260 | (ert-deftest tramp-test33-make-auto-save-file-name () |
| 3242 | "Check `make-auto-save-file-name'." | 3261 | "Check `make-auto-save-file-name'." |
| 3243 | (skip-unless (tramp--test-enabled)) | 3262 | (skip-unless (tramp--test-enabled)) |
| 3244 | 3263 | ||
| @@ -3333,7 +3352,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3333 | (ignore-errors (delete-directory tmp-name2 'recursive)))))) | 3352 | (ignore-errors (delete-directory tmp-name2 'recursive)))))) |
| 3334 | 3353 | ||
| 3335 | ;; The functions were introduced in Emacs 26.1. | 3354 | ;; The functions were introduced in Emacs 26.1. |
| 3336 | (ert-deftest tramp-test33-make-nearby-temp-file () | 3355 | (ert-deftest tramp-test34-make-nearby-temp-file () |
| 3337 | "Check `make-nearby-temp-file' and `temporary-file-directory'." | 3356 | "Check `make-nearby-temp-file' and `temporary-file-directory'." |
| 3338 | (skip-unless (tramp--test-enabled)) | 3357 | (skip-unless (tramp--test-enabled)) |
| 3339 | ;; Since Emacs 26.1. | 3358 | ;; Since Emacs 26.1. |
| @@ -3600,7 +3619,7 @@ This requires restrictions of file name syntax." | |||
| 3600 | (ignore-errors (delete-directory tmp-name2 'recursive)))))) | 3619 | (ignore-errors (delete-directory tmp-name2 'recursive)))))) |
| 3601 | 3620 | ||
| 3602 | (defun tramp--test-special-characters () | 3621 | (defun tramp--test-special-characters () |
| 3603 | "Perform the test in `tramp-test34-special-characters*'." | 3622 | "Perform the test in `tramp-test35-special-characters*'." |
| 3604 | ;; Newlines, slashes and backslashes in file names are not | 3623 | ;; Newlines, slashes and backslashes in file names are not |
| 3605 | ;; supported. So we don't test. And we don't test the tab | 3624 | ;; supported. So we don't test. And we don't test the tab |
| 3606 | ;; character on Windows or Cygwin, because the backslash is | 3625 | ;; character on Windows or Cygwin, because the backslash is |
| @@ -3643,7 +3662,7 @@ This requires restrictions of file name syntax." | |||
| 3643 | "{foo}bar{baz}")) | 3662 | "{foo}bar{baz}")) |
| 3644 | 3663 | ||
| 3645 | ;; These tests are inspired by Bug#17238. | 3664 | ;; These tests are inspired by Bug#17238. |
| 3646 | (ert-deftest tramp-test34-special-characters () | 3665 | (ert-deftest tramp-test35-special-characters () |
| 3647 | "Check special characters in file names." | 3666 | "Check special characters in file names." |
| 3648 | (skip-unless (tramp--test-enabled)) | 3667 | (skip-unless (tramp--test-enabled)) |
| 3649 | (skip-unless (not (tramp--test-rsync-p))) | 3668 | (skip-unless (not (tramp--test-rsync-p))) |
| @@ -3651,7 +3670,7 @@ This requires restrictions of file name syntax." | |||
| 3651 | 3670 | ||
| 3652 | (tramp--test-special-characters)) | 3671 | (tramp--test-special-characters)) |
| 3653 | 3672 | ||
| 3654 | (ert-deftest tramp-test34-special-characters-with-stat () | 3673 | (ert-deftest tramp-test35-special-characters-with-stat () |
| 3655 | "Check special characters in file names. | 3674 | "Check special characters in file names. |
| 3656 | Use the `stat' command." | 3675 | Use the `stat' command." |
| 3657 | :tags '(:expensive-test) | 3676 | :tags '(:expensive-test) |
| @@ -3669,7 +3688,7 @@ Use the `stat' command." | |||
| 3669 | tramp-connection-properties))) | 3688 | tramp-connection-properties))) |
| 3670 | (tramp--test-special-characters))) | 3689 | (tramp--test-special-characters))) |
| 3671 | 3690 | ||
| 3672 | (ert-deftest tramp-test34-special-characters-with-perl () | 3691 | (ert-deftest tramp-test35-special-characters-with-perl () |
| 3673 | "Check special characters in file names. | 3692 | "Check special characters in file names. |
| 3674 | Use the `perl' command." | 3693 | Use the `perl' command." |
| 3675 | :tags '(:expensive-test) | 3694 | :tags '(:expensive-test) |
| @@ -3690,7 +3709,7 @@ Use the `perl' command." | |||
| 3690 | tramp-connection-properties))) | 3709 | tramp-connection-properties))) |
| 3691 | (tramp--test-special-characters))) | 3710 | (tramp--test-special-characters))) |
| 3692 | 3711 | ||
| 3693 | (ert-deftest tramp-test34-special-characters-with-ls () | 3712 | (ert-deftest tramp-test35-special-characters-with-ls () |
| 3694 | "Check special characters in file names. | 3713 | "Check special characters in file names. |
| 3695 | Use the `ls' command." | 3714 | Use the `ls' command." |
| 3696 | :tags '(:expensive-test) | 3715 | :tags '(:expensive-test) |
| @@ -3713,7 +3732,7 @@ Use the `ls' command." | |||
| 3713 | (tramp--test-special-characters))) | 3732 | (tramp--test-special-characters))) |
| 3714 | 3733 | ||
| 3715 | (defun tramp--test-utf8 () | 3734 | (defun tramp--test-utf8 () |
| 3716 | "Perform the test in `tramp-test35-utf8*'." | 3735 | "Perform the test in `tramp-test36-utf8*'." |
| 3717 | (let* ((utf8 (if (and (eq system-type 'darwin) | 3736 | (let* ((utf8 (if (and (eq system-type 'darwin) |
| 3718 | (memq 'utf-8-hfs (coding-system-list))) | 3737 | (memq 'utf-8-hfs (coding-system-list))) |
| 3719 | 'utf-8-hfs 'utf-8)) | 3738 | 'utf-8-hfs 'utf-8)) |
| @@ -3728,7 +3747,7 @@ Use the `ls' command." | |||
| 3728 | "银河系漫游指南系列" | 3747 | "银河系漫游指南系列" |
| 3729 | "Автостопом по гала́ктике"))) | 3748 | "Автостопом по гала́ктике"))) |
| 3730 | 3749 | ||
| 3731 | (ert-deftest tramp-test35-utf8 () | 3750 | (ert-deftest tramp-test36-utf8 () |
| 3732 | "Check UTF8 encoding in file names and file contents." | 3751 | "Check UTF8 encoding in file names and file contents." |
| 3733 | (skip-unless (tramp--test-enabled)) | 3752 | (skip-unless (tramp--test-enabled)) |
| 3734 | (skip-unless (not (tramp--test-docker-p))) | 3753 | (skip-unless (not (tramp--test-docker-p))) |
| @@ -3738,7 +3757,7 @@ Use the `ls' command." | |||
| 3738 | 3757 | ||
| 3739 | (tramp--test-utf8)) | 3758 | (tramp--test-utf8)) |
| 3740 | 3759 | ||
| 3741 | (ert-deftest tramp-test35-utf8-with-stat () | 3760 | (ert-deftest tramp-test36-utf8-with-stat () |
| 3742 | "Check UTF8 encoding in file names and file contents. | 3761 | "Check UTF8 encoding in file names and file contents. |
| 3743 | Use the `stat' command." | 3762 | Use the `stat' command." |
| 3744 | :tags '(:expensive-test) | 3763 | :tags '(:expensive-test) |
| @@ -3758,7 +3777,7 @@ Use the `stat' command." | |||
| 3758 | tramp-connection-properties))) | 3777 | tramp-connection-properties))) |
| 3759 | (tramp--test-utf8))) | 3778 | (tramp--test-utf8))) |
| 3760 | 3779 | ||
| 3761 | (ert-deftest tramp-test35-utf8-with-perl () | 3780 | (ert-deftest tramp-test36-utf8-with-perl () |
| 3762 | "Check UTF8 encoding in file names and file contents. | 3781 | "Check UTF8 encoding in file names and file contents. |
| 3763 | Use the `perl' command." | 3782 | Use the `perl' command." |
| 3764 | :tags '(:expensive-test) | 3783 | :tags '(:expensive-test) |
| @@ -3781,7 +3800,7 @@ Use the `perl' command." | |||
| 3781 | tramp-connection-properties))) | 3800 | tramp-connection-properties))) |
| 3782 | (tramp--test-utf8))) | 3801 | (tramp--test-utf8))) |
| 3783 | 3802 | ||
| 3784 | (ert-deftest tramp-test35-utf8-with-ls () | 3803 | (ert-deftest tramp-test36-utf8-with-ls () |
| 3785 | "Check UTF8 encoding in file names and file contents. | 3804 | "Check UTF8 encoding in file names and file contents. |
| 3786 | Use the `ls' command." | 3805 | Use the `ls' command." |
| 3787 | :tags '(:expensive-test) | 3806 | :tags '(:expensive-test) |
| @@ -3809,7 +3828,7 @@ Use the `ls' command." | |||
| 3809 | (ert-fail (format "`%s' timed out" (ert-test-name (ert-running-test))))) | 3828 | (ert-fail (format "`%s' timed out" (ert-test-name (ert-running-test))))) |
| 3810 | 3829 | ||
| 3811 | ;; This test is inspired by Bug#16928. | 3830 | ;; This test is inspired by Bug#16928. |
| 3812 | (ert-deftest tramp-test36-asynchronous-requests () | 3831 | (ert-deftest tramp-test37-asynchronous-requests () |
| 3813 | "Check parallel asynchronous requests. | 3832 | "Check parallel asynchronous requests. |
| 3814 | Such requests could arrive from timers, process filters and | 3833 | Such requests could arrive from timers, process filters and |
| 3815 | process sentinels. They shall not disturb each other." | 3834 | process sentinels. They shall not disturb each other." |
| @@ -3966,7 +3985,7 @@ process sentinels. They shall not disturb each other." | |||
| 3966 | (ignore-errors (cancel-timer timer)) | 3985 | (ignore-errors (cancel-timer timer)) |
| 3967 | (ignore-errors (delete-directory tmp-name 'recursive))))))) | 3986 | (ignore-errors (delete-directory tmp-name 'recursive))))))) |
| 3968 | 3987 | ||
| 3969 | (ert-deftest tramp-test37-recursive-load () | 3988 | (ert-deftest tramp-test38-recursive-load () |
| 3970 | "Check that Tramp does not fail due to recursive load." | 3989 | "Check that Tramp does not fail due to recursive load." |
| 3971 | (skip-unless (tramp--test-enabled)) | 3990 | (skip-unless (tramp--test-enabled)) |
| 3972 | 3991 | ||
| @@ -3989,7 +4008,7 @@ process sentinels. They shall not disturb each other." | |||
| 3989 | (mapconcat 'shell-quote-argument load-path " -L ") | 4008 | (mapconcat 'shell-quote-argument load-path " -L ") |
| 3990 | (shell-quote-argument code)))))))) | 4009 | (shell-quote-argument code)))))))) |
| 3991 | 4010 | ||
| 3992 | (ert-deftest tramp-test38-remote-load-path () | 4011 | (ert-deftest tramp-test39-remote-load-path () |
| 3993 | "Check that Tramp autoloads its packages with remote `load-path'." | 4012 | "Check that Tramp autoloads its packages with remote `load-path'." |
| 3994 | ;; `tramp-cleanup-all-connections' is autoloaded from tramp-cmds.el. | 4013 | ;; `tramp-cleanup-all-connections' is autoloaded from tramp-cmds.el. |
| 3995 | ;; It shall still work, when a remote file name is in the | 4014 | ;; It shall still work, when a remote file name is in the |
| @@ -4012,7 +4031,7 @@ process sentinels. They shall not disturb each other." | |||
| 4012 | (mapconcat 'shell-quote-argument load-path " -L ") | 4031 | (mapconcat 'shell-quote-argument load-path " -L ") |
| 4013 | (shell-quote-argument code))))))) | 4032 | (shell-quote-argument code))))))) |
| 4014 | 4033 | ||
| 4015 | (ert-deftest tramp-test39-unload () | 4034 | (ert-deftest tramp-test40-unload () |
| 4016 | "Check that Tramp and its subpackages unload completely. | 4035 | "Check that Tramp and its subpackages unload completely. |
| 4017 | Since it unloads Tramp, it shall be the last test to run." | 4036 | Since it unloads Tramp, it shall be the last test to run." |
| 4018 | :tags '(:expensive-test) | 4037 | :tags '(:expensive-test) |
| @@ -4053,7 +4072,10 @@ Since it unloads Tramp, it shall be the last test to run." | |||
| 4053 | (not (string-match "unload-hook$" (symbol-name x))) | 4072 | (not (string-match "unload-hook$" (symbol-name x))) |
| 4054 | (consp (symbol-value x)) | 4073 | (consp (symbol-value x)) |
| 4055 | (ignore-errors (all-completions "tramp" (symbol-value x))) | 4074 | (ignore-errors (all-completions "tramp" (symbol-value x))) |
| 4056 | (ert-fail (format "Hook `%s' still contains Tramp function" x))))))) | 4075 | (ert-fail (format "Hook `%s' still contains Tramp function" x))))) |
| 4076 | ;; The advice on `interrupt-process' shall be removed. | ||
| 4077 | (should-not | ||
| 4078 | (advice-member-p 'tramp-advice-interrupt-process 'interrupt-process)))) | ||
| 4057 | 4079 | ||
| 4058 | ;; TODO: | 4080 | ;; TODO: |
| 4059 | 4081 | ||
| @@ -4070,7 +4092,7 @@ Since it unloads Tramp, it shall be the last test to run." | |||
| 4070 | ;; * Fix `tramp-test05-expand-file-name-relative' in `expand-file-name'. | 4092 | ;; * Fix `tramp-test05-expand-file-name-relative' in `expand-file-name'. |
| 4071 | ;; * Fix `tramp-test06-directory-file-name' for `ftp'. | 4093 | ;; * Fix `tramp-test06-directory-file-name' for `ftp'. |
| 4072 | ;; * Fix `tramp-test27-start-file-process' on MS Windows (`process-send-eof'?). | 4094 | ;; * Fix `tramp-test27-start-file-process' on MS Windows (`process-send-eof'?). |
| 4073 | ;; * Fix Bug#16928 in `tramp-test36-asynchronous-requests'. | 4095 | ;; * Fix Bug#16928 in `tramp-test37-asynchronous-requests'. |
| 4074 | 4096 | ||
| 4075 | (defun tramp-test-all (&optional interactive) | 4097 | (defun tramp-test-all (&optional interactive) |
| 4076 | "Run all tests for \\[tramp]." | 4098 | "Run all tests for \\[tramp]." |