diff options
Diffstat (limited to 'test/test.d')
-rwxr-xr-x | test/test.d/create-filelists.sh | 27 | ||||
-rwxr-xr-x | test/test.d/db-move.sh | 26 | ||||
-rwxr-xr-x | test/test.d/db-remove.sh | 2 | ||||
-rwxr-xr-x | test/test.d/db-update.sh | 12 | ||||
-rwxr-xr-x | test/test.d/ftpdir-cleanup.sh | 32 | ||||
-rwxr-xr-x | test/test.d/pool-transition.sh | 14 | ||||
-rwxr-xr-x | test/test.d/signed-packages.sh | 13 | ||||
-rwxr-xr-x | test/test.d/sourceballs.sh | 2 | ||||
-rwxr-xr-x | test/test.d/testing2x.sh | 2 |
9 files changed, 97 insertions, 33 deletions
diff --git a/test/test.d/create-filelists.sh b/test/test.d/create-filelists.sh index da76710..80b0927 100755 --- a/test/test.d/create-filelists.sh +++ b/test/test.d/create-filelists.sh @@ -5,7 +5,7 @@ curdir=$(readlink -e $(dirname $0)) testCreateSimpleFileLists() { local arches=('i686' 'x86_64') - local pkgs=('pkg-simple-a' 'pkg-simple-b') + local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-simple-epoch') local pkgbase local arch @@ -16,11 +16,10 @@ testCreateSimpleFileLists() { done ../db-update - ../cron-jobs/create-filelists for pkgbase in ${pkgs[@]}; do for arch in ${arches[@]}; do - if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra.files.tar.gz" | grep -q "usr/bin/${pkgbase}"; then - fail "usr/bin/${pkgbase} not found in ${arch}/extra.files.tar.gz" + if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/${pkgbase}"; then + fail "usr/bin/${pkgbase} not found in ${arch}/extra${FILESEXT}" fi done done @@ -37,11 +36,10 @@ testCreateAnyFileLists() { done ../db-update - ../cron-jobs/create-filelists for pkgbase in ${pkgs[@]}; do for arch in ${arches[@]}; do - if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra.files.tar.gz" | grep -q "usr/share/${pkgbase}/test"; then - fail "usr/share/${pkgbase}/test not found in ${arch}/extra.files.tar.gz" + if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/share/${pkgbase}/test"; then + fail "usr/share/${pkgbase}/test not found in ${arch}/extra${FILESEXT}" fi done done @@ -63,13 +61,12 @@ testCreateSplitFileLists() { done ../db-update - ../cron-jobs/create-filelists for pkgbase in ${pkgs[@]}; do pkgnames=($(source "${TMP}/svn-packages-copy/${pkgbase}/trunk/PKGBUILD"; echo ${pkgname[@]})) for pkgname in ${pkgnames[@]}; do for arch in ${arches[@]}; do - if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra.files.tar.gz" | grep -q "usr/bin/${pkgname}"; then - fail "usr/bin/${pkgname} not found in ${arch}/extra.files.tar.gz" + if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/${pkgname}"; then + fail "usr/bin/${pkgname} not found in ${arch}/extra${FILESEXT}" fi done done @@ -89,19 +86,17 @@ testCleanupFileLists() { done done ../db-update - ../cron-jobs/create-filelists for arch in ${arches[@]}; do ../db-remove pkg-simple-a extra ${arch} done - ../cron-jobs/create-filelists for arch in ${arches[@]}; do - if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra.files.tar.gz" | grep -q "usr/bin/pkg-simple-b"; then - fail "usr/bin/pkg-simple-b not found in ${arch}/extra.files.tar.gz" + if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/pkg-simple-b"; then + fail "usr/bin/pkg-simple-b not found in ${arch}/extra${FILESEXT}" fi - if bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra.files.tar.gz" | grep -q "usr/bin/pkg-simple-a"; then - fail "usr/bin/pkg-simple-a still found in ${arch}/extra.files.tar.gz" + if bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/pkg-simple-a"; then + fail "usr/bin/pkg-simple-a still found in ${arch}/extra${FILESEXT}" fi done diff --git a/test/test.d/db-move.sh b/test/test.d/db-move.sh index 57cbf71..40b40de 100755 --- a/test/test.d/db-move.sh +++ b/test/test.d/db-move.sh @@ -27,6 +27,28 @@ testMoveSimplePackages() { done } +testMoveEpochPackages() { + local arches=('i686' 'x86_64') + local pkgs=('pkg-simple-epoch') + local pkgbase + local arch + + for pkgbase in ${pkgs[@]}; do + for arch in ${arches[@]}; do + releasePackage testing ${pkgbase} ${arch} + done + done + + ../db-update + + ../db-move testing extra pkg-simple-epoch + + for arch in ${arches[@]}; do + checkPackage extra pkg-simple-epoch-1:1-1-${arch}.pkg.tar.xz ${arch} + checkRemovedPackage testing pkg-simple-epoch-1:1-1-${arch}.pkg.tar.xz ${arch} + done +} + testMoveAnyPackages() { local pkgs=('pkg-any-a' 'pkg-any-b') local pkgbase @@ -60,12 +82,12 @@ testMoveSplitPackages() { ../db-move testing extra pkg-split-a for arch in ${arches[@]}; do - for pkg in "${pkgdir}/pkg-split-a"/*-${arch}.pkg.tar.*; do + for pkg in "${pkgdir}/pkg-split-a"/*-${arch}${PKGEXT}; do checkPackage extra $(basename ${pkg}) ${arch} done done for arch in ${arches[@]}; do - for pkg in "${pkgdir}/pkg-split-b"/*-${arch}.pkg.tar.*; do + for pkg in "${pkgdir}/pkg-split-b"/*-${arch}${PKGEXT}; do checkPackage testing $(basename ${pkg}) ${arch} done done diff --git a/test/test.d/db-remove.sh b/test/test.d/db-remove.sh index b66466d..573bd71 100755 --- a/test/test.d/db-remove.sh +++ b/test/test.d/db-remove.sh @@ -5,7 +5,7 @@ curdir=$(readlink -e $(dirname $0)) testRemovePackages() { local arches=('i686' 'x86_64') - local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-split-a' 'pkg-split-b') + local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-split-a' 'pkg-split-b' 'pkg-simple-epoch') local pkgbase local arch diff --git a/test/test.d/db-update.sh b/test/test.d/db-update.sh index 5a3d01d..e38c328 100755 --- a/test/test.d/db-update.sh +++ b/test/test.d/db-update.sh @@ -30,6 +30,12 @@ testAddSingleSimplePackage() { checkPackage extra 'pkg-simple-a-1-1-i686.pkg.tar.xz' 'i686' } +testAddSingleEpochPackage() { + releasePackage extra 'pkg-simple-epoch' 'i686' + ../db-update + checkPackage extra 'pkg-simple-epoch-1:1-1-i686.pkg.tar.xz' 'i686' +} + testAddAnyPackages() { local pkgs=('pkg-any-a' 'pkg-any-b') local pkgbase @@ -62,7 +68,7 @@ testAddSplitPackages() { for pkgbase in ${pkgs[@]}; do for arch in ${arches[@]}; do - for pkg in "${pkgdir}/${pkgbase}"/*-${arch}.pkg.tar.*; do + for pkg in "${pkgdir}/${pkgbase}"/*-${arch}${PKGEXT}; do checkPackage extra $(basename ${pkg}) ${arch} done done @@ -76,7 +82,7 @@ testUpdateAnyPackage() { pushd "${TMP}/svn-packages-copy/pkg-any-a/trunk/" >/dev/null sed 's/pkgrel=1/pkgrel=2/g' -i PKGBUILD svn commit -q -m"update pkg to pkgrel=2" >/dev/null - extra-i686-build >/dev/null 2>&1 + sudo extra-i686-build >/dev/null 2>&1 mv pkg-any-a-1-2-any.pkg.tar.xz "${pkgdir}/pkg-any-a/" popd >/dev/null @@ -94,7 +100,7 @@ testUpdateAnyPackageToDifferentRepositoriesAtOnce() { pushd "${TMP}/svn-packages-copy/pkg-any-a/trunk/" >/dev/null sed 's/pkgrel=1/pkgrel=2/g' -i PKGBUILD svn commit -q -m"update pkg to pkgrel=2" >/dev/null - extra-i686-build >/dev/null 2>&1 + sudo extra-i686-build >/dev/null 2>&1 mv pkg-any-a-1-2-any.pkg.tar.xz "${pkgdir}/pkg-any-a/" popd >/dev/null diff --git a/test/test.d/ftpdir-cleanup.sh b/test/test.d/ftpdir-cleanup.sh index e9b977b..77b02b8 100755 --- a/test/test.d/ftpdir-cleanup.sh +++ b/test/test.d/ftpdir-cleanup.sh @@ -34,6 +34,34 @@ testCleanupSimplePackages() { done } +testCleanupEpochPackages() { + local arches=('i686' 'x86_64') + local pkgs=('pkg-simple-epoch') + local pkgbase + local arch + + for pkgbase in ${pkgs[@]}; do + for arch in ${arches[@]}; do + releasePackage extra ${pkgbase} ${arch} + done + done + + ../db-update + + for arch in ${arches[@]}; do + ../db-remove pkg-simple-epoch extra ${arch} + done + + ../cron-jobs/ftpdir-cleanup >/dev/null + + for arch in ${arches[@]}; do + local pkg1="pkg-simple-epoch-1:1-1-${arch}.pkg.tar.xz" + checkRemovedPackage extra 'pkg-simple-epoch' ${arch} + [ -f "${FTP_BASE}/${PKGPOOL}/${pkg1}" ] && fail "${PKGPOOL}/${pkg1} found" + [ -f "${FTP_BASE}/${repo}/os/${arch}/${pkg1}" ] && fail "${repo}/os/${arch}/${pkg1} found" + done +} + testCleanupAnyPackages() { local pkgs=('pkg-any-a' 'pkg-any-b') local pkgbase @@ -78,13 +106,13 @@ testCleanupSplitPackages() { ../cron-jobs/ftpdir-cleanup >/dev/null for arch in ${arches[@]}; do - for pkg in "${pkgdir}/${pkgs[0]}"/*-${arch}.pkg.tar.*; do + for pkg in "${pkgdir}/${pkgs[0]}"/*-${arch}${PKGEXT}; do checkRemovedPackage extra ${pkgs[0]} ${arch} [ -f "${FTP_BASE}/${PKGPOOL}/${pkg}" ] && fail "${PKGPOOL}/${pkg} found" [ -f "${FTP_BASE}/${repo}/os/${arch}/${pkg}" ] && fail "${repo}/os/${arch}/${pkg} found" done - for pkg in "${pkgdir}/${pkgs[1]}"/*-${arch}.pkg.tar.*; do + for pkg in "${pkgdir}/${pkgs[1]}"/*-${arch}${PKGEXT}; do checkPackage extra $(basename ${pkg}) ${arch} done done diff --git a/test/test.d/pool-transition.sh b/test/test.d/pool-transition.sh index 6d82e00..5873f00 100755 --- a/test/test.d/pool-transition.sh +++ b/test/test.d/pool-transition.sh @@ -22,7 +22,7 @@ testMovePackagesWithoutPool() { # transform two packages to old style layout for arch in ${arches[@]}; do for old in 0 2; do - for pkg in "${pkgdir}/${pkgs[${old}]}"/*-${arch}.pkg.tar.*; do + for pkg in "${pkgdir}/${pkgs[${old}]}"/*-${arch}${PKGEXT}; do pkg=$(basename $pkg) mv -f "${FTP_BASE}/${PKGPOOL}/${pkg}" "${FTP_BASE}/testing/os/${arch}/${pkg}" done @@ -37,7 +37,7 @@ testMovePackagesWithoutPool() { for pkgbase in ${pkgs[@]}; do for arch in ${arches[@]}; do - for pkg in "${pkgdir}/${pkgbase}"/*-${arch}.pkg.tar.*; do + for pkg in "${pkgdir}/${pkgbase}"/*-${arch}${PKGEXT}; do checkPackage extra $(basename ${pkg}) ${arch} done checkRemovedPackage testing ${pkgbase} ${arch} @@ -63,7 +63,7 @@ testUpdateAnyPackageWithoutPool() { pushd "${TMP}/svn-packages-copy/${pkgname}/trunk/" >/dev/null sed 's/pkgrel=1/pkgrel=2/g' -i PKGBUILD svn commit -q -m"update pkg to pkgrel=2" >/dev/null - extra-i686-build >/dev/null 2>&1 + sudo extra-i686-build >/dev/null 2>&1 mv "${pkg2}" "${pkgdir}/${pkgname}/" popd >/dev/null @@ -94,7 +94,7 @@ testMoveAnyPackagesWithoutPool() { ../db-update # transform a package to old style layout - for pkg in "${pkgdir}/${pkgs[0]}"/*-any.pkg.tar.*; do + for pkg in "${pkgdir}/${pkgs[0]}"/*-any${PKGEXT}; do pkg=$(basename $pkg) mv -f "${FTP_BASE}/${PKGPOOL}/${pkg}" "${FTP_BASE}/testing/os/any/${pkg}" for arch in i686 x86_64; do @@ -109,13 +109,13 @@ testMoveAnyPackagesWithoutPool() { ../cron-jobs/ftpdir-cleanup >/dev/null for pkgbase in ${pkgs[@]}; do - for pkg in "${pkgdir}/${pkgbase}"/*-any.pkg.tar.*; do + for pkg in "${pkgdir}/${pkgbase}"/*-any${PKGEXT}; do checkAnyPackage extra $(basename ${pkg}) done checkRemovedAnyPackage testing ${pkgbase} done - for pkg in "${pkgdir}/${pkgs[0]}"/*-any.pkg.tar.*; do + for pkg in "${pkgdir}/${pkgs[0]}"/*-any${PKGEXT}; do pkg=$(basename $pkg) for arch in any i686 x86_64; do [ -f "${FTP_BASE}/testing/os/${arch}/${pkg}" ] && fail "testing/os/${arch}/${pkg} found" @@ -131,7 +131,7 @@ testUpdateSameAnyPackageToDifferentRepositoriesWithoutPool() { ../db-update # transform a package to old style layout - for pkg in "${pkgdir}/pkg-any-a"/*-any.pkg.tar.*; do + for pkg in "${pkgdir}/pkg-any-a"/*-any${PKGEXT}; do pkg=$(basename $pkg) mv -f "${FTP_BASE}/${PKGPOOL}/${pkg}" "${FTP_BASE}/extra/os/any/${pkg}" for arch in i686 x86_64; do diff --git a/test/test.d/signed-packages.sh b/test/test.d/signed-packages.sh new file mode 100755 index 0000000..5d6f4ff --- /dev/null +++ b/test/test.d/signed-packages.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +curdir=$(readlink -e $(dirname $0)) +. "${curdir}/../lib/common.inc" + +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!" +} + +. "${curdir}/../lib/shunit2" diff --git a/test/test.d/sourceballs.sh b/test/test.d/sourceballs.sh index 8cba017..11bd0f4 100755 --- a/test/test.d/sourceballs.sh +++ b/test/test.d/sourceballs.sh @@ -5,7 +5,7 @@ curdir=$(readlink -e $(dirname $0)) testSourceballs() { local arches=('i686' 'x86_64') - local pkgs=('pkg-simple-a' 'pkg-simple-b') + local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-simple-epoch') local pkgbase local arch diff --git a/test/test.d/testing2x.sh b/test/test.d/testing2x.sh index 436716d..eda6cd6 100755 --- a/test/test.d/testing2x.sh +++ b/test/test.d/testing2x.sh @@ -10,7 +10,7 @@ testTesting2xAnyPackage() { pushd "${TMP}/svn-packages-copy/pkg-any-a/trunk/" >/dev/null sed 's/pkgrel=1/pkgrel=2/g' -i PKGBUILD svn commit -q -m"update pkg to pkgrel=2" >/dev/null - extra-i686-build >/dev/null 2>&1 + sudo extra-i686-build >/dev/null 2>&1 mv pkg-any-a-1-2-any.pkg.tar.xz "${pkgdir}/pkg-any-a/" popd >/dev/null |