diff options
author | coadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu> | 2015-08-26 03:33:26 -0300 |
---|---|---|
committer | coadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu> | 2015-08-26 03:33:26 -0300 |
commit | 8eafe04ec5eaf917d9e2d58993604c454f1a26d1 (patch) | |
tree | c0e9bb91659c3a1f5814ba94ee251639b52c5873 /extra/coadde/test/test.d/create-filelists.sh | |
parent | f17c9169de91036cd4b9bb725d2cc6713ad06ce5 (diff) |
re-estructure dbscrips
Diffstat (limited to 'extra/coadde/test/test.d/create-filelists.sh')
-rwxr-xr-x | extra/coadde/test/test.d/create-filelists.sh | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/extra/coadde/test/test.d/create-filelists.sh b/extra/coadde/test/test.d/create-filelists.sh new file mode 100755 index 0000000..49734c4 --- /dev/null +++ b/extra/coadde/test/test.d/create-filelists.sh @@ -0,0 +1,105 @@ +#!/bin/bash + +curdir=$(readlink -e $(dirname $0)) +. "${curdir}/../lib/common.inc" + +testCreateSimpleFileLists() { + 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 + 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 +} + +testCreateAnyFileLists() { + local arches=('i686' 'x86_64') + local pkgs=('pkg-any-a' 'pkg-any-b') + local pkgbase + local arch + + for pkgbase in ${pkgs[@]}; do + releasePackage extra ${pkgbase} any + done + ../db-update + + for pkgbase in ${pkgs[@]}; do + for arch in ${arches[@]}; do + 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 +} + +testCreateSplitFileLists() { + local arches=('i686' 'x86_64') + local pkgs=('pkg-split-a' 'pkg-split-b') + local pkg + local pkgbase + local pkgname + local pkgnames + 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 + 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${FILESEXT}" | grep -q "usr/bin/${pkgname}"; then + fail "usr/bin/${pkgname} not found in ${arch}/extra${FILESEXT}" + fi + done + done + done +} + + +testCleanupFileLists() { + 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 extra ${pkgbase} ${arch} + done + done + ../db-update + + for arch in ${arches[@]}; do + ../db-remove extra ${arch} pkg-simple-a + done + + for arch in ${arches[@]}; do + 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${FILESEXT}" | grep -q "usr/bin/pkg-simple-a"; then + fail "usr/bin/pkg-simple-a still found in ${arch}/extra${FILESEXT}" + fi + done + +} + +. "${curdir}/../lib/shunit2" |