summaryrefslogtreecommitdiff
path: root/extra/lukeshu-xbs/test/test.d/create-filelists.sh
diff options
context:
space:
mode:
Diffstat (limited to 'extra/lukeshu-xbs/test/test.d/create-filelists.sh')
-rwxr-xr-xextra/lukeshu-xbs/test/test.d/create-filelists.sh105
1 files changed, 105 insertions, 0 deletions
diff --git a/extra/lukeshu-xbs/test/test.d/create-filelists.sh b/extra/lukeshu-xbs/test/test.d/create-filelists.sh
new file mode 100755
index 0000000..b5ec5c8
--- /dev/null
+++ b/extra/lukeshu-xbs/test/test.d/create-filelists.sh
@@ -0,0 +1,105 @@
+#!/bin/bash
+
+curdir="$(readlink -e "$(dirname "$0")")"
+. "${curdir}/../lib/common.inc"
+
+testCreateSimpleFileLists() {
+ local arches=(`arches`)
+ 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 "usr/bin/${pkgbase}" &>/dev/null; then
+ fail "usr/bin/${pkgbase} not found in ${arch}/extra${FILESEXT}"
+ fi
+ done
+ done
+}
+
+testCreateAnyFileLists() {
+ local arches=(`arches`)
+ 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 "usr/share/${pkgbase}/test" &>/dev/null; then
+ fail "usr/share/${pkgbase}/test not found in ${arch}/extra${FILESEXT}"
+ fi
+ done
+ done
+}
+
+testCreateSplitFileLists() {
+ local arches=(`arches`)
+ 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 "usr/bin/${pkgname}" &>/dev/null; then
+ fail "usr/bin/${pkgname} not found in ${arch}/extra${FILESEXT}"
+ fi
+ done
+ done
+ done
+}
+
+
+testCleanupFileLists() {
+ local arches=(`arches`)
+ 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 "usr/bin/pkg-simple-b" &>/dev/null; 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 "usr/bin/pkg-simple-a" &>/dev/null; then
+ fail "usr/bin/pkg-simple-a still found in ${arch}/extra${FILESEXT}"
+ fi
+ done
+
+}
+
+. "${curdir}/../lib/shunit2"