summaryrefslogtreecommitdiffstats
path: root/test/runTest
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-09-05 13:32:27 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-09-05 13:32:27 +0200
commit6f29ee2f02c2a8e2991599ce1d76a59b58a7ee67 (patch)
treed5bea9dd1cc7109f616f56507ceb80626fd606a0 /test/runTest
parentcca13c2b41ba1389ce4187a728e05a376ad3ad0d (diff)
downloaddbscripts-6f29ee2f02c2a8e2991599ce1d76a59b58a7ee67.tar.gz
dbscripts-6f29ee2f02c2a8e2991599ce1d76a59b58a7ee67.tar.xz
Check if package exists in any other repository on update20100906
This also checks if the sam package exists within the old package layout (without package pool)
Diffstat (limited to 'test/runTest')
-rwxr-xr-xtest/runTest45
1 files changed, 44 insertions, 1 deletions
diff --git a/test/runTest b/test/runTest
index e254de0..b07b099 100755
--- a/test/runTest
+++ b/test/runTest
@@ -106,7 +106,7 @@ testUpdateAnyPackage() {
rm "${pkgdir}/pkg-any-a/pkg-any-a-1-2-any.pkg.tar.xz"
}
-testUpdateAnyPackageInDifferentRepositoriesAtOnce() {
+testUpdateAnyPackageToDifferentRepositoriesAtOnce() {
releasePackage extra pkg-any-a any
pushd "${TMP}/svn-packages-copy/pkg-any-a/trunk/" >/dev/null
@@ -126,6 +126,22 @@ testUpdateAnyPackageInDifferentRepositoriesAtOnce() {
rm "${pkgdir}/pkg-any-a/pkg-any-a-1-2-any.pkg.tar.xz"
}
+testUpdateSameAnyPackageToDifferentRepositories() {
+ releasePackage extra pkg-any-a any
+ ../db-update
+ checkAnyPackage extra pkg-any-a-1-1-any.pkg.tar.xz any
+
+ releasePackage testing pkg-any-a any
+ ../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
+ ( [ -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
+}
+
#
# db-remove
#
@@ -493,4 +509,31 @@ testMoveAnyPackagesWithoutPool() {
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.pkg.tar.*; do
+ pkg=$(basename $pkg)
+ mv -f "${FTP_BASE}/$(get_pkgpool_for_host)/${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"