summaryrefslogtreecommitdiff
path: root/test/test.d/db-remove.sh
diff options
context:
space:
mode:
authorJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-04-16 00:44:41 -0500
committerJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-04-16 00:44:41 -0500
commit7203e2e2631e29a79f4ea822c371d4e12c9c1a88 (patch)
treef0ada9061babb0f656afa90e438bba0f0f781241 /test/test.d/db-remove.sh
parentdeab65fad4ced009fb31f7033b1db8ef0af78aee (diff)
parent229a9c504cbd733c93cf91399dc54bedf5160cc5 (diff)
Merge branch 'master' of ~/packages/dbscripts into prueba
Conflicts: .gitignore db-functions
Diffstat (limited to 'test/test.d/db-remove.sh')
-rwxr-xr-xtest/test.d/db-remove.sh52
1 files changed, 52 insertions, 0 deletions
diff --git a/test/test.d/db-remove.sh b/test/test.d/db-remove.sh
new file mode 100755
index 0000000..b66466d
--- /dev/null
+++ b/test/test.d/db-remove.sh
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+curdir=$(readlink -e $(dirname $0))
+. "${curdir}/../lib/common.inc"
+
+testRemovePackages() {
+ local arches=('i686' 'x86_64')
+ local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-split-a' 'pkg-split-b')
+ local pkgbase
+ local arch
+
+ for pkgbase in ${pkgs[@]}; do
+ for arch in ${arches[@]}; do
+ releasePackage extra ${pkgbase} ${arch}
+ done
+ done
+
+ ../db-update
+
+ for pkgbase in ${pkgs[@]}; do
+ for arch in ${arches[@]}; do
+ ../db-remove ${pkgbase} extra ${arch}
+ done
+ done
+
+ for pkgbase in ${pkgs[@]}; do
+ for arch in ${arches[@]}; do
+ checkRemovedPackage extra ${pkgbase} ${arch}
+ done
+ done
+}
+
+testRemoveAnyPackages() {
+ local pkgs=('pkg-any-a' 'pkg-any-b')
+ local pkgbase
+
+ for pkgbase in ${pkgs[@]}; do
+ releasePackage extra ${pkgbase} any
+ done
+
+ ../db-update
+
+ for pkgbase in ${pkgs[@]}; do
+ ../db-remove ${pkgbase} extra any
+ done
+
+ for pkgbase in ${pkgs[@]}; do
+ checkRemovedAnyPackage extra ${pkgbase}
+ done
+}
+
+. "${curdir}/../lib/shunit2"