Navigation Menu

Skip to content
This repository has been archived by the owner on Oct 25, 2018. It is now read-only.

Commit

Permalink
Extend the expiration of the test key whenever we need to use it. (fixes
Browse files Browse the repository at this point in the history
 #42)
  • Loading branch information
dashohoxha committed May 23, 2018
1 parent 64859be commit 82f7610
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
@@ -1 +1,5 @@
*.sw?
tests/gnupg/pubring.kbx
tests/gnupg/trustdb.gpg
tests/gnupg/tofu.db
tests/gnupg/pubring.kbx~
7 changes: 7 additions & 0 deletions tests/setup.sh
Expand Up @@ -67,3 +67,10 @@ setup_autopin() {
sed -i "$autopin" -e "/^PIN=/ c PIN='$pin'" &&
sed -i "$GNUPGHOME"/gpg-agent.conf -e "/^pinentry-program/ c pinentry-program \"$autopin\""
}

extend_test_key_expiration() {
local commands=";expire;1m;y;key 1;expire;1m;y;key 1;save"
commands=$(echo "$commands" | tr ';' "\n")
local homedir="$SHARNESS_TEST_DIRECTORY/gnupg"
echo -e "$commands" | gpg --homedir="$homedir" --no-tty --command-fd=0 --key-edit $KEY_ID 2>/dev/null
}
1 change: 1 addition & 0 deletions tests/t03-init.t
Expand Up @@ -2,6 +2,7 @@

test_description='Command: init'
source "$(dirname "$0")"/setup.sh
extend_test_key_expiration # make sure that the test key has not expired

test_expect_success 'egpg' '
[[ ! -d "$HOME/.egpg" ]] &&
Expand Down

0 comments on commit 82f7610

Please sign in to comment.