summaryrefslogtreecommitdiff
path: root/test/test.d/signed-packages.sh
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2011-12-18 14:16:30 +0100
committerPierre Schmitz <pierre@archlinux.de>2011-12-18 14:16:30 +0100
commit2b7bb0c6b7aa4f7a43c82db1cf9a18d27600c62e (patch)
tree215c7aacc2d23b6b553f8b1f1d033273fea571cd /test/test.d/signed-packages.sh
parenta8b219b325cd642a781a64d8e08a0e66d25c1b44 (diff)
Validate package signatures on db-update
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"