chiark / gitweb /
dgit-repos-server: fixes to testing arrangements
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 19 Jan 2014 23:32:15 +0000 (23:32 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 5 Mar 2014 18:29:03 +0000 (18:29 +0000)
tests/drs-git-ext
tests/lib

index f66384a..abb2bc8 100755 (executable)
@@ -3,6 +3,7 @@ set -e
 troot=$DGIT_TEST_TROOT
 tmp=$DGIT_TEST_TMP
 
+echo >&2 '(((((((((((((((((((((((((((((((((((((((('
 set -x
 export SSH_ORIGINAL_COMMAND="$*"
 ${DGIT_REPOS_SERVER_TEST-dgit-repos-server} \
@@ -10,3 +11,4 @@ ${DGIT_REPOS_SERVER_TEST-dgit-repos-server} \
        $tmp/dd.gpg,a:$tmp/dm.gpg,m$tmp/dm.txt \
        $troot/git \
        --sssh
+: '))))))))))))))))))))))))))))))))))))))))'
index 3dc46d6..dc0911b 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -5,7 +5,7 @@ set -x
 
 root=`pwd`
 troot=$root/tests
-testname="${0##*/}"
+testname="${DGIT_TEST_TESTNAME-${0##*/}}"
 
 tmp=$ADTTMP
 if [ x"$tmp" = x ]; then
@@ -15,16 +15,18 @@ if [ x"$tmp" = x ]; then
        mkdir $tmp
 fi
 cd $tmp
+export HOME=$tmp
+
 tmp=`pwd`
 export DGIT_TEST_DUMMY_DIR=$tmp
-ln $troot/ssh ssh
+ln -f $troot/ssh ssh
 
-mkdir $tmp/gnupg
+mkdir -p $tmp/gnupg
 cp $troot/gnupg/* $tmp/gnupg
 chmod go-rw $tmp/gnupg/*
 export GNUPGHOME=$tmp/gnupg
 
-mkdir $tmp/incoming
+mkdir -p $tmp/incoming
 cat <<END >$tmp/dput.cf
 [test-dummy]
 method                 = local
@@ -82,10 +84,13 @@ t-archive () {
 }
 
 t-dgit () {
-       : '{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{'
+       : '
+
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{'
        ${DGIT_TEST-dgit} --dget:-u --dput:--config=$tmp/dput.cf \
                -dtest-dummy $DGIT_TEST_OPTS -D -k39B13D8A "$@"
-       : '}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}'
+       : '}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
+'
 }
 
 t-diff-nogit () {
@@ -214,3 +219,24 @@ t-apply-diff () {
        (cd $troot/pkg-srcs; debdiff ${p}_${v1}.dsc ${p}_${v2}.dsc) \
                | patch -p1 -u
 }
+
+t-git-config () {
+       git config --global "$@"
+}
+
+t-drs () {
+       export DGIT_TEST_TROOT=$troot
+       export DGIT_TEST_TMP=$tmp
+       t-git-config dgit-distro.test-dummy.git-url "ext::$troot/drs-git-ext "
+       t-git-config dgit-distro.test-dummy.git-check true
+       t-git-config dgit-distro.test-dummy.git-create true
+}
+
+t-drs-test () {
+       t-drs
+       cd $root
+       export DGIT_TEST_TESTNAME="$testname"
+       export ADTTMP=$tmp
+       exec "${0///drs-//}" "$@"
+}
+