summaryrefslogtreecommitdiff
path: root/tests/setup
diff options
context:
space:
mode:
Diffstat (limited to 'tests/setup')
-rwxr-xr-xtests/setup/examplegit53
-rwxr-xr-xtests/setup/gnupg30
2 files changed, 83 insertions, 0 deletions
diff --git a/tests/setup/examplegit b/tests/setup/examplegit
new file mode 100755
index 0000000..112e27a
--- /dev/null
+++ b/tests/setup/examplegit
@@ -0,0 +1,53 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+suitespecs+=' stable testing'
+
+t-tstunt-parsechangelog
+
+t-prep-newpackage example 1.0
+
+cd $p
+
+revision=1
+
+push-to () {
+ t-refs-same-start
+ t-ref-head
+ t-dgit build
+ t-dgit push --new $2
+ t-pushed-good $1 $2
+ t-archive-process-incoming $2
+}
+
+echo ancestor >which
+git add which
+t-commit Ancestor '' stable
+push-to master stable
+
+git checkout -b stable
+
+echo stable >which
+git add which
+t-commit Stable '' stable
+push-to stable stable
+
+git checkout master
+
+majorv=2
+revision=0
+
+echo sid >which
+git add which
+t-commit Sid
+push-to master sid
+
+echo sid-again >>which
+git add which
+t-commit Sid
+push-to master sid
+
+t-setup-done 'p v suitespecs majorv revision' "aq git mirror $p"
+
+t-ok
diff --git a/tests/setup/gnupg b/tests/setup/gnupg
new file mode 100755
index 0000000..43a5c96
--- /dev/null
+++ b/tests/setup/gnupg
@@ -0,0 +1,30 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+mkdir -p $tmp/gnupg
+cp $troot/gnupg/* $tmp/gnupg
+chmod go-rw $tmp/gnupg/*
+
+export GNUPGHOME=$tmp/gnupg
+
+cat >$tmp/gnupg/gpg-agent.conf <<END
+log-file $tmp/gnupg/AGENT.log
+END
+#debug-all
+
+setup='
+ : ${DGIT_TEST_REAL_GPG_AGENT:=$(type -p gpg-agent)}
+ export DGIT_TEST_REAL_GPG_AGENT=$(type -p gpg-agent)
+ export DGIT_STUNT_AGENT=$troot/tstunt/gpg-agent
+ export GNUPGHOME
+ t-tstunt gpg
+'
+
+eval "$setup"
+
+gpg --list-secret
+
+t-setup-done 'GNUPGHOME' 'gnupg' "$setup"
+
+t-ok