tests: Add tests for missing image, cert & key files
Currently causes a segfault in verify-missing-image.sh. Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
This commit is contained in:
parent
b3edb1fb72
commit
0568983fab
6 changed files with 68 additions and 1 deletions
|
@ -37,7 +37,12 @@ $(test_cert): $(test_key) Makefile
|
||||||
|
|
||||||
TESTS = sign-verify.sh \
|
TESTS = sign-verify.sh \
|
||||||
sign-verify-detached.sh \
|
sign-verify-detached.sh \
|
||||||
sign-attach-verify.sh
|
sign-attach-verify.sh \
|
||||||
|
sign-missing-image.sh \
|
||||||
|
sign-missing-cert.sh \
|
||||||
|
sign-missing-key.sh \
|
||||||
|
verify-missing-image.sh \
|
||||||
|
verify-missing-cert.sh
|
||||||
|
|
||||||
EXTRA_DIST = $(test_lds) test.S $(TESTS) $(check_SCRIPTS)
|
EXTRA_DIST = $(test_lds) test.S $(TESTS) $(check_SCRIPTS)
|
||||||
CLEANFILES = $(test_key) $(test_cert) $(test_image)
|
CLEANFILES = $(test_key) $(test_cert) $(test_image)
|
||||||
|
|
12
tests/sign-missing-cert.sh
Executable file
12
tests/sign-missing-cert.sh
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
. "$srcdir/common.sh"
|
||||||
|
|
||||||
|
signed="test.signed"
|
||||||
|
|
||||||
|
set +e
|
||||||
|
"$sbsign" --cert "missing-cert" --key "$key" --output "$signed" "$image"
|
||||||
|
rc=$?
|
||||||
|
set -e
|
||||||
|
|
||||||
|
test $rc -eq 1
|
12
tests/sign-missing-image.sh
Executable file
12
tests/sign-missing-image.sh
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
. "$srcdir/common.sh"
|
||||||
|
|
||||||
|
signed="test.signed"
|
||||||
|
|
||||||
|
set +e
|
||||||
|
"$sbsign" --cert "$cert" --key "$key" --output "$signed" "missing-image"
|
||||||
|
rc=$?
|
||||||
|
set -e
|
||||||
|
|
||||||
|
test $rc -eq 1
|
12
tests/sign-missing-key.sh
Executable file
12
tests/sign-missing-key.sh
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
. "$srcdir/common.sh"
|
||||||
|
|
||||||
|
signed="test.signed"
|
||||||
|
|
||||||
|
set +e
|
||||||
|
"$sbsign" --cert "$cert" --key "missing-key" --output "$signed" "$image"
|
||||||
|
rc=$?
|
||||||
|
set -e
|
||||||
|
|
||||||
|
test $rc -eq 1
|
14
tests/verify-missing-cert.sh
Executable file
14
tests/verify-missing-cert.sh
Executable file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
. "$srcdir/common.sh"
|
||||||
|
|
||||||
|
signed="test.signed"
|
||||||
|
|
||||||
|
"$sbsign" --cert "$cert" --key "$key" --output "$signed" "$image"
|
||||||
|
|
||||||
|
set +e
|
||||||
|
"$sbverify" --cert "missing-cert" "$signed"
|
||||||
|
rc=$?
|
||||||
|
set -e
|
||||||
|
|
||||||
|
test $rc -eq 1
|
12
tests/verify-missing-image.sh
Executable file
12
tests/verify-missing-image.sh
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
. "$srcdir/common.sh"
|
||||||
|
|
||||||
|
signed="test.signed"
|
||||||
|
|
||||||
|
set +e
|
||||||
|
"$sbverify" "missing-image"
|
||||||
|
rc=$?
|
||||||
|
set -e
|
||||||
|
|
||||||
|
test $rc -eq 1
|
Loading…
Reference in a new issue