From 45de45b658d33c746fcb25cc469c9d7c1f4d7059 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 26 Sep 2018 15:22:34 -0400 Subject: test: make_repo_torrents: Verify that it recovers from previous failures [ci-skip] --- test/cases/make_repo_torrents.bats | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/test/cases/make_repo_torrents.bats b/test/cases/make_repo_torrents.bats index 182449f..4d37ded 100644 --- a/test/cases/make_repo_torrents.bats +++ b/test/cases/make_repo_torrents.bats @@ -44,7 +44,26 @@ load ../lib/common releasePackage extra 'pkg-any-b' db-update - chmod -w ${FTP_BASE}/core/os/i686 + chmod -w "${FTP_BASE}/core/os/i686" if make_repo_torrents; then return 1; fi - chmod +w ${FTP_BASE}/core/os/i686 + chmod +w "${FTP_BASE}/core/os/i686" +} + +@test "make torrents maintains the pool after failure" { + releasePackage core 'pkg-any-a' + db-update + + mkdir "${FTP_BASE}/torrents" + chmod -w "${FTP_BASE}/torrents" + if make_repo_torrents; then return 1; fi + chmod +w "${FTP_BASE}/torrents" + + [[ ! -f "${FTP_BASE}/torrents/pkg-any-a-1-1-any${PKGEXT}.torrent" ]] + [[ -f "${FTP_BASE}/core/os/i686/pkg-any-a-1-1-any${PKGEXT}.torrent" ]] + + make_repo_torrents + + [[ -f "${FTP_BASE}/torrents/pkg-any-a-1-1-any${PKGEXT}.torrent" ]] + [[ -L "${FTP_BASE}/torrents/pkg-any-a-1-1-any${PKGEXT}.torrent" ]] + [[ -f "${FTP_BASE}/core/os/i686/pkg-any-a-1-1-any${PKGEXT}.torrent" ]] } -- cgit v1.2.2