From 6037b3e9aa414d94cd14b8c51b9b04be054c5e04 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 2 Dec 2010 18:06:45 +0100 Subject: db-update: Fail if a set of split packages is incomplete --- test/test.d/db-update.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test') 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" -- cgit v1.2.3