summaryrefslogtreecommitdiff
path: root/test/lib/common.inc
diff options
context:
space:
mode:
authorcoadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu>2015-09-23 18:30:39 -0300
committercoadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu>2015-09-23 18:30:39 -0300
commitfa4ff798507ded0b26dcdc310d1f97e2e61198c4 (patch)
treeb1a7a66b187fb3825f24fba79603a19bd9036127 /test/lib/common.inc
parenta6f91db681e302763b687bb47abb5d258948007b (diff)
rename FTP_BASE -> root_dir
Diffstat (limited to 'test/lib/common.inc')
-rw-r--r--test/lib/common.inc50
1 files changed, 25 insertions, 25 deletions
diff --git a/test/lib/common.inc b/test/lib/common.inc
index a2dee10..04bed2b 100644
--- a/test/lib/common.inc
+++ b/test/lib/common.inc
@@ -85,7 +85,7 @@ setUp() {
done
cat <<eot > "$(dirname ${BASH_SOURCE[0]})/../../config.local"
- FTP_BASE="${TMP}/ftp"
+ root_dir="${TMP}/ftp"
SVNREPO="file://${TMP}/svn-packages-repo"
PKGREPOS=(${PKGREPOS[@]})
PKGPOOL="${PKGPOOL}"
@@ -131,19 +131,19 @@ checkAnyPackageDB() {
local arch
local db
- [ -r "${FTP_BASE}/${PKGPOOL}/${pkg}" ] || fail "${PKGPOOL}/${pkg} not found"
+ [ -r "${root_dir}/${PKGPOOL}/${pkg}" ] || fail "${PKGPOOL}/${pkg} not found"
if ${REQUIRE_SIGNATURE}; then
- [ -r "${FTP_BASE}/${PKGPOOL}/${pkg}.sig" ] || fail "${PKGPOOL}/${pkg}.sig not found"
+ [ -r "${root_dir}/${PKGPOOL}/${pkg}.sig" ] || fail "${PKGPOOL}/${pkg}.sig not found"
fi
for arch in i686 x86_64; do
- [ -L "${FTP_BASE}/${repo}/os/${arch}/${pkg}" ] || fail "${repo}/os/${arch}/${pkg} is not a symlink"
- [ "$(readlink -e "${FTP_BASE}/${repo}/os/${arch}/${pkg}")" == "${FTP_BASE}/${PKGPOOL}/${pkg}" ] \
+ [ -L "${root_dir}/${repo}/os/${arch}/${pkg}" ] || fail "${repo}/os/${arch}/${pkg} is not a symlink"
+ [ "$(readlink -e "${root_dir}/${repo}/os/${arch}/${pkg}")" == "${root_dir}/${PKGPOOL}/${pkg}" ] \
|| fail "${repo}/os/${arch}/${pkg} does not link to ${PKGPOOL}/${pkg}"
if ${REQUIRE_SIGNATURE}; then
- [ -L "${FTP_BASE}/${repo}/os/${arch}/${pkg}.sig" ] || fail "${repo}/os/${arch}/${pkg}.sig is not a symlink"
- [ "$(readlink -e "${FTP_BASE}/${repo}/os/${arch}/${pkg}.sig")" == "${FTP_BASE}/${PKGPOOL}/${pkg}.sig" ] \
+ [ -L "${root_dir}/${repo}/os/${arch}/${pkg}.sig" ] || fail "${repo}/os/${arch}/${pkg}.sig is not a symlink"
+ [ "$(readlink -e "${root_dir}/${repo}/os/${arch}/${pkg}.sig")" == "${root_dir}/${PKGPOOL}/${pkg}.sig" ] \
|| fail "${repo}/os/${arch}/${pkg}.sig does not link to ${PKGPOOL}/${pkg}.sig"
fi
done
@@ -151,13 +151,13 @@ checkAnyPackageDB() {
[ -r "${STAGING}"/${repo}/${pkg}.sig ] && fail "${repo}/${pkg}.sig found in staging dir"
for db in ${DBEXT} ${FILESEXT}; do
- ( [ -r "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" ] \
- && bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" -O | grep -q ${pkg}) \
+ ( [ -r "${root_dir}/${repo}/os/${arch}/${repo}${db%.tar.*}" ] \
+ && bsdtar -xf "${root_dir}/${repo}/os/${arch}/${repo}${db%.tar.*}" -O | grep -q ${pkg}) \
|| fail "${pkg} not in ${repo}/os/${arch}/${repo}${db%.tar.*}"
done
- [ -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"
+ [ -r "${root_dir}/${repo}/os/any/${pkg}" ] && fail "${repo}/os/any/${pkg} should not exist"
+ [ -r "${root_dir}/${repo}/os/any/${pkg}.sig" ] && fail "${repo}/os/any/${pkg}.sig should not exist"
}
checkAnyPackage() {
@@ -166,7 +166,7 @@ checkAnyPackage() {
checkAnyPackageDB $repo $pkg
- local pkgbase=$(getpkgbase "${FTP_BASE}/${PKGPOOL}/${pkg}")
+ local pkgbase=$(getpkgbase "${root_dir}/${PKGPOOL}/${pkg}")
svn up -q "${TMP}/svn-packages-copy/${pkgbase}"
[ -d "${TMP}/svn-packages-copy/${pkgbase}/repos/${repo}-any" ] \
|| fail "svn-packages-copy/${pkgbase}/repos/${repo}-any does not exist"
@@ -178,25 +178,25 @@ checkPackageDB() {
local arch=$3
local db
- [ -r "${FTP_BASE}/${PKGPOOL}/${pkg}" ] || fail "${PKGPOOL}/${pkg} not found"
- [ -L "${FTP_BASE}/${repo}/os/${arch}/${pkg}" ] || fail "${repo}/os/${arch}/${pkg} not a symlink"
+ [ -r "${root_dir}/${PKGPOOL}/${pkg}" ] || fail "${PKGPOOL}/${pkg} not found"
+ [ -L "${root_dir}/${repo}/os/${arch}/${pkg}" ] || fail "${repo}/os/${arch}/${pkg} not a symlink"
[ -r "${STAGING}"/${repo}/${pkg} ] && fail "${repo}/${pkg} found in staging dir"
- [ "$(readlink -e "${FTP_BASE}/${repo}/os/${arch}/${pkg}")" == "${FTP_BASE}/${PKGPOOL}/${pkg}" ] \
+ [ "$(readlink -e "${root_dir}/${repo}/os/${arch}/${pkg}")" == "${root_dir}/${PKGPOOL}/${pkg}" ] \
|| fail "${repo}/os/${arch}/${pkg} does not link to ${PKGPOOL}/${pkg}"
if ${REQUIRE_SIGNATURE}; then
- [ -r "${FTP_BASE}/${PKGPOOL}/${pkg}.sig" ] || fail "${PKGPOOL}/${pkg}.sig not found"
- [ -L "${FTP_BASE}/${repo}/os/${arch}/${pkg}.sig" ] || fail "${repo}/os/${arch}/${pkg}.sig is not a symlink"
+ [ -r "${root_dir}/${PKGPOOL}/${pkg}.sig" ] || fail "${PKGPOOL}/${pkg}.sig not found"
+ [ -L "${root_dir}/${repo}/os/${arch}/${pkg}.sig" ] || fail "${repo}/os/${arch}/${pkg}.sig is not a symlink"
[ -r "${STAGING}"/${repo}/${pkg}.sig ] && fail "${repo}/${pkg}.sig found in staging dir"
- [ "$(readlink -e "${FTP_BASE}/${repo}/os/${arch}/${pkg}.sig")" == "${FTP_BASE}/${PKGPOOL}/${pkg}.sig" ] \
+ [ "$(readlink -e "${root_dir}/${repo}/os/${arch}/${pkg}.sig")" == "${root_dir}/${PKGPOOL}/${pkg}.sig" ] \
|| fail "${repo}/os/${arch}/${pkg}.sig does not link to ${PKGPOOL}/${pkg}.sig"
fi
for db in ${DBEXT} ${FILESEXT}; do
- ( [ -r "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" ] \
- && bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" -O | grep -q ${pkg}) \
+ ( [ -r "${root_dir}/${repo}/os/${arch}/${repo}${db%.tar.*}" ] \
+ && bsdtar -xf "${root_dir}/${repo}/os/${arch}/${repo}${db%.tar.*}" -O | grep -q ${pkg}) \
|| fail "${pkg} not in ${repo}/os/${arch}/${repo}${db%.tar.*}"
done
}
@@ -208,7 +208,7 @@ checkPackage() {
checkPackageDB $repo $pkg $arch
- local pkgbase=$(getpkgbase "${FTP_BASE}/${PKGPOOL}/${pkg}")
+ local pkgbase=$(getpkgbase "${root_dir}/${PKGPOOL}/${pkg}")
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} does not exist"
@@ -221,8 +221,8 @@ checkRemovedPackageDB() {
local db
for db in ${DBEXT} ${FILESEXT}; do
- ( [ -r "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" ] \
- && bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" -O | grep -q ${pkgbase}) \
+ ( [ -r "${root_dir}/${repo}/os/${arch}/${repo}${db%.tar.*}" ] \
+ && bsdtar -xf "${root_dir}/${repo}/os/${arch}/${repo}${db%.tar.*}" -O | grep -q ${pkgbase}) \
&& fail "${pkgbase} should not be in ${repo}/os/${arch}/${repo}${db%.tar.*}"
done
}
@@ -247,8 +247,8 @@ checkRemovedAnyPackageDB() {
for db in ${DBEXT} ${FILESEXT}; do
for arch in i686 x86_64; do
- ( [ -r "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" ] \
- && bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" -O | grep -q ${pkgbase}) \
+ ( [ -r "${root_dir}/${repo}/os/${arch}/${repo}${db%.tar.*}" ] \
+ && bsdtar -xf "${root_dir}/${repo}/os/${arch}/${repo}${db%.tar.*}" -O | grep -q ${pkgbase}) \
&& fail "${pkgbase} should not be in ${repo}/os/${arch}/${repo}${db%.tar.*}"
done
done