diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-01-07 15:52:51 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-01-08 22:14:26 +0000 |
commit | 05429577db36fa4e71743f3695e03e2d19bf509e (patch) | |
tree | 6470e6d2cb0fb09882e7deeaa4463a630055431d /tests | |
parent | c5e48c92d1d589c55fb952ee623b5b4c66267d3c (diff) |
test suite: Refactor lib-reprepro
* Break out t-reprepro-cfg.
* Introduce the variables `mir' and `etcapt' to many functions.
No functional change.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib-reprepro | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/tests/lib-reprepro b/tests/lib-reprepro index af33143..88102c8 100644 --- a/tests/lib-reprepro +++ b/tests/lib-reprepro @@ -4,17 +4,24 @@ t-reprepro () { t_archive_method=reprepro + t-reprepro-cfg +} + +t-reprepro-cfg () { + local etcapt=$tmp/etc-apt + local mir=$tmp/mirror + t-git-config dgit-distro.test-dummy.archive-query aptget: - t-git-config dgit-distro.test-dummy.mirror file://$tmp/mirror/ + t-git-config dgit-distro.test-dummy.mirror file://$mir/ - mkdir $tmp/etc-apt - cat >$tmp/etc-apt/conf <<END -Dir::Etc "$tmp/etc-apt"; + mkdir $etcapt + cat >$etcapt/conf <<END +Dir::Etc "$etcapt"; END - export APT_CONFIG=$tmp/etc-apt/conf + export APT_CONFIG=$etcapt/conf gpg --export Hannibal >han.pgp fakeroot apt-key add <han.pgp - mkdir $tmp/etc-apt/apt.conf.d + mkdir $etcapt/apt.conf.d } t-archive-none-reprepro () { @@ -30,9 +37,10 @@ t-archive-query-reprepro () { } t-reprepro-setup () { - local rrc=$tmp/mirror/conf + local mir=$tmp/mirror + local rrc=$mir/conf mkdir -p $rrc - mkdir -p $tmp/mirror/pool/main + mkdir -p $mir/pool/main exec 3>$rrc/distributions @@ -42,10 +50,10 @@ t-reprepro-setup () { local suite=${suitespec%%:*} local sname=${suitespec#*:} - mkdir -p $tmp/mirror/dists + mkdir -p $mir/dists if [ $sname != $suite ]; then - rm -f $tmp/mirror/dists/$sname - ln -s $suite $tmp/mirror/dists/$sname + rm -f $mir/dists/$sname + ln -s $suite $mir/dists/$sname fi cat >&3 <<END @@ -60,9 +68,10 @@ END } t-run-reprepro () { + local mir=$tmp/mirror reprepro \ - --outdir $tmp/mirror \ - --basedir $tmp/mirror \ + --outdir $mir \ + --basedir $mir \ "$@" } |