summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Pujol <alexandre@pujol.io>2017-05-01 20:22:36 (GMT)
committer Alexandre Pujol <alexandre@pujol.io>2017-05-01 20:22:36 (GMT)
commit8aaa8e17255779ff500d4937850b0206c18dd4e7 (patch)
tree04177ee2f352fb9653aad01df93ff723b152453e
parent408977a35187fbe51e3af9782de5560826602a25 (diff)
Add setkey tests
-rw-r--r--extras/test/90_setkey.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/extras/test/90_setkey.sh b/extras/test/90_setkey.sh
new file mode 100644
index 0000000..d2d0cc4
--- /dev/null
+++ b/extras/test/90_setkey.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env zsh
+
+export test_description="Testing set key"
+
+source ./setup
+
+test_export "test" # Using already generated tomb
+test_expect_success 'Testing set key' '
+ tt forge -k $tomb_key_new --tomb-pwd $DUMMYPASS \
+ --ignore-swap --unsafe --use-urandom --force &&
+ tt setkey -k $tomb_key_new $tomb_key $tomb \
+ --unsafe --tomb-pwd $DUMMYPASS --tomb-old-pwd $DUMMYPASS &&
+ tt open -k $tomb_key_new $tomb \
+ --unsafe --tomb-pwd $DUMMYPASS &&
+ print $DUMMYPASS \
+ | gpg --batch --passphrase-fd 0 --no-tty --no-options -d $tomb_key_new \
+ | hexdump -C &&
+ tt_close
+ '
+
+test_export "recipient" # Using already generated tomb
+test_expect_success 'Testing tomb with GnuPG keys: setkey' '
+ tt forge $tomb_key_new -g -r $KEY2 --ignore-swap --unsafe --use-urandom &&
+ tt setkey -k $tomb_key_new $tomb_key $tomb -g -r $KEY2 &&
+ tt open -k $tomb_key_new $tomb -g &&
+ tt_close
+ '
+
+test_done