From 2b7bb0c6b7aa4f7a43c82db1cf9a18d27600c62e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 18 Dec 2011 14:16:30 +0100 Subject: Validate package signatures on db-update --- test/test.d/signed-packages.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'test/test.d') diff --git a/test/test.d/signed-packages.sh b/test/test.d/signed-packages.sh index 5d6f4ff..20ad844 100755 --- a/test/test.d/signed-packages.sh +++ b/test/test.d/signed-packages.sh @@ -5,9 +5,27 @@ curdir=$(readlink -e $(dirname $0)) 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!" } +testAddInvalidSignedPackage() { + local p + releasePackage extra 'pkg-simple-a' 'i686' + for p in "${STAGING}"/extra/*${PKGEXT}; do + unxz $p + xz -0 ${p%%.xz} + done + ../db-update >/dev/null 2>&1 && fail "db-update should fail when a signature is invalid!" +} + +testAddBrokenSignature() { + local s + releasePackage extra 'pkg-simple-a' 'i686' + for s in "${STAGING}"/extra/*.sig; do + echo 0 > $s + done + ../db-update >/dev/null 2>&1 && fail "db-update should fail when a signature is broken!" +} + . "${curdir}/../lib/shunit2" -- cgit v1.2.3-2-g168b From 5c7220a4aa370d1f726eb27d99d8f9294646433d Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 19 Dec 2011 14:40:07 +0100 Subject: Avoid calls to basename --- test/test.d/db-move.sh | 4 ++-- test/test.d/db-update.sh | 2 +- test/test.d/ftpdir-cleanup.sh | 2 +- test/test.d/pool-transition.sh | 12 ++++++------ 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'test/test.d') diff --git a/test/test.d/db-move.sh b/test/test.d/db-move.sh index 9d7c1f6..890ffc4 100755 --- a/test/test.d/db-move.sh +++ b/test/test.d/db-move.sh @@ -107,12 +107,12 @@ testMoveSplitPackages() { for arch in ${arches[@]}; do for pkg in "${pkgdir}/pkg-split-a"/*-${arch}${PKGEXT}; do - checkPackage extra $(basename ${pkg}) ${arch} + checkPackage extra ${pkg##*/} ${arch} done done for arch in ${arches[@]}; do for pkg in "${pkgdir}/pkg-split-b"/*-${arch}${PKGEXT}; do - checkPackage testing $(basename ${pkg}) ${arch} + checkPackage testing ${pkg##*/} ${arch} done done diff --git a/test/test.d/db-update.sh b/test/test.d/db-update.sh index e38c328..2021993 100755 --- a/test/test.d/db-update.sh +++ b/test/test.d/db-update.sh @@ -69,7 +69,7 @@ testAddSplitPackages() { for pkgbase in ${pkgs[@]}; do for arch in ${arches[@]}; do for pkg in "${pkgdir}/${pkgbase}"/*-${arch}${PKGEXT}; do - checkPackage extra $(basename ${pkg}) ${arch} + checkPackage extra ${pkg##*/} ${arch} done done done diff --git a/test/test.d/ftpdir-cleanup.sh b/test/test.d/ftpdir-cleanup.sh index 20026b4..bfea7ea 100755 --- a/test/test.d/ftpdir-cleanup.sh +++ b/test/test.d/ftpdir-cleanup.sh @@ -113,7 +113,7 @@ testCleanupSplitPackages() { done for pkg in "${pkgdir}/${pkgs[1]}"/*-${arch}${PKGEXT}; do - checkPackage extra $(basename ${pkg}) ${arch} + checkPackage extra ${pkg##*/} ${arch} done done } diff --git a/test/test.d/pool-transition.sh b/test/test.d/pool-transition.sh index 5873f00..4912968 100755 --- a/test/test.d/pool-transition.sh +++ b/test/test.d/pool-transition.sh @@ -23,7 +23,7 @@ testMovePackagesWithoutPool() { for arch in ${arches[@]}; do for old in 0 2; do for pkg in "${pkgdir}/${pkgs[${old}]}"/*-${arch}${PKGEXT}; do - pkg=$(basename $pkg) + pkg=${pkg##*/} mv -f "${FTP_BASE}/${PKGPOOL}/${pkg}" "${FTP_BASE}/testing/os/${arch}/${pkg}" done done @@ -38,7 +38,7 @@ testMovePackagesWithoutPool() { for pkgbase in ${pkgs[@]}; do for arch in ${arches[@]}; do for pkg in "${pkgdir}/${pkgbase}"/*-${arch}${PKGEXT}; do - checkPackage extra $(basename ${pkg}) ${arch} + checkPackage extra ${pkg##*/} ${arch} done checkRemovedPackage testing ${pkgbase} ${arch} done @@ -95,7 +95,7 @@ testMoveAnyPackagesWithoutPool() { # transform a package to old style layout for pkg in "${pkgdir}/${pkgs[0]}"/*-any${PKGEXT}; do - pkg=$(basename $pkg) + pkg=${pkg##*/} mv -f "${FTP_BASE}/${PKGPOOL}/${pkg}" "${FTP_BASE}/testing/os/any/${pkg}" for arch in i686 x86_64; do ln -sf "../any/${pkg}" "${FTP_BASE}/testing/os/${arch}/${pkg}" @@ -110,13 +110,13 @@ testMoveAnyPackagesWithoutPool() { for pkgbase in ${pkgs[@]}; do for pkg in "${pkgdir}/${pkgbase}"/*-any${PKGEXT}; do - checkAnyPackage extra $(basename ${pkg}) + checkAnyPackage extra ${pkg##*/} done checkRemovedAnyPackage testing ${pkgbase} done for pkg in "${pkgdir}/${pkgs[0]}"/*-any${PKGEXT}; do - pkg=$(basename $pkg) + pkg=${pkg##*/} for arch in any i686 x86_64; do [ -f "${FTP_BASE}/testing/os/${arch}/${pkg}" ] && fail "testing/os/${arch}/${pkg} found" done @@ -132,7 +132,7 @@ testUpdateSameAnyPackageToDifferentRepositoriesWithoutPool() { # transform a package to old style layout for pkg in "${pkgdir}/pkg-any-a"/*-any${PKGEXT}; do - pkg=$(basename $pkg) + pkg=${pkg##*/} mv -f "${FTP_BASE}/${PKGPOOL}/${pkg}" "${FTP_BASE}/extra/os/any/${pkg}" for arch in i686 x86_64; do ln -sf "../any/${pkg}" "${FTP_BASE}/extra/os/${arch}/${pkg}" -- cgit v1.2.3-2-g168b From 8d85e0d1617fa319701e1c18b2dfb63ee7012fe7 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 19 Feb 2012 02:21:11 +0100 Subject: Add at least one positive signing test --- test/test.d/signed-packages.sh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/test.d') diff --git a/test/test.d/signed-packages.sh b/test/test.d/signed-packages.sh index 20ad844..03566ef 100755 --- a/test/test.d/signed-packages.sh +++ b/test/test.d/signed-packages.sh @@ -3,6 +3,11 @@ curdir=$(readlink -e $(dirname $0)) . "${curdir}/../lib/common.inc" +testAddSignedPackage() { + releasePackage extra 'pkg-simple-a' 'i686' + ../db-update || fail "db-update failed!" +} + testAddUnsignedPackage() { releasePackage extra 'pkg-simple-a' 'i686' rm "${STAGING}"/extra/*.sig -- cgit v1.2.3-2-g168b From c639ae7d7a9fa5544d495e0b4d4f3b49611a7af9 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 10 Jun 2012 11:45:59 +0200 Subject: Remove support for packages in legacy $repo/os/any directories --- test/test.d/pool-transition.sh | 104 ----------------------------------------- 1 file changed, 104 deletions(-) (limited to 'test/test.d') diff --git a/test/test.d/pool-transition.sh b/test/test.d/pool-transition.sh index 4912968..7880b0a 100755 --- a/test/test.d/pool-transition.sh +++ b/test/test.d/pool-transition.sh @@ -45,108 +45,4 @@ testMovePackagesWithoutPool() { done } -testUpdateAnyPackageWithoutPool() { - local pkgname='pkg-any-a' - local pkg1='pkg-any-a-1-1-any.pkg.tar.xz' - local pkg2='pkg-any-a-1-2-any.pkg.tar.xz' - local arch - - - releasePackage extra pkg-any-a any - ../db-update - # transform two packages to old style layout - mv -f "${FTP_BASE}/${PKGPOOL}/${pkg1}" "${FTP_BASE}/extra/os/any" - for arch in i686 x86_64; do - ln -sf "../any/${pkg1}" "${FTP_BASE}/extra/os/${arch}" - done - - 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 - sudo extra-i686-build >/dev/null 2>&1 - mv "${pkg2}" "${pkgdir}/${pkgname}/" - popd >/dev/null - - releasePackage extra ${pkgname} any - ../db-update - rm -f "${pkgdir}/${pkgname}/${pkg2}" - - ../cron-jobs/ftpdir-cleanup >/dev/null - - checkAnyPackage extra "${pkg2}" - - [ -f "${FTP_BASE}/${PKGPOOL}/${pkg1}" ] && fail "${PKGPOOL}/${pkg1} found" - for arch in any i686 x86_64; do - [ -f "${FTP_BASE}/extra/os/${arch}/${pkg1}" ] && fail "extra/os/${arch}/${pkg1} found" - done -} - -testMoveAnyPackagesWithoutPool() { - local pkgs=('pkg-any-a' 'pkg-any-b') - local pkgbase - local arch - local pkg - - for pkgbase in ${pkgs[@]}; do - releasePackage testing ${pkgbase} any - done - - ../db-update - - # transform a package to old style layout - for pkg in "${pkgdir}/${pkgs[0]}"/*-any${PKGEXT}; do - pkg=${pkg##*/} - mv -f "${FTP_BASE}/${PKGPOOL}/${pkg}" "${FTP_BASE}/testing/os/any/${pkg}" - for arch in i686 x86_64; do - ln -sf "../any/${pkg}" "${FTP_BASE}/testing/os/${arch}/${pkg}" - done - done - - ../cron-jobs/ftpdir-cleanup >/dev/null - - ../db-move testing extra ${pkgs[@]} - - ../cron-jobs/ftpdir-cleanup >/dev/null - - for pkgbase in ${pkgs[@]}; do - for pkg in "${pkgdir}/${pkgbase}"/*-any${PKGEXT}; do - checkAnyPackage extra ${pkg##*/} - done - checkRemovedAnyPackage testing ${pkgbase} - done - - for pkg in "${pkgdir}/${pkgs[0]}"/*-any${PKGEXT}; do - pkg=${pkg##*/} - for arch in any i686 x86_64; do - [ -f "${FTP_BASE}/testing/os/${arch}/${pkg}" ] && fail "testing/os/${arch}/${pkg} found" - done - done -} - -testUpdateSameAnyPackageToDifferentRepositoriesWithoutPool() { - local pkg - local arch - - releasePackage extra pkg-any-a any - ../db-update - - # transform a package to old style layout - for pkg in "${pkgdir}/pkg-any-a"/*-any${PKGEXT}; do - pkg=${pkg##*/} - mv -f "${FTP_BASE}/${PKGPOOL}/${pkg}" "${FTP_BASE}/extra/os/any/${pkg}" - for arch in i686 x86_64; do - ln -sf "../any/${pkg}" "${FTP_BASE}/extra/os/${arch}/${pkg}" - done - done - - releasePackage testing pkg-any-a any - ../db-update >/dev/null 2>&1 && (fail 'Adding an existing package to another repository should fail'; return 1) - - for arch in i686 x86_64; do - ( [ -r "${FTP_BASE}/testing/os/${arch}/testing${DBEXT%.tar.*}" ] \ - && bsdtar -xf "${FTP_BASE}/testing/os/${arch}/testing${DBEXT%.tar.*}" -O | grep -q pkg-any-a) \ - && fail "pkg-any-a should not be in testing/os/${arch}/testing${DBEXT%.tar.*}" - done -} - . "${curdir}/../lib/shunit2" -- cgit v1.2.3-2-g168b From fe19d9cff1cb41ed8456e4cce7be474599cbf503 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 10 Jun 2012 12:02:50 +0200 Subject: Remove support for packages that are not in the package pool --- test/test.d/pool-transition.sh | 48 ------------------------------------------ 1 file changed, 48 deletions(-) delete mode 100755 test/test.d/pool-transition.sh (limited to 'test/test.d') diff --git a/test/test.d/pool-transition.sh b/test/test.d/pool-transition.sh deleted file mode 100755 index 7880b0a..0000000 --- a/test/test.d/pool-transition.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -curdir=$(readlink -e $(dirname $0)) -. "${curdir}/../lib/common.inc" - -testMovePackagesWithoutPool() { - local arches=('i686' 'x86_64') - local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-split-a' 'pkg-split-b') - local pkgbase - local arch - local pkg - local old - - for pkgbase in ${pkgs[@]}; do - for arch in ${arches[@]}; do - releasePackage testing ${pkgbase} ${arch} - done - done - - ../db-update - - # 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}${PKGEXT}; do - pkg=${pkg##*/} - mv -f "${FTP_BASE}/${PKGPOOL}/${pkg}" "${FTP_BASE}/testing/os/${arch}/${pkg}" - done - done - done - - ../cron-jobs/ftpdir-cleanup >/dev/null - - ../db-move testing extra ${pkgs[@]} - - ../cron-jobs/ftpdir-cleanup >/dev/null - - for pkgbase in ${pkgs[@]}; do - for arch in ${arches[@]}; do - for pkg in "${pkgdir}/${pkgbase}"/*-${arch}${PKGEXT}; do - checkPackage extra ${pkg##*/} ${arch} - done - checkRemovedPackage testing ${pkgbase} ${arch} - done - done -} - -. "${curdir}/../lib/shunit2" -- cgit v1.2.3-2-g168b From b0047186ad33c5ef8bb6560dd9ba4d8a724dabce Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 3 Oct 2012 14:49:02 +0200 Subject: test: Do not suppress devtools output --- test/test.d/db-update.sh | 4 ++-- test/test.d/testing2x.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'test/test.d') diff --git a/test/test.d/db-update.sh b/test/test.d/db-update.sh index 2021993..67bca9f 100755 --- a/test/test.d/db-update.sh +++ b/test/test.d/db-update.sh @@ -82,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 - sudo extra-i686-build >/dev/null 2>&1 + sudo extra-i686-build mv pkg-any-a-1-2-any.pkg.tar.xz "${pkgdir}/pkg-any-a/" popd >/dev/null @@ -100,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 - sudo extra-i686-build >/dev/null 2>&1 + sudo extra-i686-build mv pkg-any-a-1-2-any.pkg.tar.xz "${pkgdir}/pkg-any-a/" popd >/dev/null diff --git a/test/test.d/testing2x.sh b/test/test.d/testing2x.sh index eda6cd6..357f3c2 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 - sudo extra-i686-build >/dev/null 2>&1 + sudo extra-i686-build mv pkg-any-a-1-2-any.pkg.tar.xz "${pkgdir}/pkg-any-a/" popd >/dev/null -- cgit v1.2.3-2-g168b From b2952784db9995ecc21d3a770530a19394234d3b Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 27 Oct 2012 14:32:39 +0200 Subject: Add the possibility to run all svn commands with a different user * A SVNUSER can be configured in the config file * This user needs to be able to call svn without a password --- test/test.d/db-update.sh | 4 ++-- test/test.d/testing2x.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'test/test.d') diff --git a/test/test.d/db-update.sh b/test/test.d/db-update.sh index 67bca9f..ea1e130 100755 --- a/test/test.d/db-update.sh +++ b/test/test.d/db-update.sh @@ -81,7 +81,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 + arch_svn commit -q -m"update pkg to pkgrel=2" >/dev/null sudo extra-i686-build mv pkg-any-a-1-2-any.pkg.tar.xz "${pkgdir}/pkg-any-a/" popd >/dev/null @@ -99,7 +99,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 + arch_svn commit -q -m"update pkg to pkgrel=2" >/dev/null sudo extra-i686-build mv pkg-any-a-1-2-any.pkg.tar.xz "${pkgdir}/pkg-any-a/" popd >/dev/null diff --git a/test/test.d/testing2x.sh b/test/test.d/testing2x.sh index 357f3c2..31d85b4 100755 --- a/test/test.d/testing2x.sh +++ b/test/test.d/testing2x.sh @@ -9,7 +9,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 + arch_svn commit -q -m"update pkg to pkgrel=2" >/dev/null sudo extra-i686-build mv pkg-any-a-1-2-any.pkg.tar.xz "${pkgdir}/pkg-any-a/" popd >/dev/null -- cgit v1.2.3-2-g168b From 0992cc36f525898ff07032d0ee697ecb62fedc07 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 31 Jan 2013 23:24:07 +0100 Subject: db-update: Ignore forgeign staging packages --- test/test.d/db-update.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/test.d') diff --git a/test/test.d/db-update.sh b/test/test.d/db-update.sh index ea1e130..7a5ce4c 100755 --- a/test/test.d/db-update.sh +++ b/test/test.d/db-update.sh @@ -162,4 +162,14 @@ testAddIncompleteSplitPackage() { done } +testUnknownRepo() { + mkdir "${STAGING}/unknown/" + releasePackage extra 'pkg-simple-a' 'i686' + releasePackage unknown 'pkg-simple-b' 'i686' + ../db-update + checkPackage extra 'pkg-simple-a-1-1-i686.pkg.tar.xz' 'i686' + [ -e "${FTP_BASE}/unknown" ] && fail "db-update pushed a package into an unknown repository" + rm -rf "${STAGING}/unknown/" +} + . "${curdir}/../lib/shunit2" -- cgit v1.2.3-2-g168b From 86aeadb4c3d56f168e0bce34e0e2fa06c1ccb78b Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 12 Jun 2013 19:30:34 -0600 Subject: test/: use libremakepkg instead of arch-*build --- test/test.d/db-update.sh | 4 ++-- test/test.d/testing2x.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'test/test.d') diff --git a/test/test.d/db-update.sh b/test/test.d/db-update.sh index 7a5ce4c..4b3008e 100755 --- a/test/test.d/db-update.sh +++ b/test/test.d/db-update.sh @@ -82,7 +82,7 @@ testUpdateAnyPackage() { 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 extra-i686-build + sudo libremakepkg mv pkg-any-a-1-2-any.pkg.tar.xz "${pkgdir}/pkg-any-a/" popd >/dev/null @@ -100,7 +100,7 @@ testUpdateAnyPackageToDifferentRepositoriesAtOnce() { 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 extra-i686-build + sudo libremakepkg mv pkg-any-a-1-2-any.pkg.tar.xz "${pkgdir}/pkg-any-a/" popd >/dev/null diff --git a/test/test.d/testing2x.sh b/test/test.d/testing2x.sh index 31d85b4..0c2fa83 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 arch_svn commit -q -m"update pkg to pkgrel=2" >/dev/null - sudo extra-i686-build + sudo libremakepkg mv pkg-any-a-1-2-any.pkg.tar.xz "${pkgdir}/pkg-any-a/" popd >/dev/null -- cgit v1.2.3-2-g168b From 5ba4756a52e8f1280d4dbcff62dec4a4aeb47d1c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 12 Jun 2013 19:32:48 -0600 Subject: Don't make assumptions about the host architecture. --- test/test.d/create-filelists.sh | 8 ++++---- test/test.d/db-move.sh | 8 ++++---- test/test.d/db-remove.sh | 4 ++-- test/test.d/db-repo-add.sh | 4 ++-- test/test.d/db-repo-remove.sh | 4 ++-- test/test.d/db-update.sh | 8 ++++---- test/test.d/ftpdir-cleanup.sh | 6 +++--- test/test.d/sourceballs.sh | 6 +++--- 8 files changed, 24 insertions(+), 24 deletions(-) (limited to 'test/test.d') diff --git a/test/test.d/create-filelists.sh b/test/test.d/create-filelists.sh index 49734c4..8df7030 100755 --- a/test/test.d/create-filelists.sh +++ b/test/test.d/create-filelists.sh @@ -4,7 +4,7 @@ curdir=$(readlink -e $(dirname $0)) . "${curdir}/../lib/common.inc" testCreateSimpleFileLists() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-simple-epoch') local pkgbase local arch @@ -26,7 +26,7 @@ testCreateSimpleFileLists() { } testCreateAnyFileLists() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-any-a' 'pkg-any-b') local pkgbase local arch @@ -46,7 +46,7 @@ testCreateAnyFileLists() { } testCreateSplitFileLists() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-split-a' 'pkg-split-b') local pkg local pkgbase @@ -75,7 +75,7 @@ testCreateSplitFileLists() { testCleanupFileLists() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase local arch diff --git a/test/test.d/db-move.sh b/test/test.d/db-move.sh index 890ffc4..3cf355b 100755 --- a/test/test.d/db-move.sh +++ b/test/test.d/db-move.sh @@ -4,7 +4,7 @@ curdir=$(readlink -e $(dirname $0)) . "${curdir}/../lib/common.inc" testMoveSimplePackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase local arch @@ -28,7 +28,7 @@ testMoveSimplePackages() { } testMoveMultiplePackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase local arch @@ -52,7 +52,7 @@ testMoveMultiplePackages() { } testMoveEpochPackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-epoch') local pkgbase local arch @@ -90,7 +90,7 @@ testMoveAnyPackages() { } testMoveSplitPackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-split-a' 'pkg-split-b') local pkg local pkgbase diff --git a/test/test.d/db-remove.sh b/test/test.d/db-remove.sh index 416e693..d79605e 100755 --- a/test/test.d/db-remove.sh +++ b/test/test.d/db-remove.sh @@ -4,7 +4,7 @@ curdir=$(readlink -e $(dirname $0)) . "${curdir}/../lib/common.inc" testRemovePackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-split-a' 'pkg-split-b' 'pkg-simple-epoch') local pkgbase local arch @@ -31,7 +31,7 @@ testRemovePackages() { } testRemoveMultiplePackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) 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-repo-add.sh b/test/test.d/db-repo-add.sh index 8603104..09fc52f 100755 --- a/test/test.d/db-repo-add.sh +++ b/test/test.d/db-repo-add.sh @@ -4,7 +4,7 @@ curdir=$(readlink -e $(dirname $0)) . "${curdir}/../lib/common.inc" testAddSimplePackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase local arch @@ -27,7 +27,7 @@ testAddSimplePackages() { } testAddMultiplePackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase local arch diff --git a/test/test.d/db-repo-remove.sh b/test/test.d/db-repo-remove.sh index 315d63d..eec0109 100755 --- a/test/test.d/db-repo-remove.sh +++ b/test/test.d/db-repo-remove.sh @@ -4,7 +4,7 @@ curdir=$(readlink -e $(dirname $0)) . "${curdir}/../lib/common.inc" testRemovePackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-simple-epoch') local pkgbase local arch @@ -31,7 +31,7 @@ testRemovePackages() { } testRemoveMultiplePackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-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 4b3008e..4e77140 100755 --- a/test/test.d/db-update.sh +++ b/test/test.d/db-update.sh @@ -4,7 +4,7 @@ curdir=$(readlink -e $(dirname $0)) . "${curdir}/../lib/common.inc" testAddSimplePackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase local arch @@ -52,7 +52,7 @@ testAddAnyPackages() { } testAddSplitPackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-split-a' 'pkg-split-b') local pkg local pkgbase @@ -132,7 +132,7 @@ testUpdateSameAnyPackageToDifferentRepositories() { ../db-update >/dev/null 2>&1 && (fail 'Adding an existing package to another repository should fail'; return 1) local arch - for arch in i686 x86_64; do + for arch in $(arches); do ( [ -r "${FTP_BASE}/testing/os/${arch}/testing${DBEXT%.tar.*}" ] \ && bsdtar -xf "${FTP_BASE}/testing/os/${arch}/testing${DBEXT%.tar.*}" -O | grep -q ${pkgbase}) \ && fail "${pkgbase} should not be in testing/os/${arch}/testing${DBEXT%.tar.*}" @@ -141,7 +141,7 @@ testUpdateSameAnyPackageToDifferentRepositories() { testAddIncompleteSplitPackage() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local repo='extra' local pkgbase='pkg-split-a' local arch diff --git a/test/test.d/ftpdir-cleanup.sh b/test/test.d/ftpdir-cleanup.sh index bfea7ea..630b88f 100755 --- a/test/test.d/ftpdir-cleanup.sh +++ b/test/test.d/ftpdir-cleanup.sh @@ -4,7 +4,7 @@ curdir=$(readlink -e $(dirname $0)) . "${curdir}/../lib/common.inc" testCleanupSimplePackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase local arch @@ -35,7 +35,7 @@ testCleanupSimplePackages() { } testCleanupEpochPackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-epoch') local pkgbase local arch @@ -85,7 +85,7 @@ testCleanupAnyPackages() { } testCleanupSplitPackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-split-a' 'pkg-split-b') local pkg local pkgbase diff --git a/test/test.d/sourceballs.sh b/test/test.d/sourceballs.sh index fdcf08c..472cb30 100755 --- a/test/test.d/sourceballs.sh +++ b/test/test.d/sourceballs.sh @@ -4,7 +4,7 @@ curdir=$(readlink -e $(dirname $0)) . "${curdir}/../lib/common.inc" testSourceballs() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-simple-epoch') local pkgbase local arch @@ -38,7 +38,7 @@ testAnySourceballs() { } testSplitSourceballs() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-split-a' 'pkg-split-b') local pkg local pkgbase @@ -59,7 +59,7 @@ testSplitSourceballs() { } testSourceballsCleanup() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase local arch -- cgit v1.2.3-2-g168b From d0e9909ce3419c36e134227318a29f2f1fd782a2 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 15 Jun 2013 13:57:35 -0600 Subject: fix tests - properly set SRCPOOL - have SVNREPO point to the checkout, not the server repo - in case TMPDIR has a symlink in it, use `readlink -e` on both sides of inspecting symlinks. - use `grep {pattern} &>/dev/null` instead of `grep -q {pattern}`. Because `grep -q` is able to bail early, a program being piped in to it may spit out a message about a write error to stderr. --- test/test.d/create-filelists.sh | 10 +++++----- test/test.d/db-update.sh | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'test/test.d') diff --git a/test/test.d/create-filelists.sh b/test/test.d/create-filelists.sh index 8df7030..e78bde8 100755 --- a/test/test.d/create-filelists.sh +++ b/test/test.d/create-filelists.sh @@ -18,7 +18,7 @@ testCreateSimpleFileLists() { for pkgbase in ${pkgs[@]}; do for arch in ${arches[@]}; do - if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/${pkgbase}"; then + if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep "usr/bin/${pkgbase}" &>/dev/null; then fail "usr/bin/${pkgbase} not found in ${arch}/extra${FILESEXT}" fi done @@ -38,7 +38,7 @@ testCreateAnyFileLists() { for pkgbase in ${pkgs[@]}; do for arch in ${arches[@]}; do - if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/share/${pkgbase}/test"; then + if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep "usr/share/${pkgbase}/test" &>/dev/null; then fail "usr/share/${pkgbase}/test not found in ${arch}/extra${FILESEXT}" fi done @@ -65,7 +65,7 @@ testCreateSplitFileLists() { 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${FILESEXT}" | grep -q "usr/bin/${pkgname}"; then + if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep "usr/bin/${pkgname}" &>/dev/null; then fail "usr/bin/${pkgname} not found in ${arch}/extra${FILESEXT}" fi done @@ -92,10 +92,10 @@ testCleanupFileLists() { done for arch in ${arches[@]}; do - if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/pkg-simple-b"; then + if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep "usr/bin/pkg-simple-b" &>/dev/null; then fail "usr/bin/pkg-simple-b not found in ${arch}/extra${FILESEXT}" fi - if bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/pkg-simple-a"; then + if bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep "usr/bin/pkg-simple-a" &>/dev/null; then fail "usr/bin/pkg-simple-a still found in ${arch}/extra${FILESEXT}" fi done diff --git a/test/test.d/db-update.sh b/test/test.d/db-update.sh index 4e77140..7f1874b 100755 --- a/test/test.d/db-update.sh +++ b/test/test.d/db-update.sh @@ -134,7 +134,7 @@ testUpdateSameAnyPackageToDifferentRepositories() { local arch for arch in $(arches); do ( [ -r "${FTP_BASE}/testing/os/${arch}/testing${DBEXT%.tar.*}" ] \ - && bsdtar -xf "${FTP_BASE}/testing/os/${arch}/testing${DBEXT%.tar.*}" -O | grep -q ${pkgbase}) \ + && bsdtar -xf "${FTP_BASE}/testing/os/${arch}/testing${DBEXT%.tar.*}" -O | grep ${pkgbase} &>/dev/null) \ && fail "${pkgbase} should not be in testing/os/${arch}/testing${DBEXT%.tar.*}" done } @@ -157,7 +157,7 @@ testAddIncompleteSplitPackage() { 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}) \ + && bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" -O | grep ${pkgbase} &>/dev/null) \ && fail "${pkgbase} should not be in ${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" done } -- cgit v1.2.3-2-g168b