summaryrefslogtreecommitdiffstats
path: root/tests/openpgp/quick-key-manipulation.scm
diff options
context:
space:
mode:
authorJustus Winter <justus@g10code.com>2017-03-21 16:21:49 +0100
committerJustus Winter <justus@g10code.com>2017-03-21 16:21:49 +0100
commitfde885bbc47a4bf14a8570ac62e68adc8cf47a6e (patch)
tree2c8ffdd0f641cabb33f5de244f5d9e3ff4b3af00 /tests/openpgp/quick-key-manipulation.scm
parenttests,w32: Use GetTempPath to get the path for temporary files. (diff)
downloadgnupg2-fde885bbc47a4bf14a8570ac62e68adc8cf47a6e.tar.xz
gnupg2-fde885bbc47a4bf14a8570ac62e68adc8cf47a6e.zip
tests: Test '--quick-set-primary-uid'.
* tests/openpgp/quick-key-manipulation.scm: Test '--quick-set-primary-uid'. Signed-off-by: Justus Winter <justus@g10code.com>
Diffstat (limited to '')
-rwxr-xr-xtests/openpgp/quick-key-manipulation.scm11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/openpgp/quick-key-manipulation.scm b/tests/openpgp/quick-key-manipulation.scm
index 9fd5b6bb0..85e56ca60 100755
--- a/tests/openpgp/quick-key-manipulation.scm
+++ b/tests/openpgp/quick-key-manipulation.scm
@@ -73,6 +73,17 @@
(assert (= 2 (count-uids-of-secret-key alpha)))
(assert (= 2 (count-uids-of-secret-key bravo)))
+(info "Checking that we can mark an user ID as primary.")
+(call-check `(,@gpg --quick-set-primary-uid ,(exact alpha) ,alpha))
+(call-check `(,@gpg --quick-set-primary-uid ,(exact alpha) ,bravo))
+;; XXX I don't know how to verify this. The keylisting does not seem
+;; to indicate the primary UID.
+
+(info "Checking that we get an error making non-existant user ID the primary one.")
+(catch '()
+ (call-check `(,@GPG --quick-set-primary-uid ,(exact alpha) ,charlie))
+ (error "Expected an error, but get none."))
+
(info "Checking that we can revoke a user ID...")
(call-check `(,@GPG --quick-revoke-uid ,(exact bravo) ,alpha))