summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2016-11-06 20:43:41 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2016-11-06 21:32:41 +0000
commita88e7bbd4c9fda64ecd018a298684be2f625dc81 (patch)
treee4ad566d48623f058ab8a5b1cf1fb6ed40ed7c15 /tests
parentf046c1a2174b3ee12b57ce7baf777f6fd518608b (diff)
Test suite: Provide reprepro test (for aptget method)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib-reprepro69
-rwxr-xr-xtests/tests/clone-reprepro17
2 files changed, 86 insertions, 0 deletions
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.