aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2016-12-15 09:37:35 +0100
committerMichael Albinus2016-12-15 09:37:35 +0100
commitacbe32abddd9740acd756419f068cb4bc345567c (patch)
tree12beb617f5b52ba9523f5a734ec34e6288a3fa8b
parentd381db25a201fa67b7e274a758d6a7c2c350067e (diff)
downloademacs-acbe32abddd9740acd756419f068cb4bc345567c.tar.gz
emacs-acbe32abddd9740acd756419f068cb4bc345567c.zip
Check in tramp-tests.el, that environment variables are set correctly
* test/lisp/net/tramp-tests.el (tramp--test-check-files): Check also, that environment variables are set correctly.
-rw-r--r--test/lisp/net/tramp-tests.el29
1 files changed, 28 insertions, 1 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index e80af422244..893dc543f3e 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -2283,7 +2283,34 @@ Several special characters do not work properly there."
2283 (delete-file file2) 2283 (delete-file file2)
2284 (should-not (file-exists-p file2)) 2284 (should-not (file-exists-p file2))
2285 (delete-directory file1) 2285 (delete-directory file1)
2286 (should-not (file-exists-p file1))))) 2286 (should-not (file-exists-p file1))))
2287
2288 ;; Check, that environment variables are set correctly.
2289 (when (and tramp--test-expensive-test (tramp--test-sh-p))
2290 (dolist (elt files)
2291 ;; Tramp does not support environment variables with
2292 ;; leading or trailing spaces. It also does not
2293 ;; support the tab character.
2294 (setq elt (replace-regexp-in-string "\t" " " elt)
2295 elt (replace-regexp-in-string "^\\s-+\\|\\s-+$" "" elt))
2296 (let* ((default-directory tramp-test-temporary-file-directory)
2297 (shell-file-name "/bin/sh")
2298 (envvar
2299 (concat "VAR_" (upcase (md5 (current-time-string)))))
2300 (tramp-remote-process-environment
2301 (cons
2302 (format "%s=%s" envvar elt)
2303 tramp-remote-process-environment)))
2304 ;; We force a reconnect, in order to have a clean
2305 ;; environment.
2306 (tramp-cleanup-connection
2307 (tramp-dissect-file-name tramp-test-temporary-file-directory)
2308 'keep-debug 'keep-password)
2309 (should
2310 (string-equal
2311 elt
2312 (shell-command-to-string
2313 (format "echo -n $%s" envvar))))))))
2287 2314
2288 ;; Cleanup. 2315 ;; Cleanup.
2289 (ignore-errors (delete-directory tmp-name1 'recursive)) 2316 (ignore-errors (delete-directory tmp-name1 'recursive))