summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2018-12-06 15:25:22 +0100
committerMichael Albinus <michael.albinus@gmx.de>2018-12-06 15:25:22 +0100
commit8f3fde3884d818eb2eef39f8295c5884bc371cc4 (patch)
tree4d07b579f77263a2f7f04bd7b12f318d87a84ae3 /test
parent8e8b8115386570ce186eea349ae937dbccbd61ed (diff)
downloademacs-8f3fde3884d818eb2eef39f8295c5884bc371cc4.tar.gz
Make stronger tests for Tramp multi hops
* lisp/net/tramp.el (tramp-dissect-file-name, tramp-dissect-hop-name): Check, that method is capable of multi hops. * test/lisp/net/tramp-tests.el (tramp-test02-file-name-dissect) (tramp-test02-file-name-dissect-simplified) (tramp-test02-file-name-dissect-separate): Suppress check for multihops. (tramp-test03-file-name-method-rules): Check for error if multi hops cannot be applied.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/tramp-tests.el21
1 files changed, 20 insertions, 1 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 4016ece94d3..15a120704eb 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -399,7 +399,10 @@ handled properly. BODY shall not contain a timeout."
(tramp-default-host "default-host")
tramp-default-method-alist
tramp-default-user-alist
- tramp-default-host-alist)
+ tramp-default-host-alist
+ ;; Suppress check for multihops.
+ (tramp-cache-data (make-hash-table :test 'equal))
+ (tramp-connection-properties '((nil "login-program" t))))
;; Expand `tramp-default-user' and `tramp-default-host'.
(should (string-equal
(file-remote-p "/method::")
@@ -836,6 +839,9 @@ handled properly. BODY shall not contain a timeout."
(tramp-default-host "default-host")
tramp-default-user-alist
tramp-default-host-alist
+ ;; Suppress check for multihops.
+ (tramp-cache-data (make-hash-table :test 'equal))
+ (tramp-connection-properties '((nil "login-program" t)))
(syntax tramp-syntax))
(unwind-protect
(progn
@@ -1157,6 +1163,9 @@ handled properly. BODY shall not contain a timeout."
tramp-default-method-alist
tramp-default-user-alist
tramp-default-host-alist
+ ;; Suppress check for multihops.
+ (tramp-cache-data (make-hash-table :test 'equal))
+ (tramp-connection-properties '((nil "login-program" t)))
(syntax tramp-syntax))
(unwind-protect
(progn
@@ -1851,6 +1860,16 @@ handled properly. BODY shall not contain a timeout."
(ert-deftest tramp-test03-file-name-method-rules ()
"Check file name rules for some methods."
(skip-unless (tramp--test-enabled))
+ ;; `user-error' has appeared in Emacs 24.3.
+ (skip-unless (fboundp 'user-error))
+
+ ;; Multi hops are allowed for inline methods only.
+ (should-error
+ (file-remote-p "/ssh:user1@host1|method:user2@host2:/path/to/file")
+ :type 'user-error)
+ (should-error
+ (file-remote-p "/method:user1@host1|ssh:user2@host2:/path/to/file")
+ :type 'user-error)
;; Samba does not support file names with periods followed by
;; spaces, and trailing periods or spaces.