From 24076608e1b3443c3645ad207199aeb274f080e2 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 16 Nov 2013 16:50:29 +0000 Subject: [PATCH] autopkgtests: Provide tests/lib, and one pari-extra based clone test. --- .gitignore | 1 + debian/changelog | 1 + debian/copyright | 6 +++ tests/lib | 64 ++++++++++++++++++++++++ tests/pkg-srcs/pari-extra_3-1.diff.gz | Bin 0 -> 2358 bytes tests/pkg-srcs/pari-extra_3-1.dsc | 30 +++++++++++ tests/pkg-srcs/pari-extra_3.orig.tar.gz | Bin 0 -> 121 bytes tests/tests/clone-nogit | 15 ++++++ 8 files changed, 117 insertions(+) create mode 100644 tests/lib create mode 100644 tests/pkg-srcs/pari-extra_3-1.diff.gz create mode 100644 tests/pkg-srcs/pari-extra_3-1.dsc create mode 100644 tests/pkg-srcs/pari-extra_3.orig.tar.gz create mode 100755 tests/tests/clone-nogit diff --git a/.gitignore b/.gitignore index 1632e2a6..737875fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *~ +tests/tmp debian/dgit debian/files debian/*.substvars diff --git a/debian/changelog b/debian/changelog index ff334e43..f2b61265 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ dgit (0.19~experimental1) experimental; urgency=low Testing facilities: * Provide "test-dummy" distro with "dummycat" access method. * Provide fake "ssh" program in tests/ which does nothing much. + * Provide tests/lib, and one pari-extra based clone test. -- diff --git a/debian/copyright b/debian/copyright index 461cbfdd..081ff315 100644 --- a/debian/copyright +++ b/debian/copyright @@ -15,3 +15,9 @@ GNU General Public License for more details. A copy of the GNU General Public License v3 can be found in /usr/share/common-licenses/GPL-3. + + +The tests/ directory contains a complete copy of the source code for +the pari-extra 3-1 package. This is a dummy package containing only +Debian metadata, by Bill Alombert, with a licence statement saying +it's GPL (implicitly GPLv3 compatible). diff --git a/tests/lib b/tests/lib new file mode 100644 index 00000000..509989a1 --- /dev/null +++ b/tests/lib @@ -0,0 +1,64 @@ +# + +exec 2>&1 + +root=`pwd` +troot=$root/tests +testname="${0##*/}" + +tmp=$ADTTMP +if [ x"$tmp" = x ]; then + mkdir -p tests/tmp + tmp=tests/tmp/$testname + rm -rf $tmp + mkdir $tmp +fi +cd $tmp +tmp=`pwd` +export DGIT_TEST_DUMMY_DIR=$tmp +ln $troot/ssh ssh + +t-git () { + mkdir -p git + cp -al $troot/git-srcs/$1 git/. +} + +t-archive () { + p=$1 + mkdir -p aq mirror + local dscf=${p}_$2.dsc + ln $troot/pkg-srcs/${p}_${2%-*}* mirror/ + echo sid >aq/suite.unstable + echo "$2 $dscf" >>aq/package.sid.${p} + mkdir extract + (set -e; cd extract; dpkg-source -x ../mirror/$dscf) +} + +t-dgit () { + ${DGIT_TEST-dgit} --dget:-u -dtest-dummy "$@" +} + +t-diff-nogit () { + diff --exclude=.git -ruN $* +} + +t-output () { + printf "%s\n" "$1" >$tmp/t.want + shift + "$@" >$tmp/t.got + diff $tmp/t.want $tmp/t.got +} + +t-clean-on-branch () { + t-output "## $1" git status -b --porcelain +} + +t-refs-same () { + local f=$1 + git rev-parse $f >$tmp/t.ref1 + local g + for g in $*; do + git rev-parse $g >$tmp/t.refn + diff $tmp/t.ref1 $tmp/t.refn + done +} diff --git a/tests/pkg-srcs/pari-extra_3-1.diff.gz b/tests/pkg-srcs/pari-extra_3-1.diff.gz new file mode 100644 index 0000000000000000000000000000000000000000..81f7f2ebe4405f08a53fd930310b6396a928296b GIT binary patch literal 2358 zcmV-63CZ>!iwFP!000021FcwXbK5o&{#^Zvy~)j-Q;C#lNp{3*GJZ|$HcmWt(wqC# zgGfk1O#&PMl&s#|54zuRf9!Svk|q<&ZaU3O5|LaicAtHFfFKBkf&wH%Hf?_@obpR&G1dN9^Fe+UX<1+!x>wP6mCNJi6mjqEjap0 z(M$L&g$o%%gdw}#rjl<7nYSF5Ein3&v=k?dp0Exyz*;*ISq8^hrt&%0Xz`r+-$%Zf zu>6*90N!dbfYB6=%O&iOq6nf%9KDJsW9X0eN26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zZr0coR=7LR$*h($ literal 0 HcmV?d00001 diff --git a/tests/pkg-srcs/pari-extra_3-1.dsc b/tests/pkg-srcs/pari-extra_3-1.dsc new file mode 100644 index 00000000..8d67ed0a --- /dev/null +++ b/tests/pkg-srcs/pari-extra_3-1.dsc @@ -0,0 +1,30 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +Format: 1.0 +Source: pari-extra +Binary: pari-extra +Architecture: all +Version: 3-1 +Maintainer: Bill Allombert +Standards-Version: 3.9.2.0 +Build-Depends: debhelper (>= 5) +Package-List: + pari-extra deb math optional +Checksums-Sha1: + ff281e103ab11681324b0c694dd3514d78436c51 121 pari-extra_3.orig.tar.gz + 080078dbc51e4194d209cb5abe57e2b25705fcaa 2358 pari-extra_3-1.diff.gz +Checksums-Sha256: + ac1ef39f9da80b582d1c0b2adfb09b041e3860ed20ddcf57a0e922e3305239df 121 pari-extra_3.orig.tar.gz + bf4672acd5302b9eebee2f3bf5269022279e531204d7172b8761bb10fae3517a 2358 pari-extra_3-1.diff.gz +Files: + 76bcf03be979d3331f9051aa88439b8b 121 pari-extra_3.orig.tar.gz + 02a39965adb84da9b3e6b5c5a0a4c378 2358 pari-extra_3-1.diff.gz + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.10 (GNU/Linux) + +iEYEARECAAYFAk5CvdoACgkQeDPs8bVESBX0mACeK3Yf9y22T2b6tw8eVQ8XSYxH +ix4AoJJ3jrGJ4HXJNv/wbvmvBkkybvYJ +=hkic +-----END PGP SIGNATURE----- diff --git a/tests/pkg-srcs/pari-extra_3.orig.tar.gz b/tests/pkg-srcs/pari-extra_3.orig.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..ff3027992fcd8cfff9e696c498b1fe640ac6cb0e GIT binary patch literal 121 zcmb2|=3v-=$J&p9`RzGFu0swYEEjA~#VO42y>a)m%La}m6HJ?qn~OD>MX6q`K6_xk z=D*Uc;_}Khxv!1|-*Df*(sIAi)jRdiqCHkF2`ZL6Rp!64&$**=dHudS`LC}e@jS1L Xtb6`gMk46S|~Q? literal 0 HcmV?d00001 diff --git a/tests/tests/clone-nogit b/tests/tests/clone-nogit new file mode 100755 index 00000000..746dc69c --- /dev/null +++ b/tests/tests/clone-nogit @@ -0,0 +1,15 @@ +#!/bin/bash +set -e +. tests/lib + +t-git none +t-archive pari-extra 3-1 + +t-dgit clone $p + +t-diff-nogit extract/$p-3 $p +cd $p +t-clean-on-branch dgit/sid +t-refs-same HEAD remotes/dgit/dgit/sid + +echo ok -- 2.30.2