Files
pcp/tests/jsonunittests.cfg

101 lines
2.6 KiB
INI
Raw Normal View History

# -*-sh-*-
2015-07-08 23:51:40 +02:00
#
# This file is part of Pretty Curved Privacy (pcp1).
#
# Copyright (C) 2013 T.Linden.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# You can contact me by mail: <tlinden AT cpan DOT org>.
#
pcp=../src/pcp1
passwd=xxx
verbose=1
2015-07-08 23:51:40 +02:00
. keys.cfg
2015-07-08 23:51:40 +02:00
check-json-support () {
cmd="$pcp -V vja -t -j"
expect="\"keyvaultfile\""
check "$cmd" "$expect"
}
check-json-export-public () {
cmd="$pcp -V vja -p -j -x a -O testkeyvjapub.json"
expectfile="testkeyvjapub.json"
expect="/\"Alicia\"/"
check "$cmd" "$expect" "$input" "$expectfile"
}
2015-07-08 23:51:40 +02:00
check-json-export-secret () {
cmd="$pcp -V vja -s -j -x a -O testkeyvjasec.json"
expectfile="testkeyvjasec.json"
check "$cmd" "$expect" "$input" "$expectfile"
}
check-json-export-secret-isjson () {
cmd="cat testkeyvjasec.json"
expect="/\"Alicia\"/"
check "$cmd" "$expect" "$input" "$expectfile"
}
check-json-import-public () {
cmd="$pcp -V vjb -K -I testkeyvjapub.json -j"
expect="/added/"
check "$cmd" "$expect" "$input" "$expectfile"
}
check-json-import-public-open () {
cmd="$pcp -V vjb -l"
expect="/Alicia/"
check "$cmd" "$expect" "$input" "$expectfile"
}
check-json-import-secret () {
cmd="$pcp -V vjc -K -I testkeyvjasec.json -x a -j"
expect="/added/"
check "$cmd" "$expect" "$input" "$expectfile"
}
check-json-import-secret-open () {
cmd="$pcp -V vjc -l"
expect="/Alicia/"
check "$cmd" "$expect" "$input" "$expectfile"
}
check-json-text-vault () {
cmd="$pcp -V vjb -t -j"
expect="/\"Alicia\"/"
check "$cmd" "$expect" "$input" "$expectfile"
}
check-json-text-public () {
cmd="$pcp -V vjb -t -j -i ${idalicia}"
expect="/\"Alicia\"/"
check "$cmd" "$expect" "$input" "$expectfile"
}
check-json-text-secret () {
cmd="$pcp -V vjb -t -j -i ${idbobby}"
expect="/\"Bobby\"/"
check "$cmd" "$expect" "$input" "$expectfile"
}
prepare () {
rm -f vja; $pcp -V vja -K -I key-alicia-sec -x a
rm -f vjb; $pcp -V vjb -K -I key-bobby-sec -x b
rm -f vjc
}