chiark / gitweb /
dgit-repos-server: wip tests
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 19 Jan 2014 15:04:00 +0000 (15:04 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 5 Mar 2014 18:29:03 +0000 (18:29 +0000)
dgit
dgit-repos-server
tests/drs-git-ext [new file with mode: 0755]
tests/drs-sshd [deleted file]
tests/lib
tests/tests/drs-newpackage [new file with mode: 0755]

diff --git a/dgit b/dgit
index 61a1f73..50c45d7 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -470,14 +470,6 @@ our %defcfg = ('dgit.default.distro' => 'debian',
               'dgit-distro.test-dummy.archive-query' => "dummycat:$td/aq",
               'dgit-distro.test-dummy.mirror' => "file://$td/mirror/",
               'dgit-distro.test-dummy.upload-host' => 'test-dummy',
               'dgit-distro.test-dummy.archive-query' => "dummycat:$td/aq",
               'dgit-distro.test-dummy.mirror' => "file://$td/mirror/",
               'dgit-distro.test-dummy.upload-host' => 'test-dummy',
-              'dgit-distro.test-dummy-drs.ssh' => "$td/ssh",
-              'dgit-distro.test-dummy-drs.username' => "alice",
-              'dgit-distro.test-dummy-drs.git-check' => "true",
-              'dgit-distro.test-dummy-drs.git-create' => "true",
-              'dgit-distro.test-dummy-drs.git-url' => "$td/git",
-              'dgit-distro.test-dummy-drs.archive-query' => "dummycat:$td/aq",
-              'dgit-distro.test-dummy-drs.mirror' => "file://$td/mirror/",
-              'dgit-distro.test-dummy-drs.upload-host' => 'test-dummy',
                );
 
 sub cfg {
                );
 
 sub cfg {
index e6b2dfb..cbbfe1e 100644 (file)
@@ -1,10 +1,10 @@
 #!/usr/bin/perl -w
 #!/usr/bin/perl -w
-# dgit-repos-push-receiver
+# dgit-repos-server
 #
 # usages:
 #
 # usages:
-#  .../dgit-repos-push-receiver SUITES KEYRING-AUTH-SPEC DGIT-REPOS-DIR --ssh
+#  .../dgit-repos-server SUITES KEYRING-AUTH-SPEC DGIT-REPOS-DIR --ssh
 # internal usage:
 # internal usage:
-#  .../dgit-repos-push-receiver --pre-receive-hook PACKAGE
+#  .../dgit-repos-server --pre-receive-hook PACKAGE
 #
 # Invoked as the ssh restricted command
 #
 #
 # Invoked as the ssh restricted command
 #
diff --git a/tests/drs-git-ext b/tests/drs-git-ext
new file mode 100755 (executable)
index 0000000..f66384a
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -e
+troot=$DGIT_TEST_TROOT
+tmp=$DGIT_TEST_TMP
+
+set -x
+export SSH_ORIGINAL_COMMAND="$*"
+${DGIT_REPOS_SERVER_TEST-dgit-repos-server} \
+       $tmp/suites \
+       $tmp/dd.gpg,a:$tmp/dm.gpg,m$tmp/dm.txt \
+       $troot/git \
+       --sssh
diff --git a/tests/drs-sshd b/tests/drs-sshd
deleted file mode 100755 (executable)
index d8b8d91..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-${DGIT_REPOS_SERVER_TEST-dgit-repos-server}   xxx wip
index b80989d..3dc46d6 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -84,7 +84,7 @@ t-archive () {
 t-dgit () {
        : '{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{'
        ${DGIT_TEST-dgit} --dget:-u --dput:--config=$tmp/dput.cf \
 t-dgit () {
        : '{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{'
        ${DGIT_TEST-dgit} --dget:-u --dput:--config=$tmp/dput.cf \
-               -dtest-dummy -D -k39B13D8A "$@"
+               -dtest-dummy $DGIT_TEST_OPTS -D -k39B13D8A "$@"
        : '}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}'
 }
 
        : '}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}'
 }
 
diff --git a/tests/tests/drs-newpackage b/tests/tests/drs-newpackage
new file mode 100755 (executable)
index 0000000..a6d2d0d
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+export DGIT_TEST_TROOT=$troot
+export DGIT_TEST_TMP=$tmp
+export DGIT_TEST_OPTS="
+    -cdgit-distro.test-dummy.git-url=ext::$troot/drs-git-ext
+"
+
+t-archive-none pari-extra
+t-git-none
+t-worktree 3-1
+v=3-1
+cd $p
+git branch -m dgit/sid master
+git remote rm dgit
+
+t-refs-same-start
+t-ref-head
+
+t-dgit build
+t-dgit push --new
+
+t-pushed-good master
+
+echo ok.