From ca401f6fdc512f79d6015c1759a0e8e0c3de5c9a Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 10 Apr 2015 12:53:01 +0200 Subject: [PATCH] Handle symlinked test directory in tramp-tests.el * test/automated/tramp-tests.el (tramp-test18-file-attributes) (tramp--test-check-files): Use `file-truename' for directories. --- test/automated/tramp-tests.el | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/test/automated/tramp-tests.el b/test/automated/tramp-tests.el index cc2c753b9d5..5bb05dce19a 100644 --- a/test/automated/tramp-tests.el +++ b/test/automated/tramp-tests.el @@ -981,9 +981,14 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." This tests also `file-readable-p' and `file-regular-p'." (skip-unless (tramp--test-enabled)) - (let ((tmp-name1 (tramp--test-make-temp-name)) - (tmp-name2 (tramp--test-make-temp-name)) - attr) + ;; We must use `file-truename' for the temporary directory, because + ;; it could be located on a symlinked directory. This would let the + ;; test fail. + (let* ((tramp-test-temporary-file-directory + (file-truename tramp-test-temporary-file-directory)) + (tmp-name1 (tramp--test-make-temp-name)) + (tmp-name2 (tramp--test-make-temp-name)) + attr) (unwind-protect (progn (write-region "foo" nil tmp-name1) @@ -1535,9 +1540,14 @@ This requires restrictions of file name syntax." (defun tramp--test-check-files (&rest files) "Run a simple but comprehensive test over every file in FILES." - (let ((tmp-name1 (tramp--test-make-temp-name)) - (tmp-name2 (tramp--test-make-temp-name 'local)) - (files (delq nil files))) + ;; We must use `file-truename' for the temporary directory, because + ;; it could be located on a symlinked directory. This would let the + ;; test fail. + (let* ((tramp-test-temporary-file-directory + (file-truename tramp-test-temporary-file-directory)) + (tmp-name1 (tramp--test-make-temp-name)) + (tmp-name2 (tramp--test-make-temp-name 'local)) + (files (delq nil files))) (unwind-protect (progn (make-directory tmp-name1) -- 2.39.2