From a639bca6cc963483eb1627c7e6a1fa0af23ca148 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 12 Oct 2014 13:55:56 +0200 Subject: add new tests; misc Signed-off-by: Florian Pritz --- test/lib/common.inc | 2 +- test/test.d/db-remove.sh | 24 ++++++++++++++++++------ test/test.d/db-update.sh | 3 +-- test/test.d/testing2x.sh | 25 +++++++++++++++++++++++++ 4 files changed, 45 insertions(+), 9 deletions(-) diff --git a/test/lib/common.inc b/test/lib/common.inc index 439180f..725ca55 100644 --- a/test/lib/common.inc +++ b/test/lib/common.inc @@ -91,7 +91,6 @@ setUp() { mkdir -p "${TMP}/history-repo" git init -q "${TMP}/history-repo" - msg 'Creating svn repository...' svnadmin create "${TMP}/svn-packages-repo" arch_svn checkout -q "file://${TMP}/svn-packages-repo" "${TMP}/svn-packages-copy" @@ -165,6 +164,7 @@ releasePackage() { for _arch in "${arches[@]}"; do # TODO: need to create the symlinks here (what commitpkg does) + # should this actually use commitpkg? for single_name in "${pkgname[@]}"; do pkgfile=("${STAGING}/${repo}/"${single_name}-${pkgver}-${arch}${PKGEXT}) pkgfile=${pkgfile[0]##*/} diff --git a/test/test.d/db-remove.sh b/test/test.d/db-remove.sh index 6905821..f706b7a 100755 --- a/test/test.d/db-remove.sh +++ b/test/test.d/db-remove.sh @@ -20,9 +20,6 @@ testRemovePackages() { for pkgname in ${pkgnames[@]}; do for arch in ${arches[@]}; do - # TODO: removing pkg-split-a/pkg-split-b won't work because - # db-remove only removes single packages, not a group of split - # packages. do we want that? ../db-remove extra ${arch} ${pkgname} done done @@ -56,9 +53,6 @@ testRemoveMultiplePackages() { ../db-update for arch in ${arches[@]}; do - # TODO: removing pkg-split-a/pkg-split-b won't work because - # db-remove only removes single packages, not a group of split - # packages. do we want that? ../db-remove extra ${arch} ${pkgnames[@]} done @@ -94,4 +88,22 @@ testRemoveAnyPackages() { done } +testRemoveSingleArch() { + local pkgs=('pkg-any-a' 'pkg-any-b') + local pkgbase + + for pkgbase in ${pkgs[@]}; do + releasePackage extra ${pkgbase} any + done + + ../db-update + + ../db-remove extra i686 pkg-any-a + + checkRemovedPackage extra pkg-any-a i686 + checkPackage extra pkg-any-a-1-1-any.pkg.tar.xz x86_64 + checkPackage extra pkg-any-b-1-1-any.pkg.tar.xz i686 + checkPackage extra pkg-any-b-1-1-any.pkg.tar.xz x86_64 +} + . "${curdir}/../lib/shunit2" diff --git a/test/test.d/db-update.sh b/test/test.d/db-update.sh index 5cee647..6fe0321 100755 --- a/test/test.d/db-update.sh +++ b/test/test.d/db-update.sh @@ -150,10 +150,9 @@ testAddIncompleteSplitPackage() { releasePackage ${repo} ${pkgbase} ${arch} done - # remove a split package to make db-update fail + # remove a split package to make db-update ignore it rm "${STAGING}"/extra/${pkgbase}1-* - # TODO: should this really not add any packages but exit 0? check against new specs ../db-update for arch in ${arches[@]}; do diff --git a/test/test.d/testing2x.sh b/test/test.d/testing2x.sh index 586ce40..29c10e6 100755 --- a/test/test.d/testing2x.sh +++ b/test/test.d/testing2x.sh @@ -24,4 +24,29 @@ testTesting2xAnyPackage() { checkRemovedAnyPackage testing pkg-any-a } +testTesting2xMultiArchPackage() { + releasePackage core pkg-any-a any + releasePackage extra pkg-any-a any + ../db-update + ../db-remove core i686 pkg-any-a + ../db-remove extra x86_64 pkg-any-a + + pushd "${TMP}/svn-packages-copy/pkg-any-a/trunk/" >/dev/null + sed 's/pkgrel=1/pkgrel=2/g' -i PKGBUILD + arch_svn commit -q -m"update pkg to pkgrel=2" >/dev/null + sudo chronic extra-i686-build + mv pkg-any-a-1-2-any.pkg.tar.xz "${pkgdir}/pkg-any-a/" + popd >/dev/null + + releasePackage testing pkg-any-a any + ../db-update + rm -f "${pkgdir}/pkg-any-a/pkg-any-a-1-2-any.pkg.tar.xz" + + ../testing2x pkg-any-a + + checkPackage core pkg-any-a-1-2-any.pkg.tar.xz x86_64 + checkPackage extra pkg-any-a-1-2-any.pkg.tar.xz i686 + checkRemovedAnyPackage testing pkg-any-a +} + . "${curdir}/../lib/shunit2" -- cgit v1.2.3-24-g4f1b