password-store

Simple password manager using gpg and ordinary unix directories
git clone https://git.zx2c4.com/password-store
Log | Files | Refs | README | LICENSE

commit 57e3fe63c00241f1a2abef4d7023ab92d680c9ce
parent 32c88c4af59b88b331a223d93178ab33d52dbb32
Author: Jason A. Donenfeld <Jason@zx2c4.com>
Date:   Wed, 23 Apr 2014 17:28:31 +0200

Support git tests

Diffstat:
Mtests/setup.sh | 6++++++
Mtests/t0300-reencryption.sh | 10++++++++--
2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/tests/setup.sh b/tests/setup.sh @@ -18,6 +18,12 @@ if [[ ! -d $PASSWORD_STORE_DIR ]]; then exit 1 fi +export GIT_DIR="$PASSWORD_STORE_DIR/.git" +export GIT_WORK_TREE="$PASSWORD_STORE_DIR" +git config --global user.email "Pass-Automated-Testing-Suite@zx2c4.com" +git config --global user.name "Pass Automated Testing Suite" + + PASS="$TEST_HOME/../src/password-store.sh" if [[ ! -e $PASS ]]; then echo "Could not find password-store.sh" diff --git a/tests/t0300-reencryption.sh b/tests/t0300-reencryption.sh @@ -20,8 +20,11 @@ gpg_keys_from_group() { canonicalize_gpg_keys "${keys[@]}" } +test_expect_success 'Setup initial key and git' ' + $PASS init $KEY1 && $PASS git init +' + test_expect_success 'Root key encryption' ' - $PASS init $KEY1 && $PASS insert -e folder/cred1 <<<"$INITIAL_PASSWORD" && [[ $(canonicalize_gpg_keys "$KEY1") == "$(gpg_keys_from_encrypted_file "$PASSWORD_STORE_DIR/folder/cred1.gpg")" ]] ' @@ -89,5 +92,8 @@ test_expect_success 'Password lived through all transformations' ' [[ $($PASS show anotherfolder2/anotherfolder/cred1) == "$INITIAL_PASSWORD" ]] ' -test_done +test_expect_success 'Git picked up all changes throughout' ' + [[ -z $(git status --porcelain 2>&1) ]] +' +test_done