diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2016-11-06 20:43:41 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2016-11-06 21:32:41 +0000 |
commit | a88e7bbd4c9fda64ecd018a298684be2f625dc81 (patch) | |
tree | e4ad566d48623f058ab8a5b1cf1fb6ed40ed7c15 | |
parent | f046c1a2174b3ee12b57ce7baf777f6fd518608b (diff) |
Test suite: Provide reprepro test (for aptget method)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rw-r--r-- | debian/tests/control | 4 | ||||
-rw-r--r-- | tests/lib-reprepro | 69 | ||||
-rwxr-xr-x | tests/tests/clone-reprepro | 17 |
3 files changed, 90 insertions, 0 deletions
diff --git a/debian/tests/control b/debian/tests/control index 6a6d92a..0aaabed 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -2,6 +2,10 @@ Tests: build-modes-gbp Tests-Directory: tests/tests Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, make, git-buildpackage +Tests: clone-reprepro +Tests-Directory: tests/tests +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, make, reprepro + Tests: dsd-clone-drs Tests-Directory: tests/tests Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, make diff --git a/tests/lib-reprepro b/tests/lib-reprepro new file mode 100644 index 0000000..8702044 --- /dev/null +++ b/tests/lib-reprepro @@ -0,0 +1,69 @@ +# -*- bash -*- + +t-reprepro () { + + t_archive_method=reprepro + + t-git-config dgit-distro.test-dummy.archive-query aptget: + t-git-config dgit-distro.test-dummy.mirror file://$tmp/mirror/ + + mkdir $tmp/etc-apt + cat >$tmp/etc-apt/conf <<END +Dir::Etc "$tmp/etc-apt"; +END + export APT_CONFIG=$tmp/etc-apt/conf + gpg --export Hannibal >han.pgp + fakeroot apt-key add <han.pgp + mkdir $tmp/etc-apt/apt.conf.d +} + +t-archive-none-reprepro () { + t-reprepro-setup + t-reprepro-regen +} +t-archive-query-reprepro () { + local suite=$1 + local p=$2 + local v=$3 + local dscf=$4 + t-run-reprepro includedsc $suite $tmp/mirror/pool/$dscf +} + +t-reprepro-setup () { + local rrc=$tmp/mirror/conf + mkdir -p $rrc + mkdir -p $tmp/mirror/pool/main + + exec 3>$rrc/distributions + + local arch=`dpkg --print-architecture` + + for suitespec in $suitespecs; do + local suite=${suitespec%%:*} + local sname=${suitespec#*:} + + mkdir $tmp/mirror/dists + rm -f $tmp/mirror/dists/$sname + ln -s $suite $tmp/mirror/dists/$sname + + cat >&3 <<END +Suite: $sname +Codename: $suite +Components: main +Architectures: source binary-$arch +SignWith: Hannibal + +END + done +} + +t-run-reprepro () { + reprepro \ + --outdir $tmp/mirror \ + --basedir $tmp/mirror \ + "$@" +} + +t-reprepro-regen () { + t-run-reprepro export +} diff --git a/tests/tests/clone-reprepro b/tests/tests/clone-reprepro new file mode 100755 index 0000000..1313289 --- /dev/null +++ b/tests/tests/clone-reprepro @@ -0,0 +1,17 @@ +#!/bin/bash +set -e +. tests/lib +. $troot/lib-reprepro + +t-dependencies reprepro +t-reprepro + +t-archive example 1.0-1 +t-git-none + +t-dgit clone $p + +cd $p +t-cloned-fetched-good + +echo ok. |