diff options
Diffstat (limited to 'test/runTest')
-rwxr-xr-x | test/runTest | 45 |
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" |