password-store

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

t0060-rm-tests.sh (615B)


      1 #!/usr/bin/env bash
      2 
      3 test_description='Test rm'
      4 cd "$(dirname "$0")"
      5 . ./setup.sh
      6 
      7 test_expect_success 'Test "rm" command' '
      8 	"$PASS" init $KEY1 &&
      9 	"$PASS" generate cred1 43 &&
     10 	"$PASS" rm cred1 &&
     11 	[[ ! -e $PASSWORD_STORE_DIR/cred1.gpg ]]
     12 '
     13 
     14 test_expect_success 'Test "rm" command with spaces' '
     15 	"$PASS" generate "hello i have spaces" 43 &&
     16 	[[ -e $PASSWORD_STORE_DIR/"hello i have spaces".gpg ]] &&
     17 	"$PASS" rm "hello i have spaces" &&
     18 	[[ ! -e $PASSWORD_STORE_DIR/"hello i have spaces".gpg ]]
     19 '
     20 
     21 test_expect_success 'Test "rm" of non-existent password' '
     22 	test_must_fail "$PASS" rm does-not-exist
     23 '
     24 
     25 test_done