diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2010-12-02 18:06:45 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2010-12-02 18:06:45 +0100 |
commit | 6037b3e9aa414d94cd14b8c51b9b04be054c5e04 (patch) | |
tree | d13b294ee5cb4f2f755825d6af6e8e3b918c69cd /test | |
parent | 69721f4e42fa296de2d5a568d07758888c354328 (diff) |
db-update: Fail if a set of split packages is incomplete
Diffstat (limited to 'test')
-rwxr-xr-x | test/test.d/db-update.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/test.d/db-update.sh b/test/test.d/db-update.sh index 3c41b39..ad0be32 100755 --- a/test/test.d/db-update.sh +++ b/test/test.d/db-update.sh @@ -124,4 +124,27 @@ testUpdateSameAnyPackageToDifferentRepositories() { done } + +testAddIncompleteSplitPackage() { + local arches=('i686' 'x86_64') + local repo='extra' + local pkgbase='pkg-split-a' + local arch + + for arch in ${arches[@]}; do + releasePackage ${repo} ${pkgbase} ${arch} + done + + # remove a split package to make db-update fail + rm "${STAGING}"/extra/${pkgbase}1-* + + ../db-update >/dev/null 2>&1 && fail "db-update should fail when a split package is missing!" + + for arch in ${arches[@]}; do + ( [ -r "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" ] \ + && bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" -O | grep -q ${pkgbase}) \ + && fail "${pkgbase} should not be in ${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" + done +} + . "${curdir}/../lib/shunit2" |