summaryrefslogtreecommitdiff
path: root/test/test.d/db-move.sh
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-11-25 08:18:26 +0100
committerPierre Schmitz <pierre@archlinux.de>2010-11-25 08:18:26 +0100
commit793d78130ba808ee688c8b7139a2bc6180b29534 (patch)
tree465ba7cab4eef1a56ed157e35e8fa20a155b4213 /test/test.d/db-move.sh
parent5f72b8029c07f3357014d8716f18f21ce649c98a (diff)
Split tests into several files
* tests can be run seperatly * runTest will run all tests that have the x bit set
Diffstat (limited to 'test/test.d/db-move.sh')
-rwxr-xr-xtest/test.d/db-move.sh76
1 files changed, 76 insertions, 0 deletions
diff --git a/test/test.d/db-move.sh b/test/test.d/db-move.sh
new file mode 100755
index 0000000..57cbf71
--- /dev/null
+++ b/test/test.d/db-move.sh
@@ -0,0 +1,76 @@
+#!/bin/bash
+
+curdir=$(readlink -e $(dirname $0))
+. "${curdir}/../lib/common.inc"
+
+testMoveSimplePackages() {
+ local arches=('i686' 'x86_64')
+ local pkgs=('pkg-simple-a' 'pkg-simple-b')
+ 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-a
+
+ for arch in ${arches[@]}; do
+ checkPackage extra pkg-simple-a-1-1-${arch}.pkg.tar.xz ${arch}
+ checkRemovedPackage testing pkg-simple-a-1-1-${arch}.pkg.tar.xz ${arch}
+
+ checkPackage testing pkg-simple-b-1-1-${arch}.pkg.tar.xz ${arch}
+ done
+}
+
+testMoveAnyPackages() {
+ local pkgs=('pkg-any-a' 'pkg-any-b')
+ local pkgbase
+
+ for pkgbase in ${pkgs[@]}; do
+ releasePackage testing ${pkgbase} any
+ done
+
+ ../db-update
+ ../db-move testing extra pkg-any-a
+
+ checkAnyPackage extra pkg-any-a-1-1-any.pkg.tar.xz
+ checkRemovedAnyPackage testing pkg-any-a
+ checkAnyPackage testing pkg-any-b-1-1-any.pkg.tar.xz
+}
+
+testMoveSplitPackages() {
+ local arches=('i686' 'x86_64')
+ local pkgs=('pkg-split-a' 'pkg-split-b')
+ local pkg
+ 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-split-a
+
+ for arch in ${arches[@]}; do
+ for pkg in "${pkgdir}/pkg-split-a"/*-${arch}.pkg.tar.*; do
+ checkPackage extra $(basename ${pkg}) ${arch}
+ done
+ done
+ for arch in ${arches[@]}; do
+ for pkg in "${pkgdir}/pkg-split-b"/*-${arch}.pkg.tar.*; do
+ checkPackage testing $(basename ${pkg}) ${arch}
+ done
+ done
+
+ checkRemovedAnyPackage testing pkg-split-a
+}
+
+. "${curdir}/../lib/shunit2"