summaryrefslogtreecommitdiff
path: root/test/lisp/net/secrets-tests.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2018-04-23 10:16:06 +0200
committerMichael Albinus <michael.albinus@gmx.de>2018-04-23 10:16:06 +0200
commit0ecc10a7771bf1f62d15b2e6c747bee9f7a557ff (patch)
tree7547eb4f8b8282b88d811189b26fa6dc42d06d77 /test/lisp/net/secrets-tests.el
parente7044d294c1b1779b3124b27ba0f09b22b64df20 (diff)
downloademacs-0ecc10a7771bf1f62d15b2e6c747bee9f7a557ff.tar.gz
emacs-0ecc10a7771bf1f62d15b2e6c747bee9f7a557ff.tar.bz2
emacs-0ecc10a7771bf1f62d15b2e6c747bee9f7a557ff.zip
Let Tramp save passwords
* lisp/auth-source.el (auth-source-secrets-saver): New defun. (auth-source-secrets-create): Use it. * lisp/net/secrets.el (secrets-struct-secret-content-type): (secrets-create-item): Do not hard-code :xdg:schema. * lisp/net/tramp.el (tramp-password-save-function): New defvar. (tramp-read-passwd): Set it properly. (tramp-process-actions): * lisp/net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection): Save password. * lisp/net/tramp-cmds.el (tramp-bug): Don't report `tramp-password-save-function'. * test/lisp/net/secrets-tests.el (secrets-test03-items): Extend test with another :xdg:schema.
Diffstat (limited to 'test/lisp/net/secrets-tests.el')
-rw-r--r--test/lisp/net/secrets-tests.el15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/lisp/net/secrets-tests.el b/test/lisp/net/secrets-tests.el
index dc9c7f1004a..23512d48ee5 100644
--- a/test/lisp/net/secrets-tests.el
+++ b/test/lisp/net/secrets-tests.el
@@ -169,9 +169,16 @@
(should
(equal
(secrets-get-attributes "session" "bar")
- '((:host . "remote-host") (:user . "joe")
- (:method . "sudo")
- (:xdg:schema . "org.freedesktop.Secret.Generic"))))
+ '((:xdg:schema . "org.freedesktop.Secret.Generic")
+ (:host . "remote-host") (:user . "joe") (:method . "sudo"))))
+
+ ;; Create an item with another schema.
+ (secrets-create-item
+ "session" "baz" "secret" :xdg:schema "org.gnu.Emacs.foo")
+ (should
+ (equal
+ (secrets-get-attributes "session" "baz")
+ '((:xdg:schema . "org.gnu.Emacs.foo"))))
;; Delete them.
(dolist (item (secrets-list-items "session"))
@@ -206,6 +213,8 @@
;; Search the items.
(should-not (secrets-search-items "session" :user "john"))
+ (should-not
+ (secrets-search-items "session" :xdg:schema "org.gnu.Emacs.foo"))
(should
(equal
(sort (secrets-search-items "session" :user "joe") 'string-lessp)