summaryrefslogtreecommitdiff
path: root/test/test.d
diff options
context:
space:
mode:
Diffstat (limited to 'test/test.d')
-rwxr-xr-xtest/test.d/create-filelists.sh2
-rwxr-xr-xtest/test.d/db-move.sh24
-rwxr-xr-xtest/test.d/db-remove.sh29
-rwxr-xr-xtest/test.d/db-repo-add.sh54
-rwxr-xr-xtest/test.d/db-repo-remove.sh58
-rwxr-xr-xtest/test.d/ftpdir-cleanup.sh8
-rwxr-xr-xtest/test.d/sourceballs.sh2
7 files changed, 169 insertions, 8 deletions
diff --git a/test/test.d/create-filelists.sh b/test/test.d/create-filelists.sh
index 80b0927..49734c4 100755
--- a/test/test.d/create-filelists.sh
+++ b/test/test.d/create-filelists.sh
@@ -88,7 +88,7 @@ testCleanupFileLists() {
../db-update
for arch in ${arches[@]}; do
- ../db-remove pkg-simple-a extra ${arch}
+ ../db-remove extra ${arch} pkg-simple-a
done
for arch in ${arches[@]}; do
diff --git a/test/test.d/db-move.sh b/test/test.d/db-move.sh
index 40b40de..9d7c1f6 100755
--- a/test/test.d/db-move.sh
+++ b/test/test.d/db-move.sh
@@ -27,6 +27,30 @@ testMoveSimplePackages() {
done
}
+testMoveMultiplePackages() {
+ 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 pkg-simple-b
+
+ for pkgbase in ${pkgs[@]}; do
+ for arch in ${arches[@]}; do
+ checkPackage extra ${pkgbase}-1-1-${arch}.pkg.tar.xz ${arch}
+ checkRemovedPackage testing ${pkgbase}-1-1-${arch}.pkg.tar.xz ${arch}
+ done
+ done
+}
+
testMoveEpochPackages() {
local arches=('i686' 'x86_64')
local pkgs=('pkg-simple-epoch')
diff --git a/test/test.d/db-remove.sh b/test/test.d/db-remove.sh
index 573bd71..416e693 100755
--- a/test/test.d/db-remove.sh
+++ b/test/test.d/db-remove.sh
@@ -19,7 +19,7 @@ testRemovePackages() {
for pkgbase in ${pkgs[@]}; do
for arch in ${arches[@]}; do
- ../db-remove ${pkgbase} extra ${arch}
+ ../db-remove extra ${arch} ${pkgbase}
done
done
@@ -30,6 +30,31 @@ testRemovePackages() {
done
}
+testRemoveMultiplePackages() {
+ local arches=('i686' 'x86_64')
+ local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-split-a' 'pkg-split-b' 'pkg-simple-epoch')
+ local pkgbase
+ local arch
+
+ for pkgbase in ${pkgs[@]}; do
+ for arch in ${arches[@]}; do
+ releasePackage extra ${pkgbase} ${arch}
+ done
+ done
+
+ ../db-update
+
+ for arch in ${arches[@]}; do
+ ../db-remove extra ${arch} ${pkgs[@]}
+ 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
@@ -41,7 +66,7 @@ testRemoveAnyPackages() {
../db-update
for pkgbase in ${pkgs[@]}; do
- ../db-remove ${pkgbase} extra any
+ ../db-remove extra any ${pkgbase}
done
for pkgbase in ${pkgs[@]}; do
diff --git a/test/test.d/db-repo-add.sh b/test/test.d/db-repo-add.sh
new file mode 100755
index 0000000..8603104
--- /dev/null
+++ b/test/test.d/db-repo-add.sh
@@ -0,0 +1,54 @@
+#!/bin/bash
+
+curdir=$(readlink -e $(dirname $0))
+. "${curdir}/../lib/common.inc"
+
+testAddSimplePackages() {
+ 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
+ cp "${pkgdir}/${pkgbase}/${pkgbase}-1-1-${arch}.pkg.tar.xz" "${FTP_BASE}/${PKGPOOL}/"
+ touch "${FTP_BASE}/${PKGPOOL}/${pkgbase}-1-1-${arch}.pkg.tar.xz.sig"
+ ln -s "${FTP_BASE}/${PKGPOOL}/${pkgbase}-1-1-${arch}.pkg.tar.xz" "${FTP_BASE}/extra/os/${arch}/"
+ ln -s "${FTP_BASE}/${PKGPOOL}/${pkgbase}-1-1-${arch}.pkg.tar.xz.sig" "${FTP_BASE}/extra/os/${arch}/"
+ ../db-repo-add extra ${arch} ${pkgbase}-1-1-${arch}.pkg.tar.xz
+ done
+ done
+
+ for pkgbase in ${pkgs[@]}; do
+ for arch in ${arches[@]}; do
+ checkPackageDB extra ${pkgbase}-1-1-${arch}.pkg.tar.xz ${arch}
+ done
+ done
+}
+
+testAddMultiplePackages() {
+ local arches=('i686' 'x86_64')
+ local pkgs=('pkg-simple-a' 'pkg-simple-b')
+ local pkgbase
+ local arch
+
+ for arch in ${arches[@]}; do
+ add_pkgs=()
+ for pkgbase in ${pkgs[@]}; do
+ cp "${pkgdir}/${pkgbase}/${pkgbase}-1-1-${arch}.pkg.tar.xz" "${FTP_BASE}/${PKGPOOL}/"
+ touch "${FTP_BASE}/${PKGPOOL}/${pkgbase}-1-1-${arch}.pkg.tar.xz.sig"
+ ln -s "${FTP_BASE}/${PKGPOOL}/${pkgbase}-1-1-${arch}.pkg.tar.xz" "${FTP_BASE}/extra/os/${arch}/"
+ ln -s "${FTP_BASE}/${PKGPOOL}/${pkgbase}-1-1-${arch}.pkg.tar.xz.sig" "${FTP_BASE}/extra/os/${arch}/"
+ add_pkgs[${#add_pkgs[*]}]=${pkgbase}-1-1-${arch}.pkg.tar.xz
+ done
+ ../db-repo-add extra ${arch} ${add_pkgs[@]}
+ done
+
+ for pkgbase in ${pkgs[@]}; do
+ for arch in ${arches[@]}; do
+ checkPackageDB extra ${pkgbase}-1-1-${arch}.pkg.tar.xz ${arch}
+ done
+ done
+}
+
+. "${curdir}/../lib/shunit2"
diff --git a/test/test.d/db-repo-remove.sh b/test/test.d/db-repo-remove.sh
new file mode 100755
index 0000000..315d63d
--- /dev/null
+++ b/test/test.d/db-repo-remove.sh
@@ -0,0 +1,58 @@
+#!/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-simple-epoch')
+ 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-repo-remove extra ${arch} ${pkgbase}
+ done
+ done
+
+ for pkgbase in ${pkgs[@]}; do
+ for arch in ${arches[@]}; do
+ checkRemovedPackageDB extra ${pkgbase} ${arch}
+ done
+ done
+}
+
+testRemoveMultiplePackages() {
+ local arches=('i686' 'x86_64')
+ local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-simple-epoch')
+ local pkgbase
+ local arch
+
+ for pkgbase in ${pkgs[@]}; do
+ for arch in ${arches[@]}; do
+ releasePackage extra ${pkgbase} ${arch}
+ done
+ done
+
+ ../db-update
+
+ for arch in ${arches[@]}; do
+ ../db-repo-remove extra ${arch} ${pkgs[@]}
+ done
+
+ for pkgbase in ${pkgs[@]}; do
+ for arch in ${arches[@]}; do
+ checkRemovedPackageDB extra ${pkgbase} ${arch}
+ done
+ done
+}
+
+. "${curdir}/../lib/shunit2"
diff --git a/test/test.d/ftpdir-cleanup.sh b/test/test.d/ftpdir-cleanup.sh
index 77b02b8..20026b4 100755
--- a/test/test.d/ftpdir-cleanup.sh
+++ b/test/test.d/ftpdir-cleanup.sh
@@ -18,7 +18,7 @@ testCleanupSimplePackages() {
../db-update
for arch in ${arches[@]}; do
- ../db-remove pkg-simple-a extra ${arch}
+ ../db-remove extra ${arch} pkg-simple-a
done
../cron-jobs/ftpdir-cleanup >/dev/null
@@ -49,7 +49,7 @@ testCleanupEpochPackages() {
../db-update
for arch in ${arches[@]}; do
- ../db-remove pkg-simple-epoch extra ${arch}
+ ../db-remove extra ${arch} pkg-simple-epoch
done
../cron-jobs/ftpdir-cleanup >/dev/null
@@ -72,7 +72,7 @@ testCleanupAnyPackages() {
done
../db-update
- ../db-remove pkg-any-a extra any
+ ../db-remove extra any pkg-any-a
../cron-jobs/ftpdir-cleanup >/dev/null
local pkg1='pkg-any-a-1-1-any.pkg.tar.xz'
@@ -100,7 +100,7 @@ testCleanupSplitPackages() {
../db-update
for arch in ${arches[@]}; do
- ../db-remove ${pkgs[0]} extra ${arch}
+ ../db-remove extra ${arch} ${pkgs[0]}
done
../cron-jobs/ftpdir-cleanup >/dev/null
diff --git a/test/test.d/sourceballs.sh b/test/test.d/sourceballs.sh
index 11bd0f4..fdcf08c 100755
--- a/test/test.d/sourceballs.sh
+++ b/test/test.d/sourceballs.sh
@@ -73,7 +73,7 @@ testSourceballsCleanup() {
../cron-jobs/sourceballs
for arch in ${arches[@]}; do
- ../db-remove pkg-simple-a extra ${arch}
+ ../db-remove extra ${arch} pkg-simple-a
done
../cron-jobs/sourceballs