chiark / gitweb /
Test suite: start work on test of policy machinery
[dgit.git] / tests / lib
index 7a5ede52f9f96178d17f513454448ecd4a331482..cb5c6498830382a296788d627702a4925cd5ff7b 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -7,6 +7,7 @@ if [ "x$DGIT_TEST_INTREE" != x ]; then
        : ${DGIT_TEST:=$DGIT_TEST_INTREE/dgit}
        : ${DGIT_REPOS_SERVER_TEST:=$DGIT_TEST_INTREE/infra/dgit-repos-server}
        : ${DGIT_SSH_DISPATCH_TEST:=$DGIT_TEST_INTREE/infra/dgit-ssh-dispatch}
+       : ${DGIT_INFRA_PFX:=$DGIT_TEST_INTREE${DGIT_TEST_INTREE:+/infra/}}
        export DGIT_TEST DGIT_REPOS_SERVER_TEST DGIT_SSH_DISPATCH_TEST
 fi
 
@@ -353,6 +354,20 @@ t-dsd () {
        echo 'no-such-package* drs' >$dsd_dispatch/diverts
 }
 
+t-policy-admin () {
+       ${DGIT_INFRA_PFX}dgit-repos-admin-debian --repos $tmp/git "$@"
+}
+
+t-debpolicy () {
+       t-dsd
+
+       ln -sf ${DGIT_INFRA_PFX}dgit-repos-policy-debian \
+               $dsd_dispatch/policy-hook
+
+       mkdir $tmp/git
+       t-policy-admin create-db
+}
+
 t-chain-test () {
        local ct=$1
        local d=${0%/*}