tests: Add a few simple tests

Add a few tests for the sign, verify, attach and detach code. These
require some additional infrastructure to create a sample PE/COFF
executable, plus a key & cert for testing.

Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
This commit is contained in:
Jeremy Kerr 2012-06-13 14:23:26 +08:00
parent 0c5de30566
commit b05afccde0
9 changed files with 158 additions and 2 deletions

12
tests/sign-attach-verify.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash -e
. "$srcdir/common.sh"
sig=test.sig
signed=test.signed
trap 'rm -f "$sig" "$signed"' EXIT
"$sbsign" --cert "$cert" --key "$key" --detached --output $sig "$image"
"$sbattach" --attach $sig $signed
"$sbverify" --cert "$cert" "$signed"