summaryrefslogtreecommitdiffstats
path: root/test/runTest
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-08-08 02:51:51 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-08-08 02:51:51 +0200
commit918eaba387411a2f447f1669f255bcd2fb681e94 (patch)
tree78c0b68734724a5044cdbb600f8021fc338f141b /test/runTest
parent3e08da59e3ca3849b753318b791aed8f1f8d8fb4 (diff)
downloaddbscripts-918eaba387411a2f447f1669f255bcd2fb681e94.tar.gz
dbscripts-918eaba387411a2f447f1669f255bcd2fb681e94.tar.xz
add transitions tests
Theses tests simulate the case of packages with the old repo layout and the new package pool layout.
Diffstat (limited to 'test/runTest')
-rwxr-xr-xtest/runTest86
1 files changed, 86 insertions, 0 deletions
diff --git a/test/runTest b/test/runTest
index 7136508..d453493 100755
--- a/test/runTest
+++ b/test/runTest
@@ -303,5 +303,91 @@ testCleanupSplitPackages() {
done
}
+#
+# transition tests
+#
+
+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 testing
+
+ # 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
+ pkg=$(basename $pkg)
+ mv -f "${FTP_BASE}/packages/arch/${arch}/${pkg}" "${FTP_BASE}/testing/os/${arch}/${pkg}"
+ done
+ done
+ done
+
+ ../cron-jobs/ftpdir-cleanup
+
+ for pkgbase in ${pkgs[@]}; do
+ for arch in ${arches[@]}; do
+ ../db-move ${pkgbase} testing extra ${arch}
+ done
+ done
+
+ ../cron-jobs/ftpdir-cleanup
+
+ for pkgbase in ${pkgs[@]}; do
+ for arch in ${arches[@]}; do
+ for pkg in "${pkgdir}/${pkgbase}"/*-${arch}.pkg.tar.*; do
+ checkPackage extra $(basename ${pkg}) ${arch}
+ done
+ checkRemovedPackage testing ${pkgbase} ${arch}
+ done
+ 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 testing
+
+ # transform a package to old style layout
+ for pkg in "${pkgdir}/${pkgs[0]}"/*-any.pkg.tar.*; do
+ pkg=$(basename $pkg)
+ mv -f "${FTP_BASE}/packages/arch/any/${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
+
+ for pkgbase in ${pkgs[@]}; do
+ ../db-move ${pkgbase} testing extra any
+ done
+
+ ../cron-jobs/ftpdir-cleanup
+
+ for pkgbase in ${pkgs[@]}; do
+ for pkg in "${pkgdir}/${pkgbase}"/*-any.pkg.tar.*; do
+ checkAnyPackage extra $(basename ${pkg})
+ done
+ checkRemovedAnyPackage testing ${pkgbase}
+ done
+}
. "${curdir}/lib/shunit2"