diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/lib/common.inc | 7 | ||||
-rwxr-xr-x | test/runTest | 59 |
2 files changed, 63 insertions, 3 deletions
diff --git a/test/lib/common.inc b/test/lib/common.inc index a0d864a..14dc000 100644 --- a/test/lib/common.inc +++ b/test/lib/common.inc @@ -43,9 +43,9 @@ setUp() { mkdir -p "${TMP}/ftp/${r}/os/${a}" done done - for p in ${PKGPOOL[@]}; do - mkdir -p "${TMP}/ftp/${p}" - done + mkdir -p "${TMP}/ftp/${PKGPOOL}" + mkdir -p "${TMP}/ftp/${SRCPOOL}" + mkdir -p "${TMP}/log" msg 'Creating svn repository...' svnadmin create "${TMP}/svn-packages-repo" @@ -69,6 +69,7 @@ setUp() { SOURCE_CLEANUP_DESTDIR="${TMP}/source-cleanup" STAGING="${TMP}/staging" TMPDIR="${TMP}/tmp" + LOGDIR="${TMP}/log" CLEANUP_DRYRUN=false eot . "${curdir}/../config" diff --git a/test/runTest b/test/runTest index 4681944..d3e2eff 100755 --- a/test/runTest +++ b/test/runTest @@ -535,5 +535,64 @@ testUpdateSameAnyPackageToDifferentRepositoriesWithoutPool() { done } +# +#sourceballs tests +# + +testSourceballs() { + 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 + + ../cron-jobs/sourceballs + + for log in errors failed; do + if [ -s "${LOGDIR}/sourceballs/${log}.txt" ]; then + fail "${LOGDIR}/sourceballs/${log}.txt includes the following errors:" + cat "${LOGDIR}/sourceballs/${log}.txt" + fi + done + for pkgbase in ${pkgs[@]}; do + [ ! -r ${FTP_BASE}/${SRCPOOL}/${pkgbase}-*${SRCEXT} ] && fail "source package not found!" + done +} + +testSourceballsCleanup() { + 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 + ../cron-jobs/sourceballs + + for arch in ${arches[@]}; do + ../db-remove pkg-simple-a extra ${arch} + done + ../cron-jobs/ftpdir-cleanup >/dev/null + + ../cron-jobs/sourceballs + for log in errors failed; do + if [ -s "${LOGDIR}/sourceballs/${log}.txt" ]; then + fail "${LOGDIR}/sourceballs/${log}.txt includes the following errors:" + cat "${LOGDIR}/sourceballs/${log}.txt" + fi + done + [ -r ${FTP_BASE}/${SRCPOOL}/pkg-simple-a-*${SRCEXT} ] && fail "source package was not removed!" + [ ! -r ${FTP_BASE}/${SRCPOOL}/pkg-simple-b-*${SRCEXT} ] && fail "source package not found!" +} . "${curdir}/lib/shunit2" |