diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2017-04-18 18:49:23 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2017-04-18 18:49:23 +0200 |
commit | c33e9409cbec408222875f8a71d324362b9cb043 (patch) | |
tree | cd3863e1d4a71551f1289ec47c5fd04c598116de | |
parent | 32d99fb5c287d2dc3bb35b41aa471e9f48ea7910 (diff) |
db-update: Test package validation
-rwxr-xr-x | test/test.d/db-update.sh | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/test/test.d/db-update.sh b/test/test.d/db-update.sh index c691c40..f0a8416 100755 --- a/test/test.d/db-update.sh +++ b/test/test.d/db-update.sh @@ -230,5 +230,39 @@ testAddPackageWithInconsistentSVNFails() { popd >/dev/null ../db-update >/dev/null 2>&1 && fail "db-update should fail when a package is not consistent!" - checkRemovedPackage extra 'foo-pkg-simple-a-1-1-i686.pkg.tar.xz' 'i686' + checkRemovedPackage extra 'pkg-simple-a-1-1-i686.pkg.tar.xz' 'i686' +} + +testAddPackageWithInsufficientPermissionsFails() +{ + releasePackage core 'pkg-simple-a' 'i686' + releasePackage extra 'pkg-simple-b' 'i686' + + chmod -xwr ${FTP_BASE}/core/os/i686 + ../db-update >/dev/null 2>&1 && fail "db-update should fail when permissions are insufficient!" + chmod +xwr ${FTP_BASE}/core/os/i686 + + checkRemovedPackage core 'pkg-simple-a-1-1-i686.pkg.tar.xz' 'i686' + checkRemovedPackage extra 'pkg-simple-b-1-1-i686.pkg.tar.xz' 'i686' +} + +testPackageHasToBeARegularFile() +{ + local p + local target=$(mktemp -d) + local arches=('i686' 'x86_64') + + for arch in ${arches[@]}; do + releasePackage extra 'pkg-simple-a' $arch + done + + for p in "${STAGING}"/extra/*i686*; do + mv "${p}" "${target}" + ln -s "${target}/${p##*/}" "${p}" + done + + ../db-update >/dev/null 2>&1 && fail "db-update should fail when a package is a symlink!" + for arch in ${arches[@]}; do + checkRemovedPackage extra "pkg-simple-a-1-1-${arch}.pkg.tar.xz" $arch + done } |