Index: tests/creddy_prover_tests/acme_rockets_intersection_rt0/README
===================================================================
--- tests/creddy_prover_tests/acme_rockets_intersection_rt0/README	(revision ec550f769c681cfa831dc724f82ddacd21fc75cd)
+++ tests/creddy_prover_tests/acme_rockets_intersection_rt0/README	(revision 3c30b595cd3f27758e8966a9935589bdb92486d5)
@@ -34,13 +34,15 @@
 rm -rf *.xml *.pem
 
-creddy --generate --cn Acme
+. ${TESTDIR}/test_util.sh
 
-creddy --generate --cn WarnerBros
+$eloc/creddy --generate --cn Acme
 
-creddy --generate --cn Coyote
+$eloc/creddy --generate --cn WarnerBros
 
-creddy --generate --cn Batman
+$eloc/creddy --generate --cn Coyote
 
-creddy --attribute \
+$eloc/creddy --generate --cn Batman
+
+$eloc/creddy --attribute \
        --issuer Acme_ID.pem --key Acme_private.pem --role buy_rockets \
        --subject-cert Acme_ID.pem --subject-role preferred_customer \
@@ -48,15 +50,15 @@
        --out Acme_buy_rockets__Acme_preferred_customer_and_WarnerBros_character_attr.xml
 
-creddy --attribute \
+$eloc/creddy --attribute \
        --issuer Acme_ID.pem --key Acme_private.pem --role preferred_customer \
        --subject-cert Coyote_ID.pem \
        --out Acme_preferred_customer__Coyote_attr.xml
 
-creddy --attribute \
+$eloc/creddy --attribute \
        --issuer Acme_ID.pem --key Acme_private.pem --role preferred_customer \
        --subject-cert Batman_ID.pem \
        --out Acme_preferred_customer__Batman_attr.xml
 
-creddy --attribute \
+$eloc/creddy --attribute \
        --issuer WarnerBros_ID.pem --key WarnerBros_private.pem --role character \
        --subject-cert Coyote_ID.pem \
Index: tests/creddy_prover_tests/acme_rockets_intersection_rt0/run_query
===================================================================
--- tests/creddy_prover_tests/acme_rockets_intersection_rt0/run_query	(revision ec550f769c681cfa831dc724f82ddacd21fc75cd)
+++ tests/creddy_prover_tests/acme_rockets_intersection_rt0/run_query	(revision 3c30b595cd3f27758e8966a9935589bdb92486d5)
@@ -1,17 +1,10 @@
 #!/bin/sh
-# acme_rockets_intersection
 
-pwd=`pwd`
+. ${TESTDIR}/test_util.sh
+keyloc=`pwd`
 
-eloc=`which abac_prover | sed 's/\/abac_prover//'`
-if [ "$eloc" = "" ]; then
-  echo "ERROR: abac_prover is not in the search path!!!"
-  exit 1
-fi
-keyloc=$pwd
-
-acme=`creddy --keyid --cert $keyloc/Acme_ID.pem`
-batman=`creddy --keyid --cert $keyloc/Batman_ID.pem`
-coyote=`creddy --keyid --cert $keyloc/Coyote_ID.pem`
+acme=`$eloc/creddy --keyid --cert $keyloc/Acme_ID.pem`
+batman=`$eloc/creddy --keyid --cert $keyloc/Batman_ID.pem`
+coyote=`$eloc/creddy --keyid --cert $keyloc/Coyote_ID.pem`
 
 buy_rockets="$acme.buy_rockets"
@@ -21,23 +14,26 @@
 bad_buy_rockets2="99$acme.buy_rockets"
 
-echo "  "
 echo "===good============ Acme.buy_rockets <- Coyote"
-$eloc/abac_prover  --keystore $keyloc \
-              --role "$buy_rockets" --principal "$coyote_prin"
+runTest creddy_prover_test/acme_rockets_intersection_rt0 test1 \
+  "$ploc/abac_prover --keystore $keyloc --role $buy_rockets --principal $coyote_prin" \
+  0 \
+  "simple rt0 query"
 
-echo "  "
 echo "===bad============ Acme.bad_buy_rockets <- Coyote"
-$eloc/abac_prover  --keystore $keyloc \
-              --role "$bad_buy_rockets" --principal "$coyote_prin"
+runTest creddy_prover_test/acme_rockets_intersection_rt0 test2 \
+  "$ploc/abac_prover  --keystore $keyloc --role $bad_buy_rockets --principal $coyote_prin" \
+  1 \
+  "expected failure, query fail with unfound role but should return with partial proof"
 
-echo "  "
 echo "===bad============ 99Acme.buy_rockets <- Coyote"
-$eloc/abac_prover  --keystore $keyloc \
-              --role "$bad_buy_rockets2" --principal "$coyote_prin"
+runTest creddy_prover_test/acme_rockets_intersection_rt0 test3 \
+  "$ploc/abac_prover  --keystore $keyloc --role $bad_buy_rockets2 --principal $coyote_prin" \
+  1 \
+  "expected failure, query fail with none existing issuer principal"
 
-echo "  "
 echo "===bad=============== Acme.buy_rockets <- Batman"
-$eloc/abac_prover  --keystore $keyloc \
-              --role "$buy_rockets" --principal "$batman_prin"
+runTest creddy_prover_test/acme_rockets_intersection_rt0 test4 \
+  "$ploc/abac_prover  --keystore $keyloc --role $buy_rockets --principal $batman_prin" \
+  1 \
+  "expected failure, query fail with none existing target principal"
 
-
