summaryrefslogtreecommitdiff
path: root/test/lisp/net
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp/net')
-rw-r--r--test/lisp/net/secrets-tests.el6
-rw-r--r--test/lisp/net/tramp-archive-tests.el18
-rw-r--r--test/lisp/net/tramp-tests.el102
3 files changed, 77 insertions, 49 deletions
diff --git a/test/lisp/net/secrets-tests.el b/test/lisp/net/secrets-tests.el
index 9aa79dab0eb..de3ce731bec 100644
--- a/test/lisp/net/secrets-tests.el
+++ b/test/lisp/net/secrets-tests.el
@@ -92,7 +92,8 @@
(should (secrets-open-session))
;; There must be at least the collections "Login" and "session".
- (should (member "Login" (secrets-list-collections)))
+ (should (or (member "Login" (secrets-list-collections))
+ (member "login" (secrets-list-collections))))
(should (member "session" (secrets-list-collections)))
;; Create a random collection. This asks for a password
@@ -160,7 +161,8 @@
;; There shall be no items in the "session" collection.
(should-not (secrets-list-items "session"))
;; There shall be items in the "Login" collection.
- (should (secrets-list-items "Login"))
+ (should (or (secrets-list-items "Login")
+ (secrets-list-items "login")))
;; Create a new item.
(should (setq item-path (secrets-create-item "session" "foo" "secret")))
diff --git a/test/lisp/net/tramp-archive-tests.el b/test/lisp/net/tramp-archive-tests.el
index 0a8716be0d7..e7597864c6e 100644
--- a/test/lisp/net/tramp-archive-tests.el
+++ b/test/lisp/net/tramp-archive-tests.el
@@ -311,6 +311,7 @@ This checks also `file-name-as-directory', `file-name-directory',
(ert-deftest tramp-archive-test07-file-exists-p ()
"Check `file-exist-p', `write-region' and `delete-file'."
+ :tags '(:expensive-test)
(skip-unless tramp-archive-enabled)
(unwind-protect
@@ -333,6 +334,7 @@ This checks also `file-name-as-directory', `file-name-directory',
(ert-deftest tramp-archive-test08-file-local-copy ()
"Check `file-local-copy'."
+ :tags '(:expensive-test)
(skip-unless tramp-archive-enabled)
(let (tmp-name)
@@ -359,6 +361,7 @@ This checks also `file-name-as-directory', `file-name-directory',
(ert-deftest tramp-archive-test09-insert-file-contents ()
"Check `insert-file-contents'."
+ :tags '(:expensive-test)
(skip-unless tramp-archive-enabled)
(let ((tmp-name (expand-file-name "bar/bar" tramp-archive-test-archive)))
@@ -385,6 +388,7 @@ This checks also `file-name-as-directory', `file-name-directory',
(ert-deftest tramp-archive-test11-copy-file ()
"Check `copy-file'."
+ :tags '(:expensive-test)
(skip-unless tramp-archive-enabled)
;; Copy simple file.
@@ -450,6 +454,7 @@ This checks also `file-name-as-directory', `file-name-directory',
(ert-deftest tramp-archive-test15-copy-directory ()
"Check `copy-directory'."
+ :tags '(:expensive-test)
(skip-unless tramp-archive-enabled)
(let* ((tmp-name1 (expand-file-name "bar" tramp-archive-test-archive))
@@ -504,6 +509,7 @@ This checks also `file-name-as-directory', `file-name-directory',
(ert-deftest tramp-archive-test16-directory-files ()
"Check `directory-files'."
+ :tags '(:expensive-test)
(skip-unless tramp-archive-enabled)
(let ((tmp-name tramp-archive-test-archive)
@@ -527,6 +533,7 @@ This checks also `file-name-as-directory', `file-name-directory',
(ert-deftest tramp-archive-test17-insert-directory ()
"Check `insert-directory'."
+ :tags '(:expensive-test)
(skip-unless tramp-archive-enabled)
(let (;; We test for the summary line. Keyword "total" could be localized.
@@ -569,6 +576,7 @@ This checks also `file-name-as-directory', `file-name-directory',
(ert-deftest tramp-archive-test18-file-attributes ()
"Check `file-attributes'.
This tests also `file-readable-p' and `file-regular-p'."
+ :tags '(:expensive-test)
(skip-unless tramp-archive-enabled)
(let ((tmp-name1 (expand-file-name "foo.txt" tramp-archive-test-archive))
@@ -619,6 +627,7 @@ This tests also `file-readable-p' and `file-regular-p'."
(ert-deftest tramp-archive-test19-directory-files-and-attributes ()
"Check `directory-files-and-attributes'."
+ :tags '(:expensive-test)
(skip-unless tramp-archive-enabled)
(let ((tmp-name (expand-file-name "bar" tramp-archive-test-archive))
@@ -644,6 +653,7 @@ This tests also `file-readable-p' and `file-regular-p'."
(ert-deftest tramp-archive-test20-file-modes ()
"Check `file-modes'.
This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
+ :tags '(:expensive-test)
(skip-unless tramp-archive-enabled)
(let ((tmp-name1 (expand-file-name "foo.txt" tramp-archive-test-archive))
@@ -673,6 +683,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
(ert-deftest tramp-archive-test21-file-links ()
"Check `file-symlink-p' and `file-truename'"
+ :tags '(:expensive-test)
(skip-unless tramp-archive-enabled)
;; We must use `file-truename' for the file archive, because it
@@ -711,6 +722,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
(ert-deftest tramp-archive-test26-file-name-completion ()
"Check `file-name-completion' and `file-name-all-completions'."
+ :tags '(:expensive-test)
(skip-unless tramp-archive-enabled)
(let ((tmp-name tramp-archive-test-archive))
@@ -802,8 +814,9 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
(zerop (nth 1 fsi))
(zerop (nth 2 fsi))))))
-(ert-deftest tramp-archive-test43-auto-load ()
+(ert-deftest tramp-archive-test44-auto-load ()
"Check that `tramp-archive' autoloads properly."
+ :tags '(:expensive-test)
(skip-unless tramp-archive-enabled)
;; Autoloading tramp-archive works since Emacs 27.1.
(skip-unless (tramp-archive--test-emacs27-p))
@@ -832,8 +845,9 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
(mapconcat 'shell-quote-argument load-path " -L ")
(shell-quote-argument (format code file)))))))))
-(ert-deftest tramp-archive-test43-delay-load ()
+(ert-deftest tramp-archive-test44-delay-load ()
"Check that `tramp-archive' is loaded lazily, only when needed."
+ :tags '(:expensive-test)
(skip-unless tramp-archive-enabled)
;; Autoloading tramp-archive works since Emacs 27.1.
(skip-unless (tramp-archive--test-emacs27-p))
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 5c5eff8798d..293a0054560 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -2182,7 +2182,7 @@ This checks also `file-name-as-directory', `file-name-directory',
(unwind-protect
;; FIXME: This fails on my QNAP server, see
;; /share/Web/owncloud/data/owncloud.log
- (unless (tramp--test-owncloud-p)
+ (unless (tramp--test-nextcloud-p)
(write-region "foo" nil source)
(should (file-exists-p source))
(make-directory target)
@@ -2205,7 +2205,7 @@ This checks also `file-name-as-directory', `file-name-directory',
(unwind-protect
;; FIXME: This fails on my QNAP server, see
;; /share/Web/owncloud/data/owncloud.log
- (unless (and (tramp--test-owncloud-p)
+ (unless (and (tramp--test-nextcloud-p)
(or (not (file-remote-p source))
(not (file-remote-p target))))
(make-directory source)
@@ -2231,7 +2231,7 @@ This checks also `file-name-as-directory', `file-name-directory',
;; FIXME: This fails on my QNAP server, see
;; /share/Web/owncloud/data/owncloud.log
(unless
- (and (tramp--test-owncloud-p) (not (file-remote-p source)))
+ (and (tramp--test-nextcloud-p) (not (file-remote-p source)))
(make-directory source)
(should (file-directory-p source))
(write-region "foo" nil (expand-file-name "foo" source))
@@ -2320,7 +2320,7 @@ This checks also `file-name-as-directory', `file-name-directory',
(unwind-protect
;; FIXME: This fails on my QNAP server, see
;; /share/Web/owncloud/data/owncloud.log
- (unless (tramp--test-owncloud-p)
+ (unless (tramp--test-nextcloud-p)
(make-directory source)
(should (file-directory-p source))
(write-region "foo" nil (expand-file-name "foo" source))
@@ -2344,7 +2344,7 @@ This checks also `file-name-as-directory', `file-name-directory',
(unwind-protect
;; FIXME: This fails on my QNAP server, see
;; /share/Web/owncloud/data/owncloud.log
- (unless (tramp--test-owncloud-p)
+ (unless (tramp--test-nextcloud-p)
(make-directory source)
(should (file-directory-p source))
(write-region "foo" nil (expand-file-name "foo" source))
@@ -4427,10 +4427,10 @@ This does not support external Emacs calls."
(string-equal
"mock" (file-remote-p tramp-test-temporary-file-directory 'method)))
-(defun tramp--test-owncloud-p ()
- "Check, whether the owncloud method is used."
+(defun tramp--test-nextcloud-p ()
+ "Check, whether the nextcloud method is used."
(string-equal
- "owncloud" (file-remote-p tramp-test-temporary-file-directory 'method)))
+ "nextcloud" (file-remote-p tramp-test-temporary-file-directory 'method)))
(defun tramp--test-rsync-p ()
"Check, whether the rsync method is used.
@@ -5056,6 +5056,8 @@ process sentinels. They shall not disturb each other."
;; This test is inspired by Bug#29163.
(ert-deftest tramp-test43-auto-load ()
"Check that Tramp autoloads properly."
+ (skip-unless (tramp--test-enabled))
+
(let ((default-directory (expand-file-name temporary-file-directory))
(code
(format
@@ -5166,42 +5168,52 @@ Since it unloads Tramp, it shall be the last test to run."
;; cannot test older Emacsen, therefore.
(skip-unless (tramp--test-emacs26-p))
- (when (featurep 'tramp)
- (unload-feature 'tramp 'force)
- ;; No Tramp feature must be left.
- (should-not (featurep 'tramp))
- (should-not (all-completions "tramp" (delq 'tramp-tests features)))
- ;; `file-name-handler-alist' must be clean.
- (should-not (all-completions "tramp" (mapcar 'cdr file-name-handler-alist)))
- ;; There shouldn't be left a bound symbol, except buffer-local
- ;; variables, and autoload functions. We do not regard our test
- ;; symbols, and the Tramp unload hooks.
- (mapatoms
- (lambda (x)
- (and (or (and (boundp x) (null (local-variable-if-set-p x)))
- (and (functionp x) (null (autoloadp (symbol-function x)))))
- (string-match "^tramp" (symbol-name x))
- (not (string-match "^tramp--?test" (symbol-name x)))
- (not (string-match "unload-hook$" (symbol-name x)))
- (ert-fail (format "`%s' still bound" x)))))
- ;; The defstruct `tramp-file-name' and all its internal functions
- ;; shall be purged.
- (should-not (cl--find-class 'tramp-file-name))
- (mapatoms
- (lambda (x)
- (and (functionp x)
- (string-match "tramp-file-name" (symbol-name x))
- (ert-fail (format "Structure function `%s' still exists" x)))))
- ;; There shouldn't be left a hook function containing a Tramp
- ;; function. We do not regard the Tramp unload hooks.
- (mapatoms
- (lambda (x)
- (and (boundp x)
- (string-match "-\\(hook\\|function\\)s?$" (symbol-name x))
- (not (string-match "unload-hook$" (symbol-name x)))
- (consp (symbol-value x))
- (ignore-errors (all-completions "tramp" (symbol-value x)))
- (ert-fail (format "Hook `%s' still contains Tramp function" x)))))))
+ ;; We have autoloaded objects from tramp.el and tramp-archive.el.
+ ;; In order to remove them, we first need to load both packages.
+ (require 'tramp)
+ (require 'tramp-archive)
+ (should (featurep 'tramp))
+ (should (featurep 'tramp-archive))
+ ;; This unloads also tramp-archive.el and tramp-theme.el if needed.
+ (unload-feature 'tramp 'force)
+ ;; No Tramp feature must be left.
+ (should-not (featurep 'tramp))
+ (should-not (featurep 'tramp-archive))
+ (should-not (featurep 'tramp-theme))
+ (should-not
+ (all-completions
+ "tramp" (delq 'tramp-tests (delq 'tramp-archive-tests features))))
+ ;; `file-name-handler-alist' must be clean.
+ (should-not (all-completions "tramp" (mapcar 'cdr file-name-handler-alist)))
+ ;; There shouldn't be left a bound symbol, except buffer-local
+ ;; variables, and autoload functions. We do not regard our test
+ ;; symbols, and the Tramp unload hooks.
+ (mapatoms
+ (lambda (x)
+ (and (or (and (boundp x) (null (local-variable-if-set-p x)))
+ (and (functionp x) (null (autoloadp (symbol-function x)))))
+ (string-match "^tramp" (symbol-name x))
+ (not (string-match "^tramp\\(-archive\\)?--?test" (symbol-name x)))
+ (not (string-match "unload-hook$" (symbol-name x)))
+ (ert-fail (format "`%s' still bound" x)))))
+ ;; The defstruct `tramp-file-name' and all its internal functions
+ ;; shall be purged.
+ (should-not (cl--find-class 'tramp-file-name))
+ (mapatoms
+ (lambda (x)
+ (and (functionp x)
+ (string-match "tramp-file-name" (symbol-name x))
+ (ert-fail (format "Structure function `%s' still exists" x)))))
+ ;; There shouldn't be left a hook function containing a Tramp
+ ;; function. We do not regard the Tramp unload hooks.
+ (mapatoms
+ (lambda (x)
+ (and (boundp x)
+ (string-match "-\\(hook\\|function\\)s?$" (symbol-name x))
+ (not (string-match "unload-hook$" (symbol-name x)))
+ (consp (symbol-value x))
+ (ignore-errors (all-completions "tramp" (symbol-value x)))
+ (ert-fail (format "Hook `%s' still contains Tramp function" x))))))
(defun tramp-test-all (&optional interactive)
"Run all tests for \\[tramp]."
@@ -5222,7 +5234,7 @@ Since it unloads Tramp, it shall be the last test to run."
;; * Fix `tramp-test05-expand-file-name-relative' in `expand-file-name'.
;; * Fix `tramp-test06-directory-file-name' for `ftp'.
;; * Investigate, why `tramp-test11-copy-file' and `tramp-test12-rename-file'
-;; do not work properly for `owncloud'.
+;; do not work properly for `nextcloud'.
;; * Fix `tramp-test29-start-file-process' on MS Windows (`process-send-eof'?).
;; * Fix `tramp-test30-interrupt-process', timeout doesn't work reliably.
;; * Fix Bug#16928 in `tramp-test42-asynchronous-requests'.