From 793d78130ba808ee688c8b7139a2bc6180b29534 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 25 Nov 2010 08:18:26 +0100 Subject: Split tests into several files * tests can be run seperatly * runTest will run all tests that have the x bit set --- test/test.d/db-move.sh | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100755 test/test.d/db-move.sh (limited to 'test/test.d/db-move.sh') 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" -- cgit v1.2.3-54-g00ecf