mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-18 04:10:57 +01:00
move from unittest perl tp shell script, more portable and easier to understand
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# -*-html-*-
|
||||
# -*-sh-*-
|
||||
#
|
||||
# This file is part of Pretty Curved Privacy (pcp1).
|
||||
#
|
||||
@@ -20,66 +20,81 @@
|
||||
# You can contact me by mail: <tlinden AT cpan DOT org>.
|
||||
#
|
||||
|
||||
pcp = ../src/pcp1
|
||||
passwd = xxx
|
||||
verbose = 1
|
||||
include keys.cfg
|
||||
pcp=../src/pcp1
|
||||
passwd=xxx
|
||||
verbose=1
|
||||
|
||||
<test vja>
|
||||
prepare = rm -f vja; $pcp -V vja -K -I key-alicia-sec -x a
|
||||
<test check-json-export-public>
|
||||
cmd = $pcp -V vja -p -j -x a -O testkeyvjapub.json
|
||||
expect-file testkeyvjapub.json
|
||||
</test>
|
||||
<test check-json-export-public-isjson>
|
||||
cmd = cat testkeyvjapub.json
|
||||
expect = /"Alicia"/
|
||||
</test>
|
||||
<test check-json-export-secret>
|
||||
cmd = $pcp -V vja -s -j -x a -O testkeyvjasec.json
|
||||
expect-file testkeyvjasec.json
|
||||
</test>
|
||||
<test check-json-export-secret-isjson>
|
||||
cmd = cat testkeyvjasec.json
|
||||
expect = /"Alicia"/
|
||||
</test>
|
||||
</test>
|
||||
. keys.cfg
|
||||
|
||||
<test vjb>
|
||||
prepare = rm -f vjb; $pcp -V vjb -K -I key-bobby-sec -x b
|
||||
<test check-json-import-public>
|
||||
cmd = $pcp -V vjb -K -I testkeyvjapub.json -j
|
||||
expect /added/
|
||||
</test>
|
||||
<test check-json-import-public-open>
|
||||
cmd = $pcp -V vjb -l
|
||||
expect = /Alicia/
|
||||
</test>
|
||||
</test>
|
||||
check-json-support () {
|
||||
cmd="$pcp -V vja -t -j"
|
||||
expect="\"keyvaultfile\""
|
||||
check "$cmd" "$expect"
|
||||
}
|
||||
|
||||
<test vjc>
|
||||
prepare = rm -f vjc
|
||||
<test check-json-import-secret>
|
||||
cmd = $pcp -V vjc -K -I testkeyvjasec.json -x a -j
|
||||
expect = /added/
|
||||
</test>
|
||||
<test check-json-import-secret-open>
|
||||
cmd = $pcp -V vjc -l
|
||||
expect = /Alicia/
|
||||
</test>
|
||||
</test>
|
||||
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"
|
||||
}
|
||||
|
||||
<test vjtxt>
|
||||
<test check-json-text-vault>
|
||||
cmd = $pcp -V vjb -t -j
|
||||
expect = /"Alicia"/
|
||||
</test>
|
||||
<test check-json-text-public>
|
||||
cmd = $pcp -V vjb -t -j -i ${idalicia}
|
||||
expect = /"Alicia"/
|
||||
</test>
|
||||
<test check-json-text-secret>
|
||||
cmd = $pcp -V vjb -t -j -i ${idbobby}
|
||||
expect = /"Bobby"/
|
||||
</test>
|
||||
</test>
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user