summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-12-02 18:06:45 +0100
committerPierre Schmitz <pierre@archlinux.de>2010-12-02 18:06:45 +0100
commit6037b3e9aa414d94cd14b8c51b9b04be054c5e04 (patch)
treed13b294ee5cb4f2f755825d6af6e8e3b918c69cd /test
parent69721f4e42fa296de2d5a568d07758888c354328 (diff)
downloaddbscripts-6037b3e9aa414d94cd14b8c51b9b04be054c5e04.tar.gz
dbscripts-6037b3e9aa414d94cd14b8c51b9b04be054c5e04.tar.xz
db-update: Fail if a set of split packages is incomplete
Diffstat (limited to 'test')
-rwxr-xr-xtest/test.d/db-update.sh23
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"