aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/tramp-archive-tests.el8
-rw-r--r--test/lisp/net/tramp-tests.el86
2 files changed, 66 insertions, 28 deletions
diff --git a/test/lisp/net/tramp-archive-tests.el b/test/lisp/net/tramp-archive-tests.el
index b327e64818b..0a8716be0d7 100644
--- a/test/lisp/net/tramp-archive-tests.el
+++ b/test/lisp/net/tramp-archive-tests.el
@@ -748,7 +748,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
748 (tramp-archive-cleanup-hash)))) 748 (tramp-archive-cleanup-hash))))
749 749
750;; The functions were introduced in Emacs 26.1. 750;; The functions were introduced in Emacs 26.1.
751(ert-deftest tramp-archive-test37-make-nearby-temp-file () 751(ert-deftest tramp-archive-test38-make-nearby-temp-file ()
752 "Check `make-nearby-temp-file' and `temporary-file-directory'." 752 "Check `make-nearby-temp-file' and `temporary-file-directory'."
753 (skip-unless tramp-archive-enabled) 753 (skip-unless tramp-archive-enabled)
754 ;; Since Emacs 26.1. 754 ;; Since Emacs 26.1.
@@ -785,7 +785,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
785 (delete-directory tmp-file) 785 (delete-directory tmp-file)
786 (should-not (file-exists-p tmp-file)))) 786 (should-not (file-exists-p tmp-file))))
787 787
788(ert-deftest tramp-archive-test40-file-system-info () 788(ert-deftest tramp-archive-test41-file-system-info ()
789 "Check that `file-system-info' returns proper values." 789 "Check that `file-system-info' returns proper values."
790 (skip-unless tramp-archive-enabled) 790 (skip-unless tramp-archive-enabled)
791 ;; Since Emacs 27.1. 791 ;; Since Emacs 27.1.
@@ -802,7 +802,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
802 (zerop (nth 1 fsi)) 802 (zerop (nth 1 fsi))
803 (zerop (nth 2 fsi)))))) 803 (zerop (nth 2 fsi))))))
804 804
805(ert-deftest tramp-archive-test42-auto-load () 805(ert-deftest tramp-archive-test43-auto-load ()
806 "Check that `tramp-archive' autoloads properly." 806 "Check that `tramp-archive' autoloads properly."
807 (skip-unless tramp-archive-enabled) 807 (skip-unless tramp-archive-enabled)
808 ;; Autoloading tramp-archive works since Emacs 27.1. 808 ;; Autoloading tramp-archive works since Emacs 27.1.
@@ -832,7 +832,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
832 (mapconcat 'shell-quote-argument load-path " -L ") 832 (mapconcat 'shell-quote-argument load-path " -L ")
833 (shell-quote-argument (format code file))))))))) 833 (shell-quote-argument (format code file)))))))))
834 834
835(ert-deftest tramp-archive-test42-delay-load () 835(ert-deftest tramp-archive-test43-delay-load ()
836 "Check that `tramp-archive' is loaded lazily, only when needed." 836 "Check that `tramp-archive' is loaded lazily, only when needed."
837 (skip-unless tramp-archive-enabled) 837 (skip-unless tramp-archive-enabled)
838 ;; Autoloading tramp-archive works since Emacs 27.1. 838 ;; Autoloading tramp-archive works since Emacs 27.1.
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index c5cb4cb43eb..df07a8f1b89 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -33,7 +33,7 @@
33;; remote host, set this environment variable to "/dev/null" or 33;; remote host, set this environment variable to "/dev/null" or
34;; whatever is appropriate on your system. 34;; whatever is appropriate on your system.
35 35
36;; For slow remote connections, `tramp-test41-asynchronous-requests' 36;; For slow remote connections, `tramp-test42-asynchronous-requests'
37;; might be too heavy. Setting $REMOTE_PARALLEL_PROCESSES to a proper 37;; might be too heavy. Setting $REMOTE_PARALLEL_PROCESSES to a proper
38;; value less than 10 could help. 38;; value less than 10 could help.
39 39
@@ -4021,7 +4021,45 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4021 (put 'explicit-shell-file-name 'permanent-local nil) 4021 (put 'explicit-shell-file-name 'permanent-local nil)
4022 (kill-buffer "*shell*")))) 4022 (kill-buffer "*shell*"))))
4023 4023
4024(ert-deftest tramp-test34-vc-registered () 4024;; The function was introduced in Emacs 27.1.
4025(ert-deftest tramp-test34-exec-path ()
4026 "Check `exec-path' and `executable-find'."
4027 (skip-unless (tramp--test-enabled))
4028 (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p)))
4029 ;; Since Emacs 27.1.
4030 (skip-unless (boundp 'exec-path))
4031
4032 (let ((tmp-name (tramp--test-make-temp-name))
4033 (default-directory tramp-test-temporary-file-directory))
4034 (unwind-protect
4035 (progn
4036 (should (consp (with-no-warnings (exec-path))))
4037 ;; Last element is the `exec-directory'.
4038 (should
4039 (string-equal
4040 (car (last (with-no-warnings (exec-path))))
4041 (file-local-name default-directory)))
4042 ;; The shell "sh" shall always exist.
4043 (should (executable-find "sh" 'remote))
4044 ;; Since the last element in `exec-path' is the current
4045 ;; directory, an executable file in that directory will be
4046 ;; found.
4047 (write-region "foo" nil tmp-name)
4048 (should (file-exists-p tmp-name))
4049 (set-file-modes tmp-name #o777)
4050 (should (file-executable-p tmp-name))
4051 (should
4052 (string-equal
4053 (executable-find (file-name-nondirectory tmp-name) 'remote)
4054 (file-local-name tmp-name)))
4055 (should-not
4056 (executable-find
4057 (concat (file-name-nondirectory tmp-name) "foo") 'remote)))
4058
4059 ;; Cleanup.
4060 (ignore-errors (delete-file tmp-name)))))
4061
4062(ert-deftest tramp-test35-vc-registered ()
4025 "Check `vc-registered'." 4063 "Check `vc-registered'."
4026 :tags '(:expensive-test) 4064 :tags '(:expensive-test)
4027 (skip-unless (tramp--test-enabled)) 4065 (skip-unless (tramp--test-enabled))
@@ -4091,7 +4129,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4091 ;; Cleanup. 4129 ;; Cleanup.
4092 (ignore-errors (delete-directory tmp-name1 'recursive)))))) 4130 (ignore-errors (delete-directory tmp-name1 'recursive))))))
4093 4131
4094(ert-deftest tramp-test35-make-auto-save-file-name () 4132(ert-deftest tramp-test36-make-auto-save-file-name ()
4095 "Check `make-auto-save-file-name'." 4133 "Check `make-auto-save-file-name'."
4096 (skip-unless (tramp--test-enabled)) 4134 (skip-unless (tramp--test-enabled))
4097 4135
@@ -4182,7 +4220,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4182 (ignore-errors (delete-file tmp-name1)) 4220 (ignore-errors (delete-file tmp-name1))
4183 (ignore-errors (delete-directory tmp-name2 'recursive)))))) 4221 (ignore-errors (delete-directory tmp-name2 'recursive))))))
4184 4222
4185(ert-deftest tramp-test36-find-backup-file-name () 4223(ert-deftest tramp-test37-find-backup-file-name ()
4186 "Check `find-backup-file-name'." 4224 "Check `find-backup-file-name'."
4187 (skip-unless (tramp--test-enabled)) 4225 (skip-unless (tramp--test-enabled))
4188 4226
@@ -4293,7 +4331,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4293 (ignore-errors (delete-directory tmp-name2 'recursive)))))) 4331 (ignore-errors (delete-directory tmp-name2 'recursive))))))
4294 4332
4295;; The functions were introduced in Emacs 26.1. 4333;; The functions were introduced in Emacs 26.1.
4296(ert-deftest tramp-test37-make-nearby-temp-file () 4334(ert-deftest tramp-test38-make-nearby-temp-file ()
4297 "Check `make-nearby-temp-file' and `temporary-file-directory'." 4335 "Check `make-nearby-temp-file' and `temporary-file-directory'."
4298 (skip-unless (tramp--test-enabled)) 4336 (skip-unless (tramp--test-enabled))
4299 ;; Since Emacs 26.1. 4337 ;; Since Emacs 26.1.
@@ -4586,7 +4624,7 @@ This requires restrictions of file name syntax."
4586 (ignore-errors (delete-directory tmp-name2 'recursive)))))) 4624 (ignore-errors (delete-directory tmp-name2 'recursive))))))
4587 4625
4588(defun tramp--test-special-characters () 4626(defun tramp--test-special-characters ()
4589 "Perform the test in `tramp-test38-special-characters*'." 4627 "Perform the test in `tramp-test39-special-characters*'."
4590 ;; Newlines, slashes and backslashes in file names are not 4628 ;; Newlines, slashes and backslashes in file names are not
4591 ;; supported. So we don't test. And we don't test the tab 4629 ;; supported. So we don't test. And we don't test the tab
4592 ;; character on Windows or Cygwin, because the backslash is 4630 ;; character on Windows or Cygwin, because the backslash is
@@ -4634,7 +4672,7 @@ This requires restrictions of file name syntax."
4634 files (list (mapconcat 'identity files "")))))) 4672 files (list (mapconcat 'identity files ""))))))
4635 4673
4636;; These tests are inspired by Bug#17238. 4674;; These tests are inspired by Bug#17238.
4637(ert-deftest tramp-test38-special-characters () 4675(ert-deftest tramp-test39-special-characters ()
4638 "Check special characters in file names." 4676 "Check special characters in file names."
4639 (skip-unless (tramp--test-enabled)) 4677 (skip-unless (tramp--test-enabled))
4640 (skip-unless (not (tramp--test-rsync-p))) 4678 (skip-unless (not (tramp--test-rsync-p)))
@@ -4642,7 +4680,7 @@ This requires restrictions of file name syntax."
4642 4680
4643 (tramp--test-special-characters)) 4681 (tramp--test-special-characters))
4644 4682
4645(ert-deftest tramp-test38-special-characters-with-stat () 4683(ert-deftest tramp-test39-special-characters-with-stat ()
4646 "Check special characters in file names. 4684 "Check special characters in file names.
4647Use the `stat' command." 4685Use the `stat' command."
4648 :tags '(:expensive-test) 4686 :tags '(:expensive-test)
@@ -4660,7 +4698,7 @@ Use the `stat' command."
4660 tramp-connection-properties))) 4698 tramp-connection-properties)))
4661 (tramp--test-special-characters))) 4699 (tramp--test-special-characters)))
4662 4700
4663(ert-deftest tramp-test38-special-characters-with-perl () 4701(ert-deftest tramp-test39-special-characters-with-perl ()
4664 "Check special characters in file names. 4702 "Check special characters in file names.
4665Use the `perl' command." 4703Use the `perl' command."
4666 :tags '(:expensive-test) 4704 :tags '(:expensive-test)
@@ -4681,7 +4719,7 @@ Use the `perl' command."
4681 tramp-connection-properties))) 4719 tramp-connection-properties)))
4682 (tramp--test-special-characters))) 4720 (tramp--test-special-characters)))
4683 4721
4684(ert-deftest tramp-test38-special-characters-with-ls () 4722(ert-deftest tramp-test39-special-characters-with-ls ()
4685 "Check special characters in file names. 4723 "Check special characters in file names.
4686Use the `ls' command." 4724Use the `ls' command."
4687 :tags '(:expensive-test) 4725 :tags '(:expensive-test)
@@ -4704,7 +4742,7 @@ Use the `ls' command."
4704 (tramp--test-special-characters))) 4742 (tramp--test-special-characters)))
4705 4743
4706(defun tramp--test-utf8 () 4744(defun tramp--test-utf8 ()
4707 "Perform the test in `tramp-test39-utf8*'." 4745 "Perform the test in `tramp-test40-utf8*'."
4708 (let* ((utf8 (if (and (eq system-type 'darwin) 4746 (let* ((utf8 (if (and (eq system-type 'darwin)
4709 (memq 'utf-8-hfs (coding-system-list))) 4747 (memq 'utf-8-hfs (coding-system-list)))
4710 'utf-8-hfs 'utf-8)) 4748 'utf-8-hfs 'utf-8))
@@ -4739,7 +4777,7 @@ Use the `ls' command."
4739 (replace-regexp-in-string "[\t\n/.?]" "" x))) 4777 (replace-regexp-in-string "[\t\n/.?]" "" x)))
4740 language-info-alist))))))) 4778 language-info-alist)))))))
4741 4779
4742(ert-deftest tramp-test39-utf8 () 4780(ert-deftest tramp-test40-utf8 ()
4743 "Check UTF8 encoding in file names and file contents." 4781 "Check UTF8 encoding in file names and file contents."
4744 (skip-unless (tramp--test-enabled)) 4782 (skip-unless (tramp--test-enabled))
4745 (skip-unless (not (tramp--test-docker-p))) 4783 (skip-unless (not (tramp--test-docker-p)))
@@ -4749,7 +4787,7 @@ Use the `ls' command."
4749 4787
4750 (tramp--test-utf8)) 4788 (tramp--test-utf8))
4751 4789
4752(ert-deftest tramp-test39-utf8-with-stat () 4790(ert-deftest tramp-test40-utf8-with-stat ()
4753 "Check UTF8 encoding in file names and file contents. 4791 "Check UTF8 encoding in file names and file contents.
4754Use the `stat' command." 4792Use the `stat' command."
4755 :tags '(:expensive-test) 4793 :tags '(:expensive-test)
@@ -4769,7 +4807,7 @@ Use the `stat' command."
4769 tramp-connection-properties))) 4807 tramp-connection-properties)))
4770 (tramp--test-utf8))) 4808 (tramp--test-utf8)))
4771 4809
4772(ert-deftest tramp-test39-utf8-with-perl () 4810(ert-deftest tramp-test40-utf8-with-perl ()
4773 "Check UTF8 encoding in file names and file contents. 4811 "Check UTF8 encoding in file names and file contents.
4774Use the `perl' command." 4812Use the `perl' command."
4775 :tags '(:expensive-test) 4813 :tags '(:expensive-test)
@@ -4792,7 +4830,7 @@ Use the `perl' command."
4792 tramp-connection-properties))) 4830 tramp-connection-properties)))
4793 (tramp--test-utf8))) 4831 (tramp--test-utf8)))
4794 4832
4795(ert-deftest tramp-test39-utf8-with-ls () 4833(ert-deftest tramp-test40-utf8-with-ls ()
4796 "Check UTF8 encoding in file names and file contents. 4834 "Check UTF8 encoding in file names and file contents.
4797Use the `ls' command." 4835Use the `ls' command."
4798 :tags '(:expensive-test) 4836 :tags '(:expensive-test)
@@ -4815,7 +4853,7 @@ Use the `ls' command."
4815 tramp-connection-properties))) 4853 tramp-connection-properties)))
4816 (tramp--test-utf8))) 4854 (tramp--test-utf8)))
4817 4855
4818(ert-deftest tramp-test40-file-system-info () 4856(ert-deftest tramp-test41-file-system-info ()
4819 "Check that `file-system-info' returns proper values." 4857 "Check that `file-system-info' returns proper values."
4820 (skip-unless (tramp--test-enabled)) 4858 (skip-unless (tramp--test-enabled))
4821 ;; Since Emacs 27.1. 4859 ;; Since Emacs 27.1.
@@ -4837,7 +4875,7 @@ Use the `ls' command."
4837 (ert-fail (format "`%s' timed out" (ert-test-name (ert-running-test))))) 4875 (ert-fail (format "`%s' timed out" (ert-test-name (ert-running-test)))))
4838 4876
4839;; This test is inspired by Bug#16928. 4877;; This test is inspired by Bug#16928.
4840(ert-deftest tramp-test41-asynchronous-requests () 4878(ert-deftest tramp-test42-asynchronous-requests ()
4841 "Check parallel asynchronous requests. 4879 "Check parallel asynchronous requests.
4842Such requests could arrive from timers, process filters and 4880Such requests could arrive from timers, process filters and
4843process sentinels. They shall not disturb each other." 4881process sentinels. They shall not disturb each other."
@@ -5012,7 +5050,7 @@ process sentinels. They shall not disturb each other."
5012 (ignore-errors (delete-directory tmp-name 'recursive))))))) 5050 (ignore-errors (delete-directory tmp-name 'recursive)))))))
5013 5051
5014;; This test is inspired by Bug#29163. 5052;; This test is inspired by Bug#29163.
5015(ert-deftest tramp-test42-auto-load () 5053(ert-deftest tramp-test43-auto-load ()
5016 "Check that Tramp autoloads properly." 5054 "Check that Tramp autoloads properly."
5017 (let ((default-directory (expand-file-name temporary-file-directory)) 5055 (let ((default-directory (expand-file-name temporary-file-directory))
5018 (code 5056 (code
@@ -5030,7 +5068,7 @@ process sentinels. They shall not disturb each other."
5030 (mapconcat 'shell-quote-argument load-path " -L ") 5068 (mapconcat 'shell-quote-argument load-path " -L ")
5031 (shell-quote-argument code))))))) 5069 (shell-quote-argument code)))))))
5032 5070
5033(ert-deftest tramp-test42-delay-load () 5071(ert-deftest tramp-test43-delay-load ()
5034 "Check that Tramp is loaded lazily, only when needed." 5072 "Check that Tramp is loaded lazily, only when needed."
5035 ;; The autoloaded Tramp objects are different since Emacs 26.1. We 5073 ;; The autoloaded Tramp objects are different since Emacs 26.1. We
5036 ;; cannot test older Emacsen, therefore. 5074 ;; cannot test older Emacsen, therefore.
@@ -5063,7 +5101,7 @@ process sentinels. They shall not disturb each other."
5063 (mapconcat 'shell-quote-argument load-path " -L ") 5101 (mapconcat 'shell-quote-argument load-path " -L ")
5064 (shell-quote-argument (format code tm))))))))) 5102 (shell-quote-argument (format code tm)))))))))
5065 5103
5066(ert-deftest tramp-test42-recursive-load () 5104(ert-deftest tramp-test43-recursive-load ()
5067 "Check that Tramp does not fail due to recursive load." 5105 "Check that Tramp does not fail due to recursive load."
5068 (skip-unless (tramp--test-enabled)) 5106 (skip-unless (tramp--test-enabled))
5069 5107
@@ -5087,7 +5125,7 @@ process sentinels. They shall not disturb each other."
5087 (mapconcat 'shell-quote-argument load-path " -L ") 5125 (mapconcat 'shell-quote-argument load-path " -L ")
5088 (shell-quote-argument code)))))))) 5126 (shell-quote-argument code))))))))
5089 5127
5090(ert-deftest tramp-test42-remote-load-path () 5128(ert-deftest tramp-test43-remote-load-path ()
5091 "Check that Tramp autoloads its packages with remote `load-path'." 5129 "Check that Tramp autoloads its packages with remote `load-path'."
5092 ;; The autoloaded Tramp objects are different since Emacs 26.1. We 5130 ;; The autoloaded Tramp objects are different since Emacs 26.1. We
5093 ;; cannot test older Emacsen, therefore. 5131 ;; cannot test older Emacsen, therefore.
@@ -5115,7 +5153,7 @@ process sentinels. They shall not disturb each other."
5115 (mapconcat 'shell-quote-argument load-path " -L ") 5153 (mapconcat 'shell-quote-argument load-path " -L ")
5116 (shell-quote-argument code))))))) 5154 (shell-quote-argument code)))))))
5117 5155
5118(ert-deftest tramp-test43-unload () 5156(ert-deftest tramp-test44-unload ()
5119 "Check that Tramp and its subpackages unload completely. 5157 "Check that Tramp and its subpackages unload completely.
5120Since it unloads Tramp, it shall be the last test to run." 5158Since it unloads Tramp, it shall be the last test to run."
5121 :tags '(:expensive-test) 5159 :tags '(:expensive-test)
@@ -5176,14 +5214,14 @@ Since it unloads Tramp, it shall be the last test to run."
5176;; * file-name-case-insensitive-p 5214;; * file-name-case-insensitive-p
5177 5215
5178;; * Work on skipped tests. Make a comment, when it is impossible. 5216;; * Work on skipped tests. Make a comment, when it is impossible.
5179;; * Revisit expensive tests, once problems in tramp-error are solved. 5217;; * Revisit expensive tests, once problems in `tramp-error' are solved.
5180;; * Fix `tramp-test05-expand-file-name-relative' in `expand-file-name'. 5218;; * Fix `tramp-test05-expand-file-name-relative' in `expand-file-name'.
5181;; * Fix `tramp-test06-directory-file-name' for `ftp'. 5219;; * Fix `tramp-test06-directory-file-name' for `ftp'.
5182;; * Investigate, why `tramp-test11-copy-file' and `tramp-test12-rename-file' 5220;; * Investigate, why `tramp-test11-copy-file' and `tramp-test12-rename-file'
5183;; do not work properly for `owncloud'. 5221;; do not work properly for `owncloud'.
5184;; * Fix `tramp-test29-start-file-process' on MS Windows (`process-send-eof'?). 5222;; * Fix `tramp-test29-start-file-process' on MS Windows (`process-send-eof'?).
5185;; * Fix `tramp-test30-interrupt-process', timeout doesn't work reliably. 5223;; * Fix `tramp-test30-interrupt-process', timeout doesn't work reliably.
5186;; * Fix Bug#16928 in `tramp-test41-asynchronous-requests'. 5224;; * Fix Bug#16928 in `tramp-test42-asynchronous-requests'.
5187 5225
5188(provide 'tramp-tests) 5226(provide 'tramp-tests)
5189;;; tramp-tests.el ends here 5227;;; tramp-tests.el ends here