mirror of
https://github.com/5im-0n/sshenc.sh.git
synced 2025-08-03 03:40:14 +02:00
add a test with multiple pubkeys
This commit is contained in:
33
tests/test.sh
Executable file
33
tests/test.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
cleanup() {
|
||||
rm -rf "$tempfile"
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
|
||||
tempfile=$(tempfile)
|
||||
plaintext=$(cat sometext)
|
||||
|
||||
echo -n 'testing multiple pubkeys: '
|
||||
../sshenc.sh -p id_rsa-1.pub -p id_rsa-2.pub -p id_rsa-3.pub < sometext > $tempfile
|
||||
cyph=$(../sshenc.sh -s id_rsa-1 < $tempfile)
|
||||
if [ "$cyph" == "$plaintext" ]; then
|
||||
echo -n "key1: ✓ "
|
||||
else
|
||||
echo -n "key1: ⛝ "
|
||||
fi
|
||||
cyph=$(../sshenc.sh -s id_rsa-2 < $tempfile)
|
||||
if [ "$cyph" == "$plaintext" ]; then
|
||||
echo -n "key2: ✓ "
|
||||
else
|
||||
echo -n "key2: ⛝ "
|
||||
fi
|
||||
cyph=$(../sshenc.sh -s id_rsa-3 < $tempfile)
|
||||
if [ "$cyph" == "$plaintext" ]; then
|
||||
echo -n "key3: ✓ "
|
||||
else
|
||||
echo -n "key4: ⛝ "
|
||||
fi
|
||||
|
||||
echo
|
||||
echo done.
|
Reference in New Issue
Block a user