diff options
| author | Michael Albinus | 2017-05-23 09:25:03 +0200 |
|---|---|---|
| committer | Michael Albinus | 2017-05-23 09:25:03 +0200 |
| commit | 107e60f49db71f1869848f0f0ce5ea7dd057366c (patch) | |
| tree | 80cd579d35f0d79d3ab00c0324415c731ba4778c /test | |
| parent | ad2f52a14312b1b33f235103189b033b7ed87ddd (diff) | |
| download | emacs-107e60f49db71f1869848f0f0ce5ea7dd057366c.tar.gz emacs-107e60f49db71f1869848f0f0ce5ea7dd057366c.zip | |
Add test for Bug#27009 in tramp-tests.el
* lisp/net/tramp-sh.el (tramp-compute-multi-hops):
Check `tramp-file-name-real-host' for being a local host.
* lisp/net/tramp.el (tramp-postfix-host-regexp): Fix docstring.
* test/lisp/net/tramp-tests.el (tramp-test-temporary-file-directory):
Declare default host for mock method.
(tramp-test29-environment-variables-and-port-numbers): New test.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 49c32dbaaf2..0106807a9ac 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -67,6 +67,9 @@ | |||
| 67 | (tramp-remote-shell "/bin/sh") | 67 | (tramp-remote-shell "/bin/sh") |
| 68 | (tramp-remote-shell-args ("-c")) | 68 | (tramp-remote-shell-args ("-c")) |
| 69 | (tramp-connection-timeout 10))) | 69 | (tramp-connection-timeout 10))) |
| 70 | (add-to-list | ||
| 71 | 'tramp-default-host-alist | ||
| 72 | `("\\`mock\\'" nil ,(system-name))) | ||
| 70 | (format "/mock::%s" temporary-file-directory))) | 73 | (format "/mock::%s" temporary-file-directory))) |
| 71 | "Temporary directory for Tramp tests.") | 74 | "Temporary directory for Tramp tests.") |
| 72 | 75 | ||
| @@ -2920,6 +2923,42 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 2920 | (regexp-quote envvar) | 2923 | (regexp-quote envvar) |
| 2921 | (funcall this-shell-command-to-string "set"))))))))) | 2924 | (funcall this-shell-command-to-string "set"))))))))) |
| 2922 | 2925 | ||
| 2926 | ;; This test is inspired by Bug#27009. | ||
| 2927 | (ert-deftest tramp-test29-environment-variables-and-port-numbers () | ||
| 2928 | "Check that two connections with separate ports are different." | ||
| 2929 | ;; Mark as failed until bug has been fixed. | ||
| 2930 | :expected-result :failed | ||
| 2931 | (skip-unless (tramp--test-enabled)) | ||
| 2932 | ;; We test it only for the mock-up connection; otherwise there might | ||
| 2933 | ;; be problems with the used ports. | ||
| 2934 | (skip-unless | ||
| 2935 | (and | ||
| 2936 | (eq tramp-syntax 'default) | ||
| 2937 | (string-equal | ||
| 2938 | "mock" (file-remote-p tramp-test-temporary-file-directory 'method)))) | ||
| 2939 | |||
| 2940 | ;; We force a reconnect, in order to have a clean environment. | ||
| 2941 | (dolist (dir | ||
| 2942 | `(,tramp-test-temporary-file-directory | ||
| 2943 | "/mock:localhost#11111:" "/mock:localhost#22222:")) | ||
| 2944 | (tramp-cleanup-connection | ||
| 2945 | (tramp-dissect-file-name dir) 'keep-debug 'keep-password)) | ||
| 2946 | |||
| 2947 | (dolist (port '(11111 22222)) | ||
| 2948 | (let* ((default-directory | ||
| 2949 | (format "/mock:localhost#%d:%s" port temporary-file-directory)) | ||
| 2950 | (shell-file-name "/bin/sh") | ||
| 2951 | (envvar (concat "VAR_" (upcase (md5 (current-time-string))))) | ||
| 2952 | ;; We cannot use `process-environment', because this would | ||
| 2953 | ;; be applied in `process-file'. | ||
| 2954 | (tramp-remote-process-environment | ||
| 2955 | (cons | ||
| 2956 | (format "%s=%d" envvar port) tramp-remote-process-environment))) | ||
| 2957 | (should | ||
| 2958 | (string-equal | ||
| 2959 | (number-to-string port) | ||
| 2960 | (shell-command-to-string (format "echo -n $%s" envvar))))))) | ||
| 2961 | |||
| 2923 | ;; The functions were introduced in Emacs 26.1. | 2962 | ;; The functions were introduced in Emacs 26.1. |
| 2924 | (ert-deftest tramp-test30-explicit-shell-file-name () | 2963 | (ert-deftest tramp-test30-explicit-shell-file-name () |
| 2925 | "Check that connection-local `explicit-shell-file-name' is set." | 2964 | "Check that connection-local `explicit-shell-file-name' is set." |
| @@ -3766,6 +3805,8 @@ Since it unloads Tramp, it shall be the last test to run." | |||
| 3766 | ;; * Fix `tramp-test05-expand-file-name-relative' in `expand-file-name'. | 3805 | ;; * Fix `tramp-test05-expand-file-name-relative' in `expand-file-name'. |
| 3767 | ;; * Fix `tramp-test06-directory-file-name' for `ftp'. | 3806 | ;; * Fix `tramp-test06-directory-file-name' for `ftp'. |
| 3768 | ;; * Fix `tramp-test27-start-file-process' on MS Windows (`process-send-eof'?). | 3807 | ;; * Fix `tramp-test27-start-file-process' on MS Windows (`process-send-eof'?). |
| 3808 | ;; * Fix Bug#27009. Set expected error of | ||
| 3809 | ;; `tramp-test29-environment-variables-and-port-numbers'. | ||
| 3769 | ;; * Fix Bug#16928. Set expected error of `tramp-test36-asynchronous-requests'. | 3810 | ;; * Fix Bug#16928. Set expected error of `tramp-test36-asynchronous-requests'. |
| 3770 | ;; * Fix `tramp-test38-unload' (Not all symbols are unbound). Set | 3811 | ;; * Fix `tramp-test38-unload' (Not all symbols are unbound). Set |
| 3771 | ;; expected error. | 3812 | ;; expected error. |