chiark / gitweb /
Test suite: Make t-policy more robust, and work in installed-package mode
[dgit.git] / tests / lib
index ef2437b..30fce38 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -518,8 +518,12 @@ t-policy-admin () {
 
 t-policy () {
        local policyhook=$1
-       ln -sf ${DGIT_INFRA_PFX}$policyhook \
-               $drs_dispatch/policy-hook
+       policyhook=${DGIT_INFRA_PFX}$policyhook
+       case $policyhook in
+       */*)    ;;
+       *)      policyhook=`type -P $policyhook` ;;
+       esac
+       ln -sf "$policyhook" $drs_dispatch/policy-hook
 }
 
 t-debpolicy () {