mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-18 04:10:57 +01:00
-i is now optional for encryption if recipient specified, -R exchanged with -r, added virtual env for manual tests in tests/env/
This commit is contained in:
24
tests/env/alicia/.bash_history
vendored
Normal file
24
tests/env/alicia/.bash_history
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
cd
|
||||
pwd
|
||||
l
|
||||
alias
|
||||
cd
|
||||
l
|
||||
id
|
||||
pcp -l
|
||||
alias
|
||||
pcp -l
|
||||
pwd
|
||||
pcp -l
|
||||
l ../../../src/pcp1
|
||||
pcp -l
|
||||
pcp -k
|
||||
l
|
||||
pcp -l
|
||||
..
|
||||
pcp
|
||||
pcp -l
|
||||
..
|
||||
pcp -l
|
||||
cd -
|
||||
cd
|
||||
BIN
tests/env/alicia/.pcpvault
vendored
Normal file
BIN
tests/env/alicia/.pcpvault
vendored
Normal file
Binary file not shown.
1
tests/env/alicia/share
vendored
Symbolic link
1
tests/env/alicia/share
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../share
|
||||
21
tests/env/bashrc
vendored
Normal file
21
tests/env/bashrc
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
alias pcp=$PCP
|
||||
|
||||
alias ll='ls -l'
|
||||
alias la='ls -la'
|
||||
alias l='ls -alF'
|
||||
alias ..='cd ..'
|
||||
alias ...='cd ../..'
|
||||
alias ....='cd ../../..'
|
||||
alias md='mkdir -p'
|
||||
alias less='less -i -P "?f%f:Standard input. %lb / %L ?e(END):>"'
|
||||
|
||||
|
||||
DATE () {
|
||||
echo -e "[`date +%d.%b" "%H:%M:%S`]"
|
||||
}
|
||||
|
||||
export PROMPT_COMMAND="PS1='\[\033]0;\u@\h:\w\007\]
|
||||
\$(DATE) --- [\w] ---
|
||||
$USER@\h: % '"
|
||||
|
||||
cd
|
||||
4
tests/env/bobby/.bash_history
vendored
Normal file
4
tests/env/bobby/.bash_history
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
pcp -l
|
||||
pcp -k
|
||||
l
|
||||
l
|
||||
BIN
tests/env/bobby/.pcpvault
vendored
Normal file
BIN
tests/env/bobby/.pcpvault
vendored
Normal file
Binary file not shown.
1
tests/env/bobby/share
vendored
Symbolic link
1
tests/env/bobby/share
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../share
|
||||
24
tests/env/vsh
vendored
Executable file
24
tests/env/vsh
vendored
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
# simple virtual env to do manual tests of pcp
|
||||
# using different users.
|
||||
|
||||
user=$1
|
||||
|
||||
if test -z "$user"; then
|
||||
echo "usage: $0 <user>"
|
||||
exit
|
||||
fi
|
||||
|
||||
user=`echo "$user" | sed 's/\///g'`
|
||||
|
||||
if ! test -d "$user"; then
|
||||
echo "there's no directory for $user"
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
cur=`pwd`
|
||||
home="$cur/$user"
|
||||
|
||||
exec env PCP="$cur/../../src/pcp1" USER=$user HOME=$home bash --rcfile "$cur/bashrc"
|
||||
@@ -61,7 +61,7 @@ dxmorg@florida.cops.gov
|
||||
</test>
|
||||
|
||||
<test check-if-delete-public-key-works>
|
||||
cmd = $pcp -V $vault -r -i 0x0E4512BE47CE0215
|
||||
cmd = $pcp -V $vault -R -i 0x0E4512BE47CE0215
|
||||
expect = /Public key deleted/
|
||||
</test>
|
||||
|
||||
@@ -138,7 +138,7 @@ md5msg = 66b8c4ca9e5d2a7e3c0559c3cdea3d50
|
||||
# derived by name
|
||||
<test check-dcrypto-init>
|
||||
<test check-dcrypto-alicia-export-derived-byname>
|
||||
cmd = $pcp -V va -p -R Bobby -x a -O testpub-forbobby-name
|
||||
cmd = $pcp -V va -p -r Bobby -x a -O testpub-forbobby-name
|
||||
expect-file = testpub-forbobby-name
|
||||
</test>
|
||||
<test check-dcrypto-bobby-import-byname>
|
||||
@@ -157,7 +157,7 @@ md5msg = 66b8c4ca9e5d2a7e3c0559c3cdea3d50
|
||||
|
||||
# repeat, but now use derived keys in both directions
|
||||
<test check-dcrypto-bobby-export-derived-byname>
|
||||
cmd = $pcp -V vb -p -R Alicia -x b -O testpub-foralicia-name
|
||||
cmd = $pcp -V vb -p -r Alicia -x b -O testpub-foralicia-name
|
||||
expect-file = testpub-foralicia-name
|
||||
</test>
|
||||
<test check-dcrypto-alicia-import-byname>
|
||||
@@ -166,7 +166,7 @@ md5msg = 66b8c4ca9e5d2a7e3c0559c3cdea3d50
|
||||
</test>
|
||||
<test check-dcrypto-bobby-encrypt-byname-both>
|
||||
id = grep Key-ID testpub-forbobby-name | sed 's/^ //g' | cut -d' ' -f2
|
||||
cmd = $pcp -V vb -e -i %{id} -I testmessage -O testencrypted-name -x b -R Alicia
|
||||
cmd = $pcp -V vb -e -i %{id} -I testmessage -O testencrypted-name -x b -r Alicia
|
||||
expect = /success/
|
||||
</test>
|
||||
<test check-dcrypto-alicia-decrypt-byname-both>
|
||||
@@ -189,27 +189,27 @@ md5msg = 66b8c4ca9e5d2a7e3c0559c3cdea3d50
|
||||
</test>
|
||||
|
||||
<test check-import-without-id-error>
|
||||
cmd = $pcp -V $vault -r
|
||||
cmd = $pcp -V $vault -R
|
||||
expect = /You need to specify a key id/
|
||||
</test>
|
||||
|
||||
<test check-catch-invalid-short-keyid>
|
||||
cmd = $pcp -V $vault -r -i 0x1
|
||||
cmd = $pcp -V $vault -R -i 0x1
|
||||
expect = /is too short/
|
||||
</test>
|
||||
|
||||
<test check-catch-invalid-long-keyid>
|
||||
cmd = $pcp -V $vault -r -i 0x1111111111111111111111111
|
||||
cmd = $pcp -V $vault -R -i 0x1111111111111111111111111
|
||||
expect = /is too long/
|
||||
</test>
|
||||
|
||||
<test check-catch-invalid-long-keyid-without-0x>
|
||||
cmd = $pcp -V $vault -r -i 11111111111111111
|
||||
cmd = $pcp -V $vault -R -i 11111111111111111
|
||||
expect = /is too long/
|
||||
</test>
|
||||
|
||||
<test check-catch-delete-nonexist>
|
||||
cmd = $pcp -V $vault -r -i 0x0101010101010101
|
||||
cmd = $pcp -V $vault -R -i 0x0101010101010101
|
||||
expect = /No key with id 0x010101/
|
||||
</test>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user