summaryrefslogtreecommitdiff
path: root/test/test.d/signed-packages.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/test.d/signed-packages.sh')
-rwxr-xr-xtest/test.d/signed-packages.sh20
1 files changed, 19 insertions, 1 deletions
diff --git a/test/test.d/signed-packages.sh b/test/test.d/signed-packages.sh
index 5d6f4ff..20ad844 100755
--- a/test/test.d/signed-packages.sh
+++ b/test/test.d/signed-packages.sh
@@ -5,9 +5,27 @@ curdir=$(readlink -e $(dirname $0))
testAddUnsignedPackage() {
releasePackage extra 'pkg-simple-a' 'i686'
- # remove any signature
rm "${STAGING}"/extra/*.sig
../db-update >/dev/null 2>&1 && fail "db-update should fail when a signature is missing!"
}
+testAddInvalidSignedPackage() {
+ local p
+ releasePackage extra 'pkg-simple-a' 'i686'
+ for p in "${STAGING}"/extra/*${PKGEXT}; do
+ unxz $p
+ xz -0 ${p%%.xz}
+ done
+ ../db-update >/dev/null 2>&1 && fail "db-update should fail when a signature is invalid!"
+}
+
+testAddBrokenSignature() {
+ local s
+ releasePackage extra 'pkg-simple-a' 'i686'
+ for s in "${STAGING}"/extra/*.sig; do
+ echo 0 > $s
+ done
+ ../db-update >/dev/null 2>&1 && fail "db-update should fail when a signature is broken!"
+}
+
. "${curdir}/../lib/shunit2"