mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-18 04:10:57 +01:00
last perl tests migrated to unittests.sh
This commit is contained in:
@@ -30,87 +30,87 @@ blake2=5baec1cad5bf54287028749d83f2bf3e3ed09f0ee38a233f35dbda1361c6a67fd824e17c8
|
||||
blake2auth=d7fff04bd63004f7a2ba914d9b2ccff22827230d3c546d97ebaa29cbe9fb2380b7948bc799486d512b4355c24f0cce423e746419098d4455af91898c4a06a5df
|
||||
key=9U3Dk2s
|
||||
|
||||
. keys.cfg
|
||||
. ./keys.cfg
|
||||
|
||||
|
||||
check-dependencies-pcp () {
|
||||
check_dependencies_pcp () {
|
||||
cmd="ls $pcp"
|
||||
expect="/pcp/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-streams-8 () {
|
||||
check_streams_8 () {
|
||||
md5=`./md5 ../COPYING`
|
||||
cmd="./pipetest 8 e < ../COPYING | ./pipetest 8 d | ./md5"
|
||||
expect="/$md5/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-streams-16 () {
|
||||
check_streams_16 () {
|
||||
md5=`./md5 ../COPYING`
|
||||
cmd="./pipetest 16 e < ../COPYING | ./pipetest 16 d | ./md5"
|
||||
expect="/$md5/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-streams-32 () {
|
||||
check_streams_32 () {
|
||||
md5=`./md5 ../COPYING`
|
||||
cmd="./pipetest 32 e < ../COPYING | ./pipetest 32 d | ./md5"
|
||||
expect="/$md5/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-streams-64 () {
|
||||
check_streams_64 () {
|
||||
md5=`./md5 ../COPYING`
|
||||
cmd="./pipetest 64 e < ../COPYING | ./pipetest 64 d | ./md5"
|
||||
expect="/$md5/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-z85-1-compliant () {
|
||||
check_z85_1_compliant () {
|
||||
cmd="./decodertest 1"
|
||||
expect="/ok/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-z85-2-compliant-no-newlines () {
|
||||
check_z85_2_compliant_no_newlines () {
|
||||
cmd="./decodertest 2"
|
||||
expect="/ok/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-z85-3-compliant-no-begin-header () {
|
||||
check_z85_3_compliant_no_begin_header () {
|
||||
cmd="./decodertest 3"
|
||||
expect="/ok/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-z85-4-uncompliant-empty-comment () {
|
||||
check_z85_4_uncompliant_empty_comment () {
|
||||
cmd="./decodertest 4"
|
||||
expect="/ok/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-z85-5-uncompliant-missing-char () {
|
||||
check_z85_5_uncompliant_missing_char () {
|
||||
cmd="./decodertest 5"
|
||||
expect="/ok/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-show-help () {
|
||||
check_show_help () {
|
||||
cmd="$pcp -h"
|
||||
expect="/export/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-if-fail-without-vault () {
|
||||
check_if_fail_without_vault () {
|
||||
rm -f $vault
|
||||
cmd="$pcp -V $vault -l"
|
||||
expect="/doesn.t contain any keys so far/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-generate-secret-key () {
|
||||
check_generate_secret_key () {
|
||||
cmd="$pcp -V $vault -k -x $passwd"
|
||||
input=$(cat <<'EOF'
|
||||
Dexter Morgan
|
||||
@@ -121,7 +121,7 @@ EOF
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-fail-entropy-generate-secret-key () {
|
||||
check_fail_entropy_generate_secret_key () {
|
||||
cmd="$pcp -V $vault -k -x password"
|
||||
input=$(cat <<'EOF'
|
||||
Dexter Morgan
|
||||
@@ -133,62 +133,62 @@ EOF
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-if-vault-contains-secret () {
|
||||
check_if_vault_contains_secret () {
|
||||
cmd="$pcp -V $vault -l"
|
||||
expect="/Dexter Morgan/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-secret-key-info () {
|
||||
check_secret_key_info () {
|
||||
cmd="$pcp -V $vault -l | tail -1 | cut -d ' ' -f 1 | xargs $pcp -V $vault -t -i"
|
||||
expect="/Serial Number/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-export-public-key () {
|
||||
check_export_public_key () {
|
||||
cmd="$pcp -V $vault -l | tail -1 | cut -d ' ' -f 1 | xargs $pcp -V $vault -p -x $passwd -z -i "
|
||||
expect="/PUBLIC KEY/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-export-public-key-tofile () {
|
||||
check_export_public_key_tofile () {
|
||||
cmd="$pcp -V $vault -l | tail -1 | cut -d ' ' -f 1 | xargs $pcp -V $vault -p -x $passwd -O testkey-self -i "
|
||||
expectfile="testkey-self"
|
||||
expect=""
|
||||
check "$cmd" "$expect" "$input" "$expectfile"
|
||||
}
|
||||
|
||||
check-export-public-key-filecontent () {
|
||||
check_export_public_key_filecontent () {
|
||||
cmd="strings testkey-self"
|
||||
expect="Dexter"
|
||||
check "$cmd" "$expect" "$input" "$expectfile"
|
||||
check "$cmd" "$expect" "$input" ""
|
||||
}
|
||||
|
||||
check-import-public-key () {
|
||||
check_import_public_key () {
|
||||
cmd="$pcp -V $vault -K -I bart.pub"
|
||||
expect="/key $bartid added/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-imported-public-key-info () {
|
||||
check_imported_public_key_info () {
|
||||
cmd="$pcp -V $vault -t -i $bartid"
|
||||
expect="/Serial Number: $bartserial/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-if-delete-public-key-works () {
|
||||
check_if_delete_public_key_works () {
|
||||
cmd="$pcp -V $vault -R -i $bartid"
|
||||
expect="/Public key deleted/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-if-vault-still-valid () {
|
||||
check_if_vault_still_valid () {
|
||||
cmd="$pcp -V $vault -t"
|
||||
expect="/Vault version: 00000002/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-if-deleted-public-key-is-away () {
|
||||
check_if_deleted_public_key_is_away () {
|
||||
cmd="$pcp -V $vault -t"
|
||||
expect="/Public keys: 0/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
@@ -198,69 +198,69 @@ check-if-deleted-public-key-is-away () {
|
||||
#
|
||||
# encryption tests
|
||||
# alicias part
|
||||
check-crypto-alicia-import-secret () {
|
||||
check_crypto_alicia_import_secret () {
|
||||
cmd="$pcp -V va -K -I key-alicia-sec -x a"
|
||||
expect="/${idalicia}/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-crypto-alicia-import-bobbys-key () {
|
||||
check_crypto_alicia_import_bobbys_key () {
|
||||
cmd="$pcp -V va -K -I key-bobby-pub"
|
||||
expect="/${idbobby}/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-crypto-alicia-encrypt () {
|
||||
check_crypto_alicia_encrypt () {
|
||||
cmd="$pcp -V va -e -i ${idbobby} -I testmessage -O testencrypted -x a"
|
||||
expect="/${idbobby} - Bobby/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-crypto-alicia-encrypt-anonymous () {
|
||||
check_crypto_alicia_encrypt_anonymous () {
|
||||
cmd="$pcp -V va -e -A -i ${idbobby} -I testmessage -O testencryptedanon -x a"
|
||||
expect="/${idbobby} - Bobby/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
# bobbys part
|
||||
check-crypto-bobby-import-secret () {
|
||||
check_crypto_bobby_import_secret () {
|
||||
cmd="$pcp -V vb -K -I key-bobby-sec -x b"
|
||||
expect="/${idbobby}/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-crypto-bobby-decrypt-anonymous () {
|
||||
check_crypto_bobby_decrypt_anonymous () {
|
||||
# decrypt anon, without knowing alicias key
|
||||
cmd="$pcp -V vb -d -O testdecryptedanon -I testencryptedanon -x b"
|
||||
expect="/successfully/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-crypto-alicia-import-alicias-key () {
|
||||
check_crypto_alicia_import_alicias_key () {
|
||||
cmd="$pcp -V vb -K -I key-alicia-pub"
|
||||
expect="/${idalicia}/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-crypto-bobby-decrypt () {
|
||||
check_crypto_bobby_decrypt () {
|
||||
cmd="$pcp -V vb -d -O testdecrypted -I testencrypted -x b"
|
||||
expect="/successfully/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-crypto-alicia-encrypted-file () {
|
||||
check_crypto_alicia_encrypted_file () {
|
||||
cmd="cat testdecrypted"
|
||||
expect="/${md5msg}/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-crypto-alicia-encrypt-self () {
|
||||
check_crypto_alicia_encrypt_self () {
|
||||
cmd="$pcp -V va -e -M -I testmessage -O testencryptedself -x a"
|
||||
expect="/Alicia/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-crypto-alicia-deencrypt-self () {
|
||||
check_crypto_alicia_deencrypt_self () {
|
||||
cmd="$pcp -V va -d -I testencryptedself -O testdecrypted -x a"
|
||||
expect="/successfully/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
@@ -268,13 +268,13 @@ check-crypto-alicia-deencrypt-self () {
|
||||
|
||||
#
|
||||
# symetric encryption test
|
||||
check-sym-encrypt () {
|
||||
check_sym_encrypt () {
|
||||
cmd="echo HELLOWORLD | $pcp -e -O testsymencrypted -x a"
|
||||
expect="/symetrically/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-sym-decrypt () {
|
||||
check_sym_decrypt () {
|
||||
cmd="$pcp -d -I testsymencrypted -x a"
|
||||
expect="/HELLO/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
@@ -283,26 +283,26 @@ check-sym-decrypt () {
|
||||
|
||||
#
|
||||
# signature tests
|
||||
check-sign-detached-to-bobby () {
|
||||
check_sign_detached_to_bobby () {
|
||||
cmd="$pcp -V va -g -I README -f testsig -x a"
|
||||
expectfile="testsig"
|
||||
expect=""
|
||||
check "$cmd" "$expect" "$input" "$expectfile"
|
||||
}
|
||||
|
||||
check-verify-detached-signature () {
|
||||
check_verify_detached_signature () {
|
||||
cmd="$pcp -V vb -c -f testsig -I README -i $idalicia"
|
||||
expect="/verified/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-verify-detached-signature-self () {
|
||||
check_verify_detached_signature_self () {
|
||||
cmd="$pcp -V va -c -f testsig -I README"
|
||||
expect="/verified/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-sign-armored-to-bobby () {
|
||||
check_sign_armored_to_bobby () {
|
||||
rm -f testsig
|
||||
cmd="$pcp -V va -g -I README -O testsig -x a -z"
|
||||
expectfile="testsig"
|
||||
@@ -310,19 +310,19 @@ check-sign-armored-to-bobby () {
|
||||
check "$cmd" "$expect" "$input" "$expectfile"
|
||||
}
|
||||
|
||||
check-verify-armored-signature () {
|
||||
check_verify_armored_signature () {
|
||||
cmd="$pcp -V vb -c -I testsig -i $idalicia -z"
|
||||
expect="/verified/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-verify-armored-signature-self () {
|
||||
check_verify_armored_signature_self () {
|
||||
cmd="$pcp -V va -c -I testsig -z"
|
||||
expect="/verified/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-sign-bin-to-bobby () {
|
||||
check_sign_bin_to_bobby () {
|
||||
rm -f testsig
|
||||
cmd="$pcp -V va -g -I README -O testsig -x a"
|
||||
expectfile="testsig"
|
||||
@@ -330,13 +330,13 @@ check-sign-bin-to-bobby () {
|
||||
check "$cmd" "$expect" "$input" "$expectfile"
|
||||
}
|
||||
|
||||
check-verify-bin-signature () {
|
||||
check_verify_bin_signature () {
|
||||
cmd="$pcp -V vb -c -I testsig -i $idalicia"
|
||||
expect="/verified/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-verify-bin-signature-self () {
|
||||
check_verify_bin_signature_self () {
|
||||
cmd="$pcp -V va -c -I testsig "
|
||||
expect="/verified/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
@@ -344,19 +344,19 @@ check-verify-bin-signature-self () {
|
||||
|
||||
#
|
||||
# sign+encrypt tests
|
||||
check-sign-crypt-to-bobby () {
|
||||
check_sign_crypt_to_bobby () {
|
||||
cmd="$pcp -V va -g -e -I README -O testsig -r Bobby -x a"
|
||||
expect="/Encrypted/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-verify-decrypt-from-alicia () {
|
||||
check_verify_decrypt_from_alicia () {
|
||||
cmd="$pcp -V vb -c -d -I testsig -x b"
|
||||
expect="/Verified/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-verify-decrypt-from-alicia-determine () {
|
||||
check_verify_decrypt_from_alicia_determine () {
|
||||
cmd="$pcp -V vb -d -I testsig -x b"
|
||||
expect="/Verified/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
@@ -364,7 +364,7 @@ check-verify-decrypt-from-alicia-determine () {
|
||||
|
||||
#
|
||||
# raw C test with prepared keys, message and cipher
|
||||
check-raw-decrypt () {
|
||||
check_raw_decrypt () {
|
||||
cmd="./statictest"
|
||||
expect="/ok/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
@@ -373,159 +373,159 @@ check-raw-decrypt () {
|
||||
|
||||
#
|
||||
# negative tests, check for error handling
|
||||
check-if-catch-conflicting-params () {
|
||||
check_if_catch_conflicting_params () {
|
||||
cmd="$pcp -V $vault -K -K"
|
||||
expect="/invalid combination of commandline parameters/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-infile-error () {
|
||||
check_infile_error () {
|
||||
cmd="$pcp -V $vault -I nonexist -K"
|
||||
expect="/Could not open input file nonexist/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-import-without-id-error () {
|
||||
check_import_without_id_error () {
|
||||
cmd="$pcp -V $vault -R"
|
||||
expect="/You need to specify a key id/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-catch-invalid-short-keyid () {
|
||||
check_catch_invalid_short_keyid () {
|
||||
cmd="$pcp -V $vault -R -i 0x1"
|
||||
expect="/is too short/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-catch-invalid-long-keyid () {
|
||||
check_catch_invalid_long_keyid () {
|
||||
cmd="$pcp -V $vault -R -i 0x1111111111111111111111111"
|
||||
expect="/is too long/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-catch-invalid-long-keyid-without-0x () {
|
||||
check_catch_invalid_long_keyid_without_0x () {
|
||||
cmd="$pcp -V $vault -R -i 11111111111111111"
|
||||
expect="/is too long/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-catch-delete-nonexist () {
|
||||
check_catch_delete_nonexist () {
|
||||
cmd="$pcp -V $vault -R -i 0x0101010101010101"
|
||||
expect="/No key with id 0x010101/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-if-export-secret-catch-nonexistent-keyid () {
|
||||
check_if_export_secret_catch_nonexistent_keyid () {
|
||||
cmd="$pcp -V $vault -s -i 0x0101010101010101"
|
||||
expect="/Could not find a secret key with id 0x010101/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-if-export-secret-catch-no-primary () {
|
||||
check_if_export_secret_catch_no_primary () {
|
||||
$pcp -V v2 -l # so we've got just an empty vault
|
||||
cmd="$pcp -V v2 -s"
|
||||
expect="/no primary secret key in the vault/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-if-export-secret-catch-outfile-error () {
|
||||
check_if_export_secret_catch_outfile_error () {
|
||||
cmd=" $pcp -V $vault -l | grep primary |cut -d ' ' -f 1 | xargs $pcp -V $vault -s -O nonexistentdir/keyfile -i"
|
||||
expect="/Could not create output file nonexistentdir/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
|
||||
check-if-export-public-catch-nonexistent-keyid () {
|
||||
check_if_export_public_catch_nonexistent_keyid () {
|
||||
cmd="$pcp -V $vault -p -i 0x0101010101010101"
|
||||
expect="/Could not find a key with id 0x010101/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-if-export-public-catch-no-primary () {
|
||||
check_if_export_public_catch_no_primary () {
|
||||
$pcp -V v3 -l # so we've got just an empty vault
|
||||
cmd="$pcp -V v3 -p"
|
||||
expect="/no primary secret key in the vault/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-if-export-public-catch-outfile-error () {
|
||||
check_if_export_public_catch_outfile_error () {
|
||||
$pcp -V $vault -K -I bart.pub
|
||||
cmd="$pcp -V $vault -l | grep public | cut -d ' ' -f 1 | tail -1 | xargs $pcp -V $vault -p -O nonexistentdir/keyfile"
|
||||
expect="/Could not create output file nonexistentdir/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-if-catch-empty-input () {
|
||||
check_if_catch_empty_input () {
|
||||
touch testfile-empty
|
||||
cmd="$pcp -V $vault -K -I testfile-empty"
|
||||
expect="/file is empty/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-if-catch-missing-newlines () {
|
||||
check_if_catch_missing_newlines () {
|
||||
perl -e 'print "X" x 5000; print "\n"' > testfile-toolong
|
||||
cmd="$pcp -V $vault -K -I testfile-toolong -x x"
|
||||
expect="/failed/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-if-catch-nokey-behind-z85 () {
|
||||
check_if_catch_nokey_behind_z85 () {
|
||||
./jot 30 | while read ignore; do echo XXXXX; done | $pcp -z > testfile-nokey
|
||||
cmd="$pcp -V $vault -K -I testfile-nokey -x x"
|
||||
expect="/failed/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-if-sanity-catch-keyexists () {
|
||||
check_if_sanity_catch_keyexists () {
|
||||
cmd="$pcp -V $vault -K -I bart.pub"
|
||||
expect="/there already exists a key/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-if-catch-nokeys () {
|
||||
check_if_catch_nokeys () {
|
||||
$pcp -V v3 -l
|
||||
cmd="$pcp -V v3 -l"
|
||||
expect="/contain any keys so far/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-testkey-wrong-version () {
|
||||
check_testkey_wrong_version () {
|
||||
cmd="$pcp -V $vault -K -I testkey-wrong-version -x xxx"
|
||||
expect="/unknown key version/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-testkey-wrong-serial () {
|
||||
check_testkey_wrong_serial () {
|
||||
cmd="$pcp -V $vault -K -I testkey-wrong-serial -x xxx"
|
||||
expect="/invalid serial number/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-testkey-wrong-ctime () {
|
||||
check_testkey_wrong_ctime () {
|
||||
cmd="$pcp -V $vault -K -I testkey-invalid-ctime -x xxx"
|
||||
expect="/invalid creation timestamp/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-vault-invalid-header () {
|
||||
check_vault_invalid_header () {
|
||||
cmd="$pcp -V testvault-invalidheader -l"
|
||||
expect="/Unexpected vault file format/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-vault-invalid-version () {
|
||||
check_vault_invalid_version () {
|
||||
cmd="$pcp -V testvault-invalidversion -l"
|
||||
expect="/Unexpected vault file format/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-vault-invalid-itemtype () {
|
||||
check_vault_invalid_itemtype () {
|
||||
cmd="$pcp -V testvault-invaliditemtype -l"
|
||||
expect="/invalid key type/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-vault-invalid-keytype () {
|
||||
check_vault_invalid_keytype () {
|
||||
cmd="$pcp -V testvault-invalidkeytype -l"
|
||||
expect="/contain any keys so far./"
|
||||
check "$cmd" "$expect" "$input"
|
||||
@@ -534,7 +534,7 @@ check-vault-invalid-keytype () {
|
||||
|
||||
#
|
||||
# input handling tests
|
||||
check-large-meta () {
|
||||
check_large_meta () {
|
||||
cmd="(./jot 300 | while read m; do echo -n m; done; echo $passwd) | $pcp -V $vault -k -x $passwd"
|
||||
expect="/Generated new secret key/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
@@ -542,7 +542,7 @@ check-large-meta () {
|
||||
|
||||
#
|
||||
# fuzz tests
|
||||
check-fuzz-binary-pubkey () {
|
||||
check_fuzz_binary_pubkey () {
|
||||
expect="!/added/"
|
||||
cmd="echo no | $pcp -V vf -K -I testfuzzP.pub -x $passwd"
|
||||
|
||||
@@ -556,7 +556,7 @@ check-fuzz-binary-pubkey () {
|
||||
done
|
||||
}
|
||||
|
||||
check-fuzz-binary-seckey () {
|
||||
check_fuzz_binary_seckey () {
|
||||
cmd="echo no | $pcp -V vf -K -I testfuzzS.sec -x $passwd"
|
||||
expect="!/added/"
|
||||
for N in `./jot 30`; do
|
||||
@@ -571,25 +571,25 @@ check-fuzz-binary-seckey () {
|
||||
|
||||
|
||||
# checksum tests
|
||||
check-checksum-copying () {
|
||||
check_checksum_copying () {
|
||||
cmd="$pcp -C ../COPYING"
|
||||
expect="/$blake2/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-checksum-authenticated-copying () {
|
||||
check_checksum_authenticated_copying () {
|
||||
cmd="$pcp -x $key -C ../COPYING"
|
||||
expect="/$blake2auth/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-checksum-copying-stdin () {
|
||||
check_checksum_copying_stdin () {
|
||||
cmd="$pcp -C < ../COPYING"
|
||||
expect="/$blake2/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
}
|
||||
|
||||
check-checksum-multiple () {
|
||||
check_checksum_multiple () {
|
||||
cmd="$pcp -C ../COPYING ../README"
|
||||
expect="/README/"
|
||||
check "$cmd" "$expect" "$input"
|
||||
|
||||
Reference in New Issue
Block a user