password-store

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

t0010-generate-tests.sh (578B)


      1 #!/usr/bin/env bash
      2 
      3 test_description='Test generate'
      4 cd "$(dirname "$0")"
      5 . ./setup.sh
      6 
      7 test_expect_success 'Test "generate" command' '
      8 	"$PASS" init $KEY1 &&
      9 	"$PASS" generate cred 19 &&
     10 	[[ $("$PASS" show cred | wc -m) -eq 20 ]]
     11 '
     12 
     13 test_expect_success 'Test replacement of first line' '
     14 	"$PASS" insert -m cred2 <<<"$(printf "this is a big\\npassword\\nwith\\nmany\\nlines\\nin it bla bla")" &&
     15 	"$PASS" generate -i cred2 23 &&
     16 	[[ $("$PASS" show cred2) == "$(printf "%s\\npassword\\nwith\\nmany\\nlines\\nin it bla bla" "$("$PASS" show cred2 | head -n 1)")" ]]
     17 '
     18 
     19 test_done