diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-04-17 01:59:40 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-04-17 01:59:40 -0400 |
commit | fdc37e5cf06d845a88971881a99de034a723c94a (patch) | |
tree | 6a12e5972fecd04800713d0e50dbc4d4a3d51d49 /test/test.d/signed-packages.sh | |
parent | ff2983c207e6ab2a9381e20312355c42307187f6 (diff) |
Grab an updated test/ directory from lukeshu/archlinux+cleanup+librelib
It's not like we were running the tests anyway, and this makes merging
easier.
Diffstat (limited to 'test/test.d/signed-packages.sh')
-rwxr-xr-x | test/test.d/signed-packages.sh | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/test/test.d/signed-packages.sh b/test/test.d/signed-packages.sh index 5d6f4ff..3ffe146 100755 --- a/test/test.d/signed-packages.sh +++ b/test/test.d/signed-packages.sh @@ -1,13 +1,36 @@ #!/bin/bash -curdir=$(readlink -e $(dirname $0)) +curdir="$(dirname "$(readlink -e "$0")")" . "${curdir}/../lib/common.inc" +testAddSignedPackage() { + releasePackage extra 'pkg-simple-a' 'i686' + ../db-update || fail "db-update failed!" +} + 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" |