summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lib/common.inc78
l---------test/packages/pkg-simple-epoch/Makefile1
-rw-r--r--test/packages/pkg-simple-epoch/PKGBUILD23
l---------test/packages/pkg-simple-epoch/test.c1
-rwxr-xr-xtest/test.d/create-filelists.sh27
-rwxr-xr-xtest/test.d/db-move.sh26
-rwxr-xr-xtest/test.d/db-remove.sh2
-rwxr-xr-xtest/test.d/db-update.sh12
-rwxr-xr-xtest/test.d/ftpdir-cleanup.sh32
-rwxr-xr-xtest/test.d/pool-transition.sh14
-rwxr-xr-xtest/test.d/signed-packages.sh13
-rwxr-xr-xtest/test.d/sourceballs.sh2
-rwxr-xr-xtest/test.d/testing2x.sh2
13 files changed, 181 insertions, 52 deletions
diff --git a/test/lib/common.inc b/test/lib/common.inc
index 208400c..eb46508 100644
--- a/test/lib/common.inc
+++ b/test/lib/common.inc
@@ -18,7 +18,7 @@ oneTimeSetUp() {
pushd $d >/dev/null
pkgname=($(. PKGBUILD; echo ${pkgname[@]}))
pkgarch=($(. PKGBUILD; echo ${arch[@]}))
- pkgversion=$(. PKGBUILD; echo ${pkgver}-${pkgrel})
+ pkgversion=$(. PKGBUILD; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel}))
build=true
for a in ${pkgarch[@]}; do
@@ -29,10 +29,10 @@ oneTimeSetUp() {
if ! ${build}; then
if [ "${pkgarch[0]}" == 'any' ]; then
- extra-x86_64-build || die 'extra-x86_64-build failed'
+ sudo extra-x86_64-build || die 'extra-x86_64-build failed'
else
for a in ${pkgarch[@]}; do
- extra-${a}-build || die "extra-${a}-build failed"
+ sudo extra-${a}-build || die "extra-${a}-build failed"
done
fi
for a in ${pkgarch[@]}; do
@@ -95,6 +95,7 @@ setUp() {
TMPDIR="${TMP}/tmp"
CLEANUP_DRYRUN=false
SOURCE_CLEANUP_DRYRUN=false
+ REQUIRE_SIGNATURE=true
eot
. "$(dirname ${BASH_SOURCE[0]})/../../config"
}
@@ -112,36 +113,58 @@ releasePackage() {
pushd "${TMP}/svn-packages-copy"/${pkgbase}/trunk/ >/dev/null
archrelease ${repo}-${arch} >/dev/null 2&>1
- pkgver=$(. PKGBUILD; echo "${pkgver}-${pkgrel}")
+ pkgver=$(. PKGBUILD; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel}))
popd >/dev/null
- cp "${pkgdir}/${pkgbase}"/*-${pkgver}-${arch}.pkg.tar.* "${STAGING}"/${repo}/
+ cp "${pkgdir}/${pkgbase}"/*-${pkgver}-${arch}${PKGEXT} "${STAGING}"/${repo}/
+
+ if ${REQUIRE_SIGNATURE}; then
+ # TODO: really sign the packages with a valid key
+ find "${STAGING}"/${repo}/ -type f \
+ -name "*-${pkgver}-${arch}${PKGEXT}" \
+ -exec touch {}.sig \;
+ fi
}
checkAnyPackage() {
local repo=$1
local pkg=$2
local arch
+ local db
[ -r "${FTP_BASE}/${PKGPOOL}/${pkg}" ] || fail "${PKGPOOL}/${pkg} not found"
+ if ${REQUIRE_SIGNATURE}; then
+ [ -r "${FTP_BASE}/${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} not a symlink"
+ [ -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}" ] \
|| 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" ] \
+ || fail "${repo}/os/${arch}/${pkg}.sig does not link to ${PKGPOOL}/${pkg}.sig"
+ fi
done
[ -r "${STAGING}"/${repo}/${pkg} ] && fail "${repo}/${pkg} found in staging dir"
+ [ -r "${STAGING}"/${repo}/${pkg}.sig ] && fail "${repo}/${pkg}.sig found in staging dir"
- ( [ -r "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" ] \
- && bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" -O | grep -q ${pkg}) \
- || fail "${pkg} not in ${repo}/os/${arch}/${repo}${DBEXT%.tar.*}"
+ 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}) \
+ || 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"
}
checkPackage() {
local repo=$1
local pkg=$2
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"
@@ -150,9 +173,20 @@ checkPackage() {
[ "$(readlink -e "${FTP_BASE}/${repo}/os/${arch}/${pkg}")" == "${FTP_BASE}/${PKGPOOL}/${pkg}" ] \
|| fail "${repo}/os/${arch}/${pkg} does not link to ${PKGPOOL}/${pkg}"
- ( [ -r "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" ] \
- && bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" -O | grep -q ${pkg}) \
- || fail "${pkg} not in ${repo}/os/${arch}/${repo}${DBEXT%.tar.*}"
+ 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 "${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" ] \
+ || 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}) \
+ || fail "${pkg} not in ${repo}/os/${arch}/${repo}${db%.tar.*}"
+ done
local pkgbase=$(getpkgbase "${FTP_BASE}/${PKGPOOL}/${pkg}")
svn up -q "${TMP}/svn-packages-copy/${pkgbase}"
@@ -164,10 +198,13 @@ checkRemovedPackage() {
local repo=$1
local pkgbase=$2
local arch=$3
+ local db
- ( [ -r "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" ] \
- && bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" -O | grep -q ${pkgbase}) \
- && fail "${pkgbase} should not be in ${repo}/os/${arch}/${repo}${DBEXT%.tar.*}"
+ 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}) \
+ && fail "${pkgbase} should not be in ${repo}/os/${arch}/${repo}${db%.tar.*}"
+ done
svn up -q "${TMP}/svn-packages-copy/${pkgbase}"
[ -d "${TMP}/svn-packages-copy/${pkgbase}/repos/${repo}-${arch}" ] \
@@ -178,11 +215,14 @@ checkRemovedAnyPackage() {
local repo=$1
local pkgbase=$2
local arch
+ local db
- for arch in i686 x86_64; do
- ( [ -r "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" ] \
- && bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" -O | grep -q ${pkgbase}) \
- && fail "${pkgbase} should not be in ${repo}/os/${arch}/${repo}${DBEXT%.tar.*}"
+ 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}) \
+ && fail "${pkgbase} should not be in ${repo}/os/${arch}/${repo}${db%.tar.*}"
+ done
done
svn up -q "${TMP}/svn-packages-copy/${pkgbase}"
diff --git a/test/packages/pkg-simple-epoch/Makefile b/test/packages/pkg-simple-epoch/Makefile
new file mode 120000
index 0000000..50be211
--- /dev/null
+++ b/test/packages/pkg-simple-epoch/Makefile
@@ -0,0 +1 @@
+../../src/Makefile \ No newline at end of file
diff --git a/test/packages/pkg-simple-epoch/PKGBUILD b/test/packages/pkg-simple-epoch/PKGBUILD
new file mode 100644
index 0000000..eebe2bd
--- /dev/null
+++ b/test/packages/pkg-simple-epoch/PKGBUILD
@@ -0,0 +1,23 @@
+pkgname=pkg-simple-epoch
+pkgver=1
+pkgrel=1
+epoch=1
+pkgdesc="A package called ${pkgname}"
+arch=('i686' 'x86_64')
+url='http://www.archlinux.org/'
+license=('GPL')
+depends=('glibc')
+makedepends=('gcc')
+source=('Makefile' 'test.c')
+md5sums=('c6cb8dcc86253355fed559416d0c8dcf'
+ '3c1e4279feb678fd9cabaccdb28e40d0')
+
+build() {
+ cd ${srcdir}
+ make
+}
+
+package() {
+ cd ${srcdir}
+ make install DESTDIR=${pkgdir} DESTBIN=${pkgname}
+}
diff --git a/test/packages/pkg-simple-epoch/test.c b/test/packages/pkg-simple-epoch/test.c
new file mode 120000
index 0000000..ed5b5ac
--- /dev/null
+++ b/test/packages/pkg-simple-epoch/test.c
@@ -0,0 +1 @@
+../../src/test.c \ No newline at end of file
diff --git a/test/test.d/create-filelists.sh b/test/test.d/create-filelists.sh
index da76710..80b0927 100755
--- a/test/test.d/create-filelists.sh
+++ b/test/test.d/create-filelists.sh
@@ -5,7 +5,7 @@ curdir=$(readlink -e $(dirname $0))
testCreateSimpleFileLists() {
local arches=('i686' 'x86_64')
- local pkgs=('pkg-simple-a' 'pkg-simple-b')
+ local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-simple-epoch')
local pkgbase
local arch
@@ -16,11 +16,10 @@ testCreateSimpleFileLists() {
done
../db-update
- ../cron-jobs/create-filelists
for pkgbase in ${pkgs[@]}; do
for arch in ${arches[@]}; do
- if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra.files.tar.gz" | grep -q "usr/bin/${pkgbase}"; then
- fail "usr/bin/${pkgbase} not found in ${arch}/extra.files.tar.gz"
+ if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/${pkgbase}"; then
+ fail "usr/bin/${pkgbase} not found in ${arch}/extra${FILESEXT}"
fi
done
done
@@ -37,11 +36,10 @@ testCreateAnyFileLists() {
done
../db-update
- ../cron-jobs/create-filelists
for pkgbase in ${pkgs[@]}; do
for arch in ${arches[@]}; do
- if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra.files.tar.gz" | grep -q "usr/share/${pkgbase}/test"; then
- fail "usr/share/${pkgbase}/test not found in ${arch}/extra.files.tar.gz"
+ if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/share/${pkgbase}/test"; then
+ fail "usr/share/${pkgbase}/test not found in ${arch}/extra${FILESEXT}"
fi
done
done
@@ -63,13 +61,12 @@ testCreateSplitFileLists() {
done
../db-update
- ../cron-jobs/create-filelists
for pkgbase in ${pkgs[@]}; do
pkgnames=($(source "${TMP}/svn-packages-copy/${pkgbase}/trunk/PKGBUILD"; echo ${pkgname[@]}))
for pkgname in ${pkgnames[@]}; do
for arch in ${arches[@]}; do
- if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra.files.tar.gz" | grep -q "usr/bin/${pkgname}"; then
- fail "usr/bin/${pkgname} not found in ${arch}/extra.files.tar.gz"
+ if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/${pkgname}"; then
+ fail "usr/bin/${pkgname} not found in ${arch}/extra${FILESEXT}"
fi
done
done
@@ -89,19 +86,17 @@ testCleanupFileLists() {
done
done
../db-update
- ../cron-jobs/create-filelists
for arch in ${arches[@]}; do
../db-remove pkg-simple-a extra ${arch}
done
- ../cron-jobs/create-filelists
for arch in ${arches[@]}; do
- if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra.files.tar.gz" | grep -q "usr/bin/pkg-simple-b"; then
- fail "usr/bin/pkg-simple-b not found in ${arch}/extra.files.tar.gz"
+ if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/pkg-simple-b"; then
+ fail "usr/bin/pkg-simple-b not found in ${arch}/extra${FILESEXT}"
fi
- if bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra.files.tar.gz" | grep -q "usr/bin/pkg-simple-a"; then
- fail "usr/bin/pkg-simple-a still found in ${arch}/extra.files.tar.gz"
+ if bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/pkg-simple-a"; then
+ fail "usr/bin/pkg-simple-a still found in ${arch}/extra${FILESEXT}"
fi
done
diff --git a/test/test.d/db-move.sh b/test/test.d/db-move.sh
index 57cbf71..40b40de 100755
--- a/test/test.d/db-move.sh
+++ b/test/test.d/db-move.sh
@@ -27,6 +27,28 @@ testMoveSimplePackages() {
done
}
+testMoveEpochPackages() {
+ local arches=('i686' 'x86_64')
+ local pkgs=('pkg-simple-epoch')
+ 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-epoch
+
+ for arch in ${arches[@]}; do
+ checkPackage extra pkg-simple-epoch-1:1-1-${arch}.pkg.tar.xz ${arch}
+ checkRemovedPackage testing pkg-simple-epoch-1:1-1-${arch}.pkg.tar.xz ${arch}
+ done
+}
+
testMoveAnyPackages() {
local pkgs=('pkg-any-a' 'pkg-any-b')
local pkgbase
@@ -60,12 +82,12 @@ testMoveSplitPackages() {
../db-move testing extra pkg-split-a
for arch in ${arches[@]}; do
- for pkg in "${pkgdir}/pkg-split-a"/*-${arch}.pkg.tar.*; do
+ for pkg in "${pkgdir}/pkg-split-a"/*-${arch}${PKGEXT}; do
checkPackage extra $(basename ${pkg}) ${arch}
done
done
for arch in ${arches[@]}; do
- for pkg in "${pkgdir}/pkg-split-b"/*-${arch}.pkg.tar.*; do
+ for pkg in "${pkgdir}/pkg-split-b"/*-${arch}${PKGEXT}; do
checkPackage testing $(basename ${pkg}) ${arch}
done
done
diff --git a/test/test.d/db-remove.sh b/test/test.d/db-remove.sh
index b66466d..573bd71 100755
--- a/test/test.d/db-remove.sh
+++ b/test/test.d/db-remove.sh
@@ -5,7 +5,7 @@ curdir=$(readlink -e $(dirname $0))
testRemovePackages() {
local arches=('i686' 'x86_64')
- local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-split-a' 'pkg-split-b')
+ local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-split-a' 'pkg-split-b' 'pkg-simple-epoch')
local pkgbase
local arch
diff --git a/test/test.d/db-update.sh b/test/test.d/db-update.sh
index 5a3d01d..e38c328 100755
--- a/test/test.d/db-update.sh
+++ b/test/test.d/db-update.sh
@@ -30,6 +30,12 @@ testAddSingleSimplePackage() {
checkPackage extra 'pkg-simple-a-1-1-i686.pkg.tar.xz' 'i686'
}
+testAddSingleEpochPackage() {
+ releasePackage extra 'pkg-simple-epoch' 'i686'
+ ../db-update
+ checkPackage extra 'pkg-simple-epoch-1:1-1-i686.pkg.tar.xz' 'i686'
+}
+
testAddAnyPackages() {
local pkgs=('pkg-any-a' 'pkg-any-b')
local pkgbase
@@ -62,7 +68,7 @@ testAddSplitPackages() {
for pkgbase in ${pkgs[@]}; do
for arch in ${arches[@]}; do
- for pkg in "${pkgdir}/${pkgbase}"/*-${arch}.pkg.tar.*; do
+ for pkg in "${pkgdir}/${pkgbase}"/*-${arch}${PKGEXT}; do
checkPackage extra $(basename ${pkg}) ${arch}
done
done
@@ -76,7 +82,7 @@ testUpdateAnyPackage() {
pushd "${TMP}/svn-packages-copy/pkg-any-a/trunk/" >/dev/null
sed 's/pkgrel=1/pkgrel=2/g' -i PKGBUILD
svn commit -q -m"update pkg to pkgrel=2" >/dev/null
- extra-i686-build >/dev/null 2>&1
+ sudo extra-i686-build >/dev/null 2>&1
mv pkg-any-a-1-2-any.pkg.tar.xz "${pkgdir}/pkg-any-a/"
popd >/dev/null
@@ -94,7 +100,7 @@ testUpdateAnyPackageToDifferentRepositoriesAtOnce() {
pushd "${TMP}/svn-packages-copy/pkg-any-a/trunk/" >/dev/null
sed 's/pkgrel=1/pkgrel=2/g' -i PKGBUILD
svn commit -q -m"update pkg to pkgrel=2" >/dev/null
- extra-i686-build >/dev/null 2>&1
+ sudo extra-i686-build >/dev/null 2>&1
mv pkg-any-a-1-2-any.pkg.tar.xz "${pkgdir}/pkg-any-a/"
popd >/dev/null
diff --git a/test/test.d/ftpdir-cleanup.sh b/test/test.d/ftpdir-cleanup.sh
index e9b977b..77b02b8 100755
--- a/test/test.d/ftpdir-cleanup.sh
+++ b/test/test.d/ftpdir-cleanup.sh
@@ -34,6 +34,34 @@ testCleanupSimplePackages() {
done
}
+testCleanupEpochPackages() {
+ local arches=('i686' 'x86_64')
+ local pkgs=('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 pkg-simple-epoch extra ${arch}
+ done
+
+ ../cron-jobs/ftpdir-cleanup >/dev/null
+
+ for arch in ${arches[@]}; do
+ local pkg1="pkg-simple-epoch-1:1-1-${arch}.pkg.tar.xz"
+ checkRemovedPackage extra 'pkg-simple-epoch' ${arch}
+ [ -f "${FTP_BASE}/${PKGPOOL}/${pkg1}" ] && fail "${PKGPOOL}/${pkg1} found"
+ [ -f "${FTP_BASE}/${repo}/os/${arch}/${pkg1}" ] && fail "${repo}/os/${arch}/${pkg1} found"
+ done
+}
+
testCleanupAnyPackages() {
local pkgs=('pkg-any-a' 'pkg-any-b')
local pkgbase
@@ -78,13 +106,13 @@ testCleanupSplitPackages() {
../cron-jobs/ftpdir-cleanup >/dev/null
for arch in ${arches[@]}; do
- for pkg in "${pkgdir}/${pkgs[0]}"/*-${arch}.pkg.tar.*; do
+ for pkg in "${pkgdir}/${pkgs[0]}"/*-${arch}${PKGEXT}; do
checkRemovedPackage extra ${pkgs[0]} ${arch}
[ -f "${FTP_BASE}/${PKGPOOL}/${pkg}" ] && fail "${PKGPOOL}/${pkg} found"
[ -f "${FTP_BASE}/${repo}/os/${arch}/${pkg}" ] && fail "${repo}/os/${arch}/${pkg} found"
done
- for pkg in "${pkgdir}/${pkgs[1]}"/*-${arch}.pkg.tar.*; do
+ for pkg in "${pkgdir}/${pkgs[1]}"/*-${arch}${PKGEXT}; do
checkPackage extra $(basename ${pkg}) ${arch}
done
done
diff --git a/test/test.d/pool-transition.sh b/test/test.d/pool-transition.sh
index 6d82e00..5873f00 100755
--- a/test/test.d/pool-transition.sh
+++ b/test/test.d/pool-transition.sh
@@ -22,7 +22,7 @@ testMovePackagesWithoutPool() {
# transform two packages to old style layout
for arch in ${arches[@]}; do
for old in 0 2; do
- for pkg in "${pkgdir}/${pkgs[${old}]}"/*-${arch}.pkg.tar.*; do
+ for pkg in "${pkgdir}/${pkgs[${old}]}"/*-${arch}${PKGEXT}; do
pkg=$(basename $pkg)
mv -f "${FTP_BASE}/${PKGPOOL}/${pkg}" "${FTP_BASE}/testing/os/${arch}/${pkg}"
done
@@ -37,7 +37,7 @@ testMovePackagesWithoutPool() {
for pkgbase in ${pkgs[@]}; do
for arch in ${arches[@]}; do
- for pkg in "${pkgdir}/${pkgbase}"/*-${arch}.pkg.tar.*; do
+ for pkg in "${pkgdir}/${pkgbase}"/*-${arch}${PKGEXT}; do
checkPackage extra $(basename ${pkg}) ${arch}
done
checkRemovedPackage testing ${pkgbase} ${arch}
@@ -63,7 +63,7 @@ testUpdateAnyPackageWithoutPool() {
pushd "${TMP}/svn-packages-copy/${pkgname}/trunk/" >/dev/null
sed 's/pkgrel=1/pkgrel=2/g' -i PKGBUILD
svn commit -q -m"update pkg to pkgrel=2" >/dev/null
- extra-i686-build >/dev/null 2>&1
+ sudo extra-i686-build >/dev/null 2>&1
mv "${pkg2}" "${pkgdir}/${pkgname}/"
popd >/dev/null
@@ -94,7 +94,7 @@ testMoveAnyPackagesWithoutPool() {
../db-update
# transform a package to old style layout
- for pkg in "${pkgdir}/${pkgs[0]}"/*-any.pkg.tar.*; do
+ for pkg in "${pkgdir}/${pkgs[0]}"/*-any${PKGEXT}; do
pkg=$(basename $pkg)
mv -f "${FTP_BASE}/${PKGPOOL}/${pkg}" "${FTP_BASE}/testing/os/any/${pkg}"
for arch in i686 x86_64; do
@@ -109,13 +109,13 @@ testMoveAnyPackagesWithoutPool() {
../cron-jobs/ftpdir-cleanup >/dev/null
for pkgbase in ${pkgs[@]}; do
- for pkg in "${pkgdir}/${pkgbase}"/*-any.pkg.tar.*; do
+ for pkg in "${pkgdir}/${pkgbase}"/*-any${PKGEXT}; do
checkAnyPackage extra $(basename ${pkg})
done
checkRemovedAnyPackage testing ${pkgbase}
done
- for pkg in "${pkgdir}/${pkgs[0]}"/*-any.pkg.tar.*; do
+ for pkg in "${pkgdir}/${pkgs[0]}"/*-any${PKGEXT}; do
pkg=$(basename $pkg)
for arch in any i686 x86_64; do
[ -f "${FTP_BASE}/testing/os/${arch}/${pkg}" ] && fail "testing/os/${arch}/${pkg} found"
@@ -131,7 +131,7 @@ testUpdateSameAnyPackageToDifferentRepositoriesWithoutPool() {
../db-update
# transform a package to old style layout
- for pkg in "${pkgdir}/pkg-any-a"/*-any.pkg.tar.*; do
+ for pkg in "${pkgdir}/pkg-any-a"/*-any${PKGEXT}; do
pkg=$(basename $pkg)
mv -f "${FTP_BASE}/${PKGPOOL}/${pkg}" "${FTP_BASE}/extra/os/any/${pkg}"
for arch in i686 x86_64; do
diff --git a/test/test.d/signed-packages.sh b/test/test.d/signed-packages.sh
new file mode 100755
index 0000000..5d6f4ff
--- /dev/null
+++ b/test/test.d/signed-packages.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+curdir=$(readlink -e $(dirname $0))
+. "${curdir}/../lib/common.inc"
+
+testAddUnsignedPackage() {
+ releasePackage extra 'pkg-simple-a' 'i686'
+ # remove any signature
+ rm "${STAGING}"/extra/*.sig
+ ../db-update >/dev/null 2>&1 && fail "db-update should fail when a signature is missing!"
+}
+
+. "${curdir}/../lib/shunit2"
diff --git a/test/test.d/sourceballs.sh b/test/test.d/sourceballs.sh
index 8cba017..11bd0f4 100755
--- a/test/test.d/sourceballs.sh
+++ b/test/test.d/sourceballs.sh
@@ -5,7 +5,7 @@ curdir=$(readlink -e $(dirname $0))
testSourceballs() {
local arches=('i686' 'x86_64')
- local pkgs=('pkg-simple-a' 'pkg-simple-b')
+ local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-simple-epoch')
local pkgbase
local arch
diff --git a/test/test.d/testing2x.sh b/test/test.d/testing2x.sh
index 436716d..eda6cd6 100755
--- a/test/test.d/testing2x.sh
+++ b/test/test.d/testing2x.sh
@@ -10,7 +10,7 @@ testTesting2xAnyPackage() {
pushd "${TMP}/svn-packages-copy/pkg-any-a/trunk/" >/dev/null
sed 's/pkgrel=1/pkgrel=2/g' -i PKGBUILD
svn commit -q -m"update pkg to pkgrel=2" >/dev/null
- extra-i686-build >/dev/null 2>&1
+ sudo extra-i686-build >/dev/null 2>&1
mv pkg-any-a-1-2-any.pkg.tar.xz "${pkgdir}/pkg-any-a/"
popd >/dev/null