diff options
author | Florian Pritz <bluewind@xinu.at> | 2014-10-06 00:03:16 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2015-05-27 15:46:05 +0200 |
commit | aa4db02702313cf277b2c56b51ea9eb916de9468 (patch) | |
tree | b25fdcca6e6fbd116e678c76cd9fd7c032e2d19d | |
parent | e4e9960d734c8cbe5630454701f0289e0ed68d07 (diff) | |
download | dbscripts-aa4db02702313cf277b2c56b51ea9eb916de9468.tar.gz dbscripts-aa4db02702313cf277b2c56b51ea9eb916de9468.tar.xz |
make test.d/create-filelists.sh pass
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r-- | config | 3 | ||||
-rw-r--r-- | db-functions | 7 | ||||
-rw-r--r-- | test/lib/common.inc | 54 | ||||
-rwxr-xr-x | test/runTest | 8 |
4 files changed, 53 insertions, 19 deletions
@@ -1,6 +1,7 @@ FTP_BASE="/srv/ftp" HISTORYREPO="" -DBSCRIPTS_USER=dbscripts +#DBSCRIPTS_USER=dbscripts +DBSCRIPTS_USER=$USER SVNREPO='' SVNUSER='' PKGREPOS=() diff --git a/db-functions b/db-functions index 6bd3b5d..8e239f1 100644 --- a/db-functions +++ b/db-functions @@ -26,8 +26,8 @@ mv_acl() { if [[ $USER != $DBSCRIPTS_USER ]]; then exec sudo -H -u $DBSCRIPTS_USER "$0" "$@" -else - cd "$TMPDIR" +#else + #cd "$TMPDIR" fi # set up general environment @@ -626,9 +626,10 @@ get_file_from_pkgrepo() { # TODO: implement svn/git extraction # for git: cd $whereever; git show $tag:$filename - curl -s https://projects.archlinux.org/svntogit/community.git/plain/trunk/$filename?h=packages/$pkgbase + #curl -s https://projects.archlinux.org/svntogit/community.git/plain/trunk/$filename?h=packages/$pkgbase # TODO: this requires us to restructure the repos #arch_svn cat "${SVNREPO}/${_pkgbase}/tags/$tag/$filename" + arch_svn cat "${SVNREPO}/${_pkgbase}/trunk/$filename" } arch_svn() { diff --git a/test/lib/common.inc b/test/lib/common.inc index aeceece..cf22be5 100644 --- a/test/lib/common.inc +++ b/test/lib/common.inc @@ -88,6 +88,8 @@ setUp() { done mkdir -p "${TMP}/ftp/${PKGPOOL}" mkdir -p "${TMP}/ftp/${SRCPOOL}" + mkdir -p "${TMP}/history-repo" + git init "${TMP}/history-repo" msg 'Creating svn repository...' svnadmin create "${TMP}/svn-packages-repo" @@ -104,6 +106,7 @@ setUp() { cat <<eot > "$(dirname ${BASH_SOURCE[0]})/../../config.local" FTP_BASE="${TMP}/ftp" SVNREPO="file://${TMP}/svn-packages-repo" + HISTORYREPO="/${TMP}/history-repo" PKGREPOS=(${PKGREPOS[@]}) PKGPOOL="${PKGPOOL}" TESTING_REPO='testing' @@ -138,9 +141,26 @@ releasePackage() { archrelease ${repo}-${arch} >/dev/null 2>&1 pkgver=$(. PKGBUILD; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel})) pkgname=($(. PKGBUILD; echo ${pkgname[@]})) + popd >/dev/null cp "${pkgdir}/${pkgbase}"/*-${pkgver}-${arch}${PKGEXT} "${STAGING}"/${repo}/ + if [[ $arch == "any" ]]; then + arches=(i686 x86_64) + else + arches=($arch) + fi + + for _arch in "${arches[@]}"; do + # TODO: need to create the symlinks here (what commitpkg does) + for single_name in "${pkgname[@]}"; do + pkgfile=("${STAGING}/${repo}/"${single_name}-${pkgver}-${arch}${PKGEXT}) + pkgfile=${pkgfile[0]##*/} + mkdir -p "${STAGING}/${repo}/${_arch}" + ln -sr "${STAGING}/${repo}/${pkgfile}" "${STAGING}/${repo}/${_arch}/${pkgfile}" + done + done + if ${REQUIRE_SIGNATURE}; then for a in ${arch[@]}; do for p in ${pkgname[@]}; do @@ -188,10 +208,11 @@ checkAnyPackage() { checkAnyPackageDB $repo $pkg - local pkgbase=$(getpkgbase "${FTP_BASE}/${PKGPOOL}/${pkg}") - arch_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" +# TODO: remove? should not be needed anymore since we don't modify svn in dbscripts + #local pkgbase=$(getpkgbase "${FTP_BASE}/${PKGPOOL}/${pkg}") + #arch_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" } checkPackageDB() { @@ -230,10 +251,11 @@ checkPackage() { checkPackageDB $repo $pkg $arch - local pkgbase=$(getpkgbase "${FTP_BASE}/${PKGPOOL}/${pkg}") - arch_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" +# TODO: remove? should not be needed anymore since we don't modify svn in dbscripts + #local pkgbase=$(getpkgbase "${FTP_BASE}/${PKGPOOL}/${pkg}") + #arch_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" } checkRemovedPackageDB() { @@ -256,9 +278,10 @@ checkRemovedPackage() { checkRemovedPackageDB $repo $pkgbase $arch - arch_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} should not exist" +# TODO: remove? should not be needed anymore since we don't modify svn in dbscripts + #arch_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} should not exist" } checkRemovedAnyPackageDB() { @@ -282,7 +305,10 @@ checkRemovedAnyPackage() { checkRemovedAnyPackageDB $repo $pkgbase - arch_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 should not exist" +# TODO: remove? should not be needed anymore since we don't modify svn in dbscripts + #arch_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 should not exist" } + +# vim: ft=sh: diff --git a/test/runTest b/test/runTest index b8713d8..24c6c31 100755 --- a/test/runTest +++ b/test/runTest @@ -2,7 +2,13 @@ . "$(dirname ${BASH_SOURCE[0]})/lib/common.inc" -for t in "$(dirname ${BASH_SOURCE[0]})/test.d/"*.sh; do +if (($#>0)); then + tests=("$@") +else + tests=("$(dirname ${BASH_SOURCE[0]})/test.d/"*.sh) +fi + +for t in "${tests[@]}"; do l=$(basename ${t} .sh) if [ -x ${t} ]; then msg "Running test '${l}'" |