summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2011-11-05 17:49:17 +0100
committerPierre Schmitz <pierre@archlinux.de>2011-11-05 17:49:17 +0100
commit449f67604bad8794b3da80f2bc49d7e87c226048 (patch)
treee517b89a43b26eaf0f608775a447157aa9ed9df9
parent5c614ddd8ba74bca6a2dfe83a599601533d9ddc7 (diff)
downloaddbscripts-449f67604bad8794b3da80f2bc49d7e87c226048.tar.gz
dbscripts-449f67604bad8794b3da80f2bc49d7e87c226048.tar.xz
Split package database test functions from check* functions
This way we can check consitency of databases independent from a svn repo
-rw-r--r--test/lib/common.inc38
1 files changed, 34 insertions, 4 deletions
diff --git a/test/lib/common.inc b/test/lib/common.inc
index 61e57d0..a2dee10 100644
--- a/test/lib/common.inc
+++ b/test/lib/common.inc
@@ -125,7 +125,7 @@ releasePackage() {
fi
}
-checkAnyPackage() {
+checkAnyPackageDB() {
local repo=$1
local pkg=$2
local arch
@@ -158,6 +158,13 @@ checkAnyPackage() {
[ -r "${FTP_BASE}/${repo}/os/any/${pkg}" ] && fail "${repo}/os/any/${pkg} should not exist"
[ -r "${FTP_BASE}/${repo}/os/any/${pkg}.sig" ] && fail "${repo}/os/any/${pkg}.sig should not exist"
+}
+
+checkAnyPackage() {
+ local repo=$1
+ local pkg=$2
+
+ checkAnyPackageDB $repo $pkg
local pkgbase=$(getpkgbase "${FTP_BASE}/${PKGPOOL}/${pkg}")
svn up -q "${TMP}/svn-packages-copy/${pkgbase}"
@@ -165,7 +172,7 @@ checkAnyPackage() {
|| fail "svn-packages-copy/${pkgbase}/repos/${repo}-any does not exist"
}
-checkPackage() {
+checkPackageDB() {
local repo=$1
local pkg=$2
local arch=$3
@@ -192,6 +199,14 @@ checkPackage() {
&& bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" -O | grep -q ${pkg}) \
|| fail "${pkg} not in ${repo}/os/${arch}/${repo}${db%.tar.*}"
done
+}
+
+checkPackage() {
+ local repo=$1
+ local pkg=$2
+ local arch=$3
+
+ checkPackageDB $repo $pkg $arch
local pkgbase=$(getpkgbase "${FTP_BASE}/${PKGPOOL}/${pkg}")
svn up -q "${TMP}/svn-packages-copy/${pkgbase}"
@@ -199,7 +214,7 @@ checkPackage() {
|| fail "svn-packages-copy/${pkgbase}/repos/${repo}-${arch} does not exist"
}
-checkRemovedPackage() {
+checkRemovedPackageDB() {
local repo=$1
local pkgbase=$2
local arch=$3
@@ -210,13 +225,21 @@ checkRemovedPackage() {
&& bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" -O | grep -q ${pkgbase}) \
&& fail "${pkgbase} should not be in ${repo}/os/${arch}/${repo}${db%.tar.*}"
done
+}
+
+checkRemovedPackage() {
+ local repo=$1
+ local pkgbase=$2
+ local arch=$3
+
+ checkRemovedPackageDB $repo $pkgbase $arch
svn up -q "${TMP}/svn-packages-copy/${pkgbase}"
[ -d "${TMP}/svn-packages-copy/${pkgbase}/repos/${repo}-${arch}" ] \
&& fail "svn-packages-copy/${pkgbase}/repos/${repo}-${arch} should not exist"
}
-checkRemovedAnyPackage() {
+checkRemovedAnyPackageDB() {
local repo=$1
local pkgbase=$2
local arch
@@ -229,6 +252,13 @@ checkRemovedAnyPackage() {
&& fail "${pkgbase} should not be in ${repo}/os/${arch}/${repo}${db%.tar.*}"
done
done
+}
+
+checkRemovedAnyPackage() {
+ local repo=$1
+ local pkgbase=$2
+
+ checkRemovedAnyPackageDB $repo $pkgbase
svn up -q "${TMP}/svn-packages-copy/${pkgbase}"
[ -d "${TMP}/svn-packages-copy/${pkgbase}/repos/${repo}-any" ] \