From 5d48eae5c3c8155a4f12ba443bec03deeb687c73 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 23 Apr 2014 05:40:11 +0200 Subject: tests: have multiple gpg keys available --- tests/gnupg/gpg.conf | 3 +++ tests/gnupg/pubring.gpg | Bin 1183 -> 5875 bytes tests/gnupg/secring.gpg | Bin 2485 -> 12385 bytes tests/gnupg/trustdb.gpg | Bin 1280 -> 1600 bytes tests/setup.sh | 13 +++++++++---- 5 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 tests/gnupg/gpg.conf diff --git a/tests/gnupg/gpg.conf b/tests/gnupg/gpg.conf new file mode 100644 index 0000000..60ece49 --- /dev/null +++ b/tests/gnupg/gpg.conf @@ -0,0 +1,3 @@ +group group1 = E4691410 D774A374 +group group2 = E4691410 +group big group = CF90C77B D774A374 EB7D54A8 E4691410 39E5020C diff --git a/tests/gnupg/pubring.gpg b/tests/gnupg/pubring.gpg index 23345ec..0573fd3 100644 Binary files a/tests/gnupg/pubring.gpg and b/tests/gnupg/pubring.gpg differ diff --git a/tests/gnupg/secring.gpg b/tests/gnupg/secring.gpg index 985744c..f72e9fd 100644 Binary files a/tests/gnupg/secring.gpg and b/tests/gnupg/secring.gpg differ diff --git a/tests/gnupg/trustdb.gpg b/tests/gnupg/trustdb.gpg index 8c259d3..cb5ec15 100644 Binary files a/tests/gnupg/trustdb.gpg and b/tests/gnupg/trustdb.gpg differ diff --git a/tests/setup.sh b/tests/setup.sh index e38c12f..930ec99 100755 --- a/tests/setup.sh +++ b/tests/setup.sh @@ -4,7 +4,7 @@ # $GNUPGHOME Full path to test GPG directory # $PASS Full path to password-store script to test # $GPG Name of gpg executable -# $PASSWORD_STORE_KEY GPG key id of testing key +# $PASSWORD_STORE_KEY{1..5} GPG key ids of testing keys # $PASSWORD_STORE_TEST_HOME This folder # @@ -29,7 +29,6 @@ fi # Note: the assumption is the test key is unencrypted. export GNUPGHOME="${PASSWORD_STORE_TEST_HOME}/gnupg/" chmod 700 "$GNUPGHOME" -export PASSWORD_STORE_KEY="3DEEA12D" # "Password-store Test Key" GPG="gpg" which gpg2 &>/dev/null && GPG="gpg2" @@ -38,6 +37,12 @@ which gpg2 &>/dev/null && GPG="gpg2" # We don't need a real agent. Hence: export GPG_AGENT_INFO=" " +export PASSWORD_STORE_KEY1="CF90C77B" # pass test key 1 +export PASSWORD_STORE_KEY2="D774A374" # pass test key 2 +export PASSWORD_STORE_KEY3="EB7D54A8" # pass test key 3 +export PASSWORD_STORE_KEY4="E4691410" # pass test key 4 +export PASSWORD_STORE_KEY5="39E5020C" # pass test key 5 + # pass_init() # # Initialize a password store, setting PASSWORD_STORE_DIR @@ -46,7 +51,7 @@ export GPG_AGENT_INFO=" " # Returns: Nothing, sets PASSWORD_STORE_DIR pass_init() { export PASSWORD_STORE_DIR="${SHARNESS_TRASH_DIRECTORY}/test-store/" - echo "Initializing test password store (${PASSWORD_STORE_DIR}) with key ${PASSWORD_STORE_KEY}" + echo "Initializing test password store (${PASSWORD_STORE_DIR}) with key ${PASSWORD_STORE_KEY1}" if [[ -d "${PASSWORD_STORE_DIR}" ]] ; then echo "Removing old store" @@ -57,7 +62,7 @@ pass_init() { fi fi - $PASS init ${PASSWORD_STORE_KEY} || return 1 + $PASS init ${PASSWORD_STORE_KEY1} || return 1 echo "Initialization of ${PASSWORD_STORE_DIR} complete." } -- cgit v1.2.3