From 24076608e1b3443c3645ad207199aeb274f080e2 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 16 Nov 2013 16:50:29 +0000 Subject: autopkgtests: Provide tests/lib, and one pari-extra based clone test. --- 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 ++++++++ 5 files changed, 109 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 (limited to 'tests') diff --git a/tests/lib b/tests/lib new file mode 100644 index 0000000..509989a --- /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 0000000..81f7f2e Binary files /dev/null and b/tests/pkg-srcs/pari-extra_3-1.diff.gz differ 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 0000000..8d67ed0 --- /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 0000000..ff30279 Binary files /dev/null and b/tests/pkg-srcs/pari-extra_3.orig.tar.gz differ diff --git a/tests/tests/clone-nogit b/tests/tests/clone-nogit new file mode 100755 index 0000000..746dc69 --- /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 -- cgit v1.2.3