aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus2017-05-24 16:17:59 +0200
committerMichael Albinus2017-05-24 16:17:59 +0200
commitac36012dc2e751788861b37e77f99d66c4da352a (patch)
tree2ee9a52b213929f6bfe75db7eed883d582f7e217 /test
parentdca22e86e02d16a31128c163925b13404f777c0f (diff)
downloademacs-ac36012dc2e751788861b37e77f99d66c4da352a.tar.gz
emacs-ac36012dc2e751788861b37e77f99d66c4da352a.zip
Adapt tramp-tests.el according to new defstruct
* test/lisp/net/tramp-tests.el (tramp-test03-file-name-defaults): Fix test according to new defstruct. (tramp-test29-environment-variables-and-port-numbers): Expect it now as passed. Cleanup at the end.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/tramp-tests.el44
1 files changed, 23 insertions, 21 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 0106807a9ac..7a12aae1bf2 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -1510,7 +1510,7 @@ handled properly. BODY shall not contain a timeout."
1510(ert-deftest tramp-test03-file-name-defaults () 1510(ert-deftest tramp-test03-file-name-defaults ()
1511 "Check default values for some methods." 1511 "Check default values for some methods."
1512 ;; Default values in tramp-adb.el. 1512 ;; Default values in tramp-adb.el.
1513 (should (string-equal (file-remote-p "/adb::" 'host) "")) 1513 (should (string-equal (file-remote-p "/adb::" 'host) nil))
1514 ;; Default values in tramp-ftp.el. 1514 ;; Default values in tramp-ftp.el.
1515 (should (string-equal (file-remote-p "/-:ftp.host:" 'method) "ftp")) 1515 (should (string-equal (file-remote-p "/-:ftp.host:" 'method) "ftp"))
1516 (dolist (u '("ftp" "anonymous")) 1516 (dolist (u '("ftp" "anonymous"))
@@ -1529,7 +1529,6 @@ handled properly. BODY shall not contain a timeout."
1529 (should 1529 (should
1530 (string-equal (file-remote-p (format "/%s::" m) 'user) (user-login-name)))) 1530 (string-equal (file-remote-p (format "/%s::" m) 'user) (user-login-name))))
1531 ;; Default values in tramp-smb.el. 1531 ;; Default values in tramp-smb.el.
1532 (should (string-equal (file-remote-p "/-:user%domain@host:" 'method) "smb"))
1533 (should (string-equal (file-remote-p "/smb::" 'user) nil))) 1532 (should (string-equal (file-remote-p "/smb::" 'user) nil)))
1534 1533
1535(ert-deftest tramp-test04-substitute-in-file-name () 1534(ert-deftest tramp-test04-substitute-in-file-name ()
@@ -2926,8 +2925,6 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
2926;; This test is inspired by Bug#27009. 2925;; This test is inspired by Bug#27009.
2927(ert-deftest tramp-test29-environment-variables-and-port-numbers () 2926(ert-deftest tramp-test29-environment-variables-and-port-numbers ()
2928 "Check that two connections with separate ports are different." 2927 "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)) 2928 (skip-unless (tramp--test-enabled))
2932 ;; We test it only for the mock-up connection; otherwise there might 2929 ;; We test it only for the mock-up connection; otherwise there might
2933 ;; be problems with the used ports. 2930 ;; be problems with the used ports.
@@ -2938,26 +2935,31 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
2938 "mock" (file-remote-p tramp-test-temporary-file-directory 'method)))) 2935 "mock" (file-remote-p tramp-test-temporary-file-directory 'method))))
2939 2936
2940 ;; We force a reconnect, in order to have a clean environment. 2937 ;; We force a reconnect, in order to have a clean environment.
2941 (dolist (dir 2938 (dolist (dir `(,tramp-test-temporary-file-directory
2942 `(,tramp-test-temporary-file-directory 2939 "/mock:localhost#11111:" "/mock:localhost#22222:"))
2943 "/mock:localhost#11111:" "/mock:localhost#22222:"))
2944 (tramp-cleanup-connection 2940 (tramp-cleanup-connection
2945 (tramp-dissect-file-name dir) 'keep-debug 'keep-password)) 2941 (tramp-dissect-file-name dir) 'keep-debug 'keep-password))
2946 2942
2947 (dolist (port '(11111 22222)) 2943 (unwind-protect
2948 (let* ((default-directory 2944 (dolist (port '(11111 22222))
2949 (format "/mock:localhost#%d:%s" port temporary-file-directory)) 2945 (let* ((default-directory
2950 (shell-file-name "/bin/sh") 2946 (format "/mock:localhost#%d:%s" port temporary-file-directory))
2951 (envvar (concat "VAR_" (upcase (md5 (current-time-string))))) 2947 (shell-file-name "/bin/sh")
2952 ;; We cannot use `process-environment', because this would 2948 (envvar (concat "VAR_" (upcase (md5 (current-time-string)))))
2953 ;; be applied in `process-file'. 2949 ;; We cannot use `process-environment', because this
2954 (tramp-remote-process-environment 2950 ;; would be applied in `process-file'.
2955 (cons 2951 (tramp-remote-process-environment
2956 (format "%s=%d" envvar port) tramp-remote-process-environment))) 2952 (cons
2957 (should 2953 (format "%s=%d" envvar port)
2958 (string-equal 2954 tramp-remote-process-environment)))
2959 (number-to-string port) 2955 (should
2960 (shell-command-to-string (format "echo -n $%s" envvar))))))) 2956 (string-equal
2957 (number-to-string port)
2958 (shell-command-to-string (format "echo -n $%s" envvar))))))
2959
2960 ;; Cleanup.
2961 (dolist (dir '("/mock:localhost#11111:" "/mock:localhost#22222:"))
2962 (tramp-cleanup-connection (tramp-dissect-file-name dir)))))
2961 2963
2962;; The functions were introduced in Emacs 26.1. 2964;; The functions were introduced in Emacs 26.1.
2963(ert-deftest tramp-test30-explicit-shell-file-name () 2965(ert-deftest tramp-test30-explicit-shell-file-name ()