summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2015-05-31 15:33:46 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2015-05-31 15:47:24 +0100
commit6b8c969adabf3b74d9deb836e5377a3e01c2a57b (patch)
treeb0d4be057b746da5b6e065921793ba0c3400e7be /tests
parent683b0eb026fa6b43cc0a9ae122764f9a5d031f59 (diff)
Test suite: move t-commit and break out t-policy (nfc)
Diffstat (limited to 'tests')
-rw-r--r--tests/lib18
-rwxr-xr-xtests/tests/debpolicy-newreject10
2 files changed, 16 insertions, 12 deletions
diff --git a/tests/lib b/tests/lib
index 7b17653..aec8612 100644
--- a/tests/lib
+++ b/tests/lib
@@ -370,6 +370,15 @@ t-apply-diff () {
| patch -p1 -u
}
+t-commit () {
+ local msg=$1
+ v=1.$revision
+ dch -v$v --distribution unstable "$1"
+ git add debian/changelog
+ debcommit
+ revision=$(( $revision + 1 ))
+}
+
t-git-config () {
git config --global "$@"
}
@@ -414,16 +423,21 @@ t-policy-admin () {
${DGIT_INFRA_PFX}dgit-repos-admin-debian --repos $tmp/git "$@"
}
-t-debpolicy () {
+t-policy () {
+ local policyhook=$1
t-dsd
- ln -sf ${DGIT_INFRA_PFX}dgit-repos-policy-debian \
+ ln -sf ${DGIT_INFRA_PFX}$policyhook \
$drs_dispatch/policy-hook
mkdir $tmp/git
t-policy-admin create-db
}
+t-debpolicy () {
+ t-policy dgit-repos-policy-debian
+}
+
t-policy-periodic () {
${DGIT_REPOS_SERVER_TEST-dgit-repos-server} \
test-dummy $drs_dispatch '' --cron
diff --git a/tests/tests/debpolicy-newreject b/tests/tests/debpolicy-newreject
index e64ed6e..c1192d1 100755
--- a/tests/tests/debpolicy-newreject
+++ b/tests/tests/debpolicy-newreject
@@ -8,17 +8,7 @@ t-debpolicy
t-prep-newpackage example 1.0
cd $p
-
revision=1
-t-commit () {
- local msg=$1
- v=1.$revision
- dch -v$v --distribution unstable "$1"
- git add debian/changelog
- debcommit
- revision=$(( $revision + 1 ))
-}
-
git tag start
echo FORBIDDEN >debian/some-file