init
This commit is contained in:
commit
5625d6bd14
11 changed files with 821 additions and 0 deletions
20
tests/test.sh
Normal file
20
tests/test.sh
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
bin="${GERBERA_BIN:-./build/gerbera}"
|
||||
work="${TMPDIR:-/tmp}/gerbera-test-$$"
|
||||
mkdir "$work"
|
||||
trap 'rm -rf "$work"' EXIT HUP INT TERM
|
||||
|
||||
printf 'Array-based encryption test\n\000\001\377' > "$work/plain.bin"
|
||||
"$bin" encrypt "$work/plain.bin" "$work/encrypted.gerbera" 'test-password'
|
||||
"$bin" decrypt "$work/encrypted.gerbera" "$work/decrypted.bin" 'test-password'
|
||||
cmp "$work/plain.bin" "$work/decrypted.bin"
|
||||
|
||||
if "$bin" decrypt "$work/encrypted.gerbera" "$work/wrong.bin" 'wrong-password'; then
|
||||
echo "wrong password unexpectedly succeeded" >&2
|
||||
exit 1
|
||||
fi
|
||||
test ! -e "$work/wrong.bin"
|
||||
|
||||
echo "All tests passed."
|
||||
Loading…
Add table
Add a link
Reference in a new issue