Index: tests/attr_tests/IceCream_attr.xml_save
===================================================================
--- tests/attr_tests/IceCream_attr.xml_save	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
+++ tests/attr_tests/IceCream_attr.xml_save	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<signed-credential>
+    <credential xml:id="ref0">
+	<type>abac</type>
+	<serial/>
+	<owner_gid/>
+	<target_gid/>
+	<uuid/>
+	<expires>2023-08-06T22:44:31Z</expires>
+	<abac>
+	    <rt0>
+		<version>1.1</version>
+		<head>
+   <ABACprincipal><keyid>5a151e1744670b010bfb468105e1dae4f21d9ae6</keyid></ABACprincipal>
+   <role>delicious</role>
+</head>
+<tail>
+   <ABACprincipal><keyid>0d103a09f360b9d59ba7fb0e747cc7da7afcfaa3</keyid></ABACprincipal>
+</tail>
+
+	    </rt0>
+	</abac>
+    </credential>
+    <signatures>
+	<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
+	    <SignedInfo>
+		<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
+		<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
+		<Reference URI="#ref0">
+		    <Transforms>
+			<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
+		    </Transforms>
+		    <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+		    <DigestValue>oO4CVI6RUj4yf9xnFR4HzOv1HPU=</DigestValue>
+		</Reference>
+	    </SignedInfo>
+	    <SignatureValue>rXQtxrGBBs2J7rJX3ovPKMzg5gE+dW00rx3pHxWwnUnZ+fBs2HmUXSCnX9jAH+6N
+omG6QtdV65cd+PNGFRihLUWIcuY/clFxfYJH3xa8tM02B/tNyBR6A+PxlD7LFNxV
+V8ryf8bQlhA95tOQdI70cVtbVHG9N0Jc6M6l5i0+WPbcxpC1IMqZO9diC43e88y/
+XBm7L3R9wFaHMmBywpa8BPb9ULVYebNRjY5S+zAATJup2SDmKSv5igErEdyAXBEt
+KBpZlIQ9AFJdPY2a2W/8WVy/T/WfWQqTH5DV3XxF/OVbyL3IvoW2yx+Cqfn1zjs8
+P2HKQdApPR5Zc6nXqtbSlA==</SignatureValue>
+	    <KeyInfo>
+	      <KeyValue>
+<RSAKeyValue>
+<Modulus>
+tOB2NTMT2HFxopbjPooHlbLrTrVxwICHM5ubx/cuYG/e8yzkBtA+zVQoqDug3jlN
+I8WlcVOgpDH4Th799zp1x3qVtlhuhswndgf04d8QIZOw0GBlLvUwhWuao0OCJXIg
+HmpsyxZJyvKfgkW+Pj13loc6f6ExNhmwWmXvUfOxoezoOFQb5gax6F0s4FDtyCuB
+dH0fGzGdXqEnNWyuM605Vt7WSzHwAkOZKkZdiK4UTBwgMHUUxWRTitoIUbIWEyqK
+DX7ag9L/MGQ11Kr60IoFXPXiglq0kgyyIt1nr+IH1SxR2RXf54bcAwgywz0bC+Wq
+Awj6ApvofPPkKuEhZiou2Q==
+</Modulus>
+<Exponent>
+AQAB
+</Exponent>
+</RSAKeyValue>
+</KeyValue>
+		<X509Data>
+		    
+		    
+		    
+		<X509Certificate>MIIDDDCCAfSgAwIBAgIJAO71IwftHrj6MA0GCSqGSIb3DQEBBQUAMBMxETAPBgNV
+BAMTCEljZUNyZWFtMB4XDTEzMDgwODIyNDQzMFoXDTE2MDcyMzIyNDQzMFowEzER
+MA8GA1UEAxMISWNlQ3JlYW0wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
+AQC04HY1MxPYcXGiluM+igeVsutOtXHAgIczm5vH9y5gb97zLOQG0D7NVCioO6De
+OU0jxaVxU6CkMfhOHv33OnXHepW2WG6GzCd2B/Th3xAhk7DQYGUu9TCFa5qjQ4Il
+ciAeamzLFknK8p+CRb4+PXeWhzp/oTE2GbBaZe9R87Gh7Og4VBvmBrHoXSzgUO3I
+K4F0fR8bMZ1eoSc1bK4zrTlW3tZLMfACQ5kqRl2IrhRMHCAwdRTFZFOK2ghRshYT
+KooNftqD0v8wZDXUqvrQigVc9eKCWrSSDLIi3Wev4gfVLFHZFd/nhtwDCDLDPRsL
+5aoDCPoCm+h88+Qq4SFmKi7ZAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wDgYD
+VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRaFR4XRGcLAQv7RoEF4drk8h2a5jAfBgNV
+HSMEGDAWgBRaFR4XRGcLAQv7RoEF4drk8h2a5jANBgkqhkiG9w0BAQUFAAOCAQEA
+U6YUSG1c4p0F6Za/P1U3px7+P3zu+RspaHK91tlLo1i3KVSC1mHhB90lvj4B8dM/
+Lo/kspcVt10t07WXL1Px0fW1LOguz2aI1+3xKGPkhjql01V0hAhaCS2GFpWkGfc+
+7uuxHyxzzoNtcrVYbD4ByDrz/eXn7sRj/WAMZKX8hQ2LiTPgXJ16AR3iPS9ocpPS
+FnR8zqWzd/V825Q4nmi/5iVegdhYAKrNrISA+N33pCsMSYfqBauEEUPfXYNHvsWA
+gueLDZ8/ONhaUKElAHlU3dI/hA01uS23TitFhhHO/lSOfRbmCxgatjVGWRt53DP6
+0FhgqjQ+8oTJ73taTaSz3A==</X509Certificate>
+<X509SubjectName>CN=IceCream</X509SubjectName>
+<X509IssuerSerial>
+<X509IssuerName>CN=IceCream</X509IssuerName>
+<X509SerialNumber>17218707267270916346</X509SerialNumber>
+</X509IssuerSerial>
+</X509Data>
+	    </KeyInfo>
+	</Signature>
+    </signatures>
+</signed-credential>
Index: tests/attr_tests/setup.sh
===================================================================
--- tests/attr_tests/setup.sh	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/attr_tests/setup.sh	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,3 +1,3 @@
-#!/bin/sh
+#!/usr/bin/env sh
 
 cp abac_attr.xml_save abac_attr.xml
Index: tests/attr_tests/show.sh
===================================================================
--- tests/attr_tests/show.sh	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/attr_tests/show.sh	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,5 +1,8 @@
-#!/bin/sh
+#!/usr/bin/env sh
 #show.sh
 
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=../../../..
+fi
 . ${TESTDIR}/test_util.sh
 
Index: tests/creddy_prover_tests/acme_rockets_intersection_rt0/README
===================================================================
--- tests/creddy_prover_tests/acme_rockets_intersection_rt0/README	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/creddy_prover_tests/acme_rockets_intersection_rt0/README	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,3 +1,3 @@
-#!/bin/sh
+#!/usr/bin/env sh
 #
 # This example demonstrates intersections.  An intersection is a logical and of
@@ -34,4 +34,7 @@
 rm -rf *.xml *.pem
 
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=../..
+fi
 . ${TESTDIR}/test_util.sh
 
Index: tests/creddy_prover_tests/acme_rockets_intersection_rt0/run_query
===================================================================
--- tests/creddy_prover_tests/acme_rockets_intersection_rt0/run_query	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/creddy_prover_tests/acme_rockets_intersection_rt0/run_query	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,5 +1,9 @@
-#!/bin/sh
+#!/usr/bin/env sh
 
 . ${TESTDIR}/test_util.sh
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=../..
+fi
+
 keyloc=`pwd`
 
Index: tests/creddy_prover_tests/acme_rockets_rt0/README
===================================================================
--- tests/creddy_prover_tests/acme_rockets_rt0/README	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/creddy_prover_tests/acme_rockets_rt0/README	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,3 +1,3 @@
-#!/bin/sh
+#!/usr/bin/env sh
 #
 # The example makes use of 2 principals, Acme and Coyote.
@@ -21,4 +21,7 @@
 rm -rf *.pem *.xml
 . ${TESTDIR}/test_util.sh
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=../..
+fi
 
 $eloc/creddy --generate --cn Acme
Index: tests/creddy_prover_tests/acme_rockets_rt0/run_query
===================================================================
--- tests/creddy_prover_tests/acme_rockets_rt0/run_query	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/creddy_prover_tests/acme_rockets_rt0/run_query	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,5 +1,9 @@
-#!/bin/sh
+#!/usr/bin/env sh
 
 . ${TESTDIR}/test_util.sh
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=../..
+fi
+
 keyloc=`pwd`
 
Index: tests/creddy_prover_tests/experiment_create_rt0/README
===================================================================
--- tests/creddy_prover_tests/experiment_create_rt0/README	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/creddy_prover_tests/experiment_create_rt0/README	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,3 +1,3 @@
-#!/bin/sh
+#!/usr/bin/env sh
 #
 #
@@ -29,4 +29,7 @@
 
 . ${TESTDIR}/test_util.sh
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=../..
+fi
 
 $eloc/creddy --generate --cn Acme
Index: tests/creddy_prover_tests/experiment_create_rt0/run_query
===================================================================
--- tests/creddy_prover_tests/experiment_create_rt0/run_query	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/creddy_prover_tests/experiment_create_rt0/run_query	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,4 +1,7 @@
-#!/bin/sh
+#!/usr/bin/env sh
 
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=../..
+fi
 . ${TESTDIR}/test_util.sh
 keyloc=`pwd`
@@ -13,4 +16,6 @@
 bob_prin="$bob"
 experiment_create="$acme.experiment_create"
+
+#`$ploc/abac_prover  --keystore $keyloc --dump dump.file`
 
 echo "===good=============== Globotron.admin <- Alice"
Index: tests/creddy_prover_tests/ice_cream_rt0/README
===================================================================
--- tests/creddy_prover_tests/ice_cream_rt0/README	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/creddy_prover_tests/ice_cream_rt0/README	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,3 +1,3 @@
-#!/bin/sh
+#!/usr/bin/env sh
 #
 # This simple example makes use of 2 principals, IceCream and Chocolate.
@@ -16,4 +16,7 @@
 
 . ${TESTDIR}/test_util.sh
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=../..
+fi
 
 $eloc/creddy --generate --cn IceCream
Index: tests/creddy_prover_tests/ice_cream_rt0/run_query
===================================================================
--- tests/creddy_prover_tests/ice_cream_rt0/run_query	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/creddy_prover_tests/ice_cream_rt0/run_query	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,5 +1,8 @@
-#!/bin/sh
+#!/usr/bin/env sh
 
 . ${TESTDIR}/test_util.sh
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=../..
+fi
 keyloc=`pwd`
 
Index: tests/creddy_tests/attribute.sh
===================================================================
--- tests/creddy_tests/attribute.sh	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/creddy_tests/attribute.sh	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,5 +1,8 @@
-#!/bin/sh
+#!/usr/bin/env sh
 #attribute.sh
 
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=..
+fi
 . ${TESTDIR}/test_util.sh
 
Index: tests/creddy_tests/attribute_rule.sh
===================================================================
--- tests/creddy_tests/attribute_rule.sh	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/creddy_tests/attribute_rule.sh	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,5 +1,8 @@
-#!/bin/sh
+#!/usr/bin/env sh
 #attribute_rule.sh
 
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=..
+fi
 . ${TESTDIR}/test_util.sh
 
Index: tests/creddy_tests/display.sh
===================================================================
--- tests/creddy_tests/display.sh	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/creddy_tests/display.sh	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,5 +1,8 @@
-#!/bin/sh
+#!/usr/bin/env sh
 #display.sh
 
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=..
+fi
 . ${TESTDIR}/test_util.sh
 
Index: tests/creddy_tests/generate.sh
===================================================================
--- tests/creddy_tests/generate.sh	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/creddy_tests/generate.sh	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,5 +1,8 @@
-#!/bin/sh
+#!/usr/bin/env sh
 #generate.sh
 
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=..
+fi
 . ${TESTDIR}/test_util.sh
 
Index: tests/creddy_tests/keyid.sh
===================================================================
--- tests/creddy_tests/keyid.sh	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/creddy_tests/keyid.sh	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,5 +1,8 @@
-#!/bin/sh
+#!/usr/bin/env sh
 # keyid.sh
 
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=..
+fi
 . ${TESTDIR}/test_util.sh
 
Index: tests/creddy_tests/roles.sh
===================================================================
--- tests/creddy_tests/roles.sh	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/creddy_tests/roles.sh	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,5 +1,8 @@
-#!/bin/sh
+#!/usr/bin/env sh
 #roles.sh
 
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=..
+fi
 . ${TESTDIR}/test_util.sh
 
Index: tests/creddy_tests/setup.sh
===================================================================
--- tests/creddy_tests/setup.sh	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/creddy_tests/setup.sh	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,7 +1,10 @@
-#!/bin/sh
+#!/usr/bin/env sh
 
 #Acme.buy_rockets <- Acme.preferred_customer
 #Acme.preferred_customer <- Coyote
 
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=..
+fi
 . ${TESTDIR}/test_util.sh
 
Index: tests/creddy_tests/verify.sh
===================================================================
--- tests/creddy_tests/verify.sh	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/creddy_tests/verify.sh	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,6 +1,9 @@
-#!/bin/sh
+#!/usr/bin/env sh
 #creddy --verify --cert <issuer> [ --attrcert <cert> ]
 #verify.sh
 
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=..
+fi
 . ${TESTDIR}/test_util.sh
 
Index: tests/example_scripts/c/run_prover
===================================================================
--- tests/example_scripts/c/run_prover	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/example_scripts/c/run_prover	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,4 +1,7 @@
-#!/bin/sh
+#!/usr/bin/env sh
 
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=../..
+fi
 . ${TESTDIR}/test_util.sh
 
Index: tests/example_scripts/c/setup.sh
===================================================================
--- tests/example_scripts/c/setup.sh	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/example_scripts/c/setup.sh	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,5 +1,8 @@
-#!/bin/sh
+#!/usr/bin/env sh
 # setup.sh
 
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=../..
+fi
 . ${TESTDIR}/test_util.sh
 
Index: tests/example_scripts/perl/run_attr
===================================================================
--- tests/example_scripts/perl/run_attr	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/example_scripts/perl/run_attr	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,3 +1,3 @@
-#!/bin/sh
+#!/usr/bin/env sh
 
 ./abac_attr.pl --id IceCream_ID.pem --key IceCream_private.pem --id2 Chocolate_ID.pem --attr delicious_attr.xml
Index: tests/example_scripts/perl/run_prover
===================================================================
--- tests/example_scripts/perl/run_prover	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/example_scripts/perl/run_prover	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,4 +1,7 @@
-#!/bin/sh
+#!/usr/bin/env sh
 
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=../..
+fi
 . ${TESTDIR}/test_util.sh
 
Index: tests/example_scripts/perl/setup.sh
===================================================================
--- tests/example_scripts/perl/setup.sh	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/example_scripts/perl/setup.sh	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,5 +1,8 @@
-#!/bin/sh
+#!/usr/bin/env sh
 # setup.sh
 
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=../..
+fi
 . ${TESTDIR}/test_util.sh
 
Index: tests/example_scripts/python/run_e_prover
===================================================================
--- tests/example_scripts/python/run_e_prover	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/example_scripts/python/run_e_prover	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,4 +1,7 @@
-#!/bin/sh
+#!/usr/bin/env sh
 
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=../..
+fi
 . ${TESTDIR}/test_util.sh
 
Index: tests/example_scripts/python/run_prover
===================================================================
--- tests/example_scripts/python/run_prover	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/example_scripts/python/run_prover	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,4 +1,7 @@
-#!/bin/sh
+#!/usr/bin/env sh
 
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=../..
+fi
 . ${TESTDIR}/test_util.sh
 
Index: tests/example_scripts/python/setup.sh
===================================================================
--- tests/example_scripts/python/setup.sh	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/example_scripts/python/setup.sh	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,5 +1,8 @@
-#!/bin/sh
+#!/usr/bin/env sh
 # setup.sh
 
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=..
+fi
 . ${TESTDIR}/test_util.sh
 
Index: tests/example_scripts/wiki/newguy.sh
===================================================================
--- tests/example_scripts/wiki/newguy.sh	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/example_scripts/wiki/newguy.sh	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,5 +1,8 @@
-#!/bin/sh
+#!/usr/bin/env sh
 # newguy.sh
 
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=../..
+fi
 . ${TESTDIR}/test_util.sh
 
Index: tests/python_tests/experiment_create_rt0/README
===================================================================
--- tests/python_tests/experiment_create_rt0/README	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/python_tests/experiment_create_rt0/README	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -11,4 +11,8 @@
 #    Globotron.experiment_create <- Globotron.admin.power_user
 #
+#and, Globotron is a partner of Acme
+#
+#    Acme.partner <- Globotron
+#
 #Alice is an admin, and her friend Bob is a power user:
 #
@@ -21,5 +25,5 @@
 #In query.py, it checks if Alice is a admin of Globotron which is true;
 #and if Bob is an admin of Globotron which is not true; and also show
-# that Bob can create experiment at Acme
+#that Bob can create experiment at Acme
 #
 # experiment_create_rt0 
Index: tests/scaling_tests/Makefile.am
===================================================================
--- tests/scaling_tests/Makefile.am	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/scaling_tests/Makefile.am	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -5,8 +5,6 @@
 EXPECTED_OKAY=3
 
-DIRECTORY=daisychain
-#haystack
-PLOT= daisychain/likes_python
-#haystack/fruit_python 
+DIRECTORY=daisychain haystack
+#PLOT= daisychain/likes_python haystack/ralphs_python
 
 SUBDIRS=$(DIRECTORY)
Index: tests/scaling_tests/README
===================================================================
--- tests/scaling_tests/README	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/scaling_tests/README	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,5 +1,5 @@
 
    To demostrate scalability of libabac and to get a rough 
-performance data, 2 types of scaling test are designed.
+performance data, 2 types of scaling tests are designed.
 
    haytack is the noise injection test 
Index: tests/scaling_tests/daisychain/likes_python/base/PROVE.sh
===================================================================
--- tests/scaling_tests/daisychain/likes_python/base/PROVE.sh	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/scaling_tests/daisychain/likes_python/base/PROVE.sh	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,4 +1,7 @@
-#!/bin/sh
+#!/usr/bin/env sh
 
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=../../../..
+fi
 . $(TESTDIR)/test_util.sh
 
Index: tests/scaling_tests/daisychain/likes_python/base/README
===================================================================
--- tests/scaling_tests/daisychain/likes_python/base/README	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/scaling_tests/daisychain/likes_python/base/README	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,3 +1,2 @@
-#!/bin/sh
 #
 #  This demonstrates scalability of libabac.
Index: tests/scaling_tests/daisychain/likes_python/run_one
===================================================================
--- tests/scaling_tests/daisychain/likes_python/run_one	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/scaling_tests/daisychain/likes_python/run_one	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,3 +1,3 @@
-#!/bin/sh 
+#!/usr/bin/env sh
 
 noise=$1
Index: tests/scaling_tests/haystack/Makefile
===================================================================
--- tests/scaling_tests/haystack/Makefile	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ 	(revision )
@@ -1,22 +1,0 @@
-
-
-DIRECTORY=fruit_prover fruit_python
-
-.PHONY : runcheck clean
-
-clean:
-	@for i in $(DIRECTORY); do \
-	export here=`pwd`;\
-	cd $$i; \
-	make clean; \
-	cd $$here; \
-	done;
-
-runcheck: 
-	@for i in $(DIRECTORY); do \
-	export here=`pwd`;\
-	printf " ...running on %s\n" "$$i" ; \
-	cd $$i; \
-	make test; \
-	cd $$here; \
-	done;  
Index: tests/scaling_tests/haystack/Makefile.am
===================================================================
--- tests/scaling_tests/haystack/Makefile.am	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
+++ tests/scaling_tests/haystack/Makefile.am	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -0,0 +1,25 @@
+#
+# haystack
+#
+
+DIRECTORY=ralphs_prover
+SUBDIRS=$(DIRECTORY)
+
+.PHONY : runcheck clean
+all: runcheck
+
+clean:
+	@for i in $(DIRECTORY); do \
+	here=`pwd`; \
+	cd $$i; \
+	make clean; \
+	cd $$here;\
+	done;
+
+runcheck: 
+	@for i in $(DIRECTORY); do \
+	  here=`pwd`; \
+	  cd $$i; \
+	  make -s test; \
+	  cd $$here;\
+	done;
Index: tests/scaling_tests/haystack/README
===================================================================
--- tests/scaling_tests/haystack/README	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/scaling_tests/haystack/README	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,6 +1,6 @@
 
-   To demonstrate scalability of libabac, noise is introduced into the
-yap prolog db by adding extraneous attribute and principal credentials.
-Valid queries are made and the result is validated. 
+   To demonstrate scalability of libabac, noise is introduced by 
+adding extraneous attribute and principal credentials.  Valid queries
+are made and the result is validated. 
 
 
Index: tests/scaling_tests/haystack/ralphs_prover/Makefile.am
===================================================================
--- tests/scaling_tests/haystack/ralphs_prover/Makefile.am	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
+++ tests/scaling_tests/haystack/ralphs_prover/Makefile.am	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -0,0 +1,35 @@
+#
+# haystack/ralphs_prover
+#
+
+include  ${TESTDIR}/abac.mk
+
+TEST=ralphs_0 ralphs_10 ralphs_20
+TIMING=ralphs_30 ralphs_40 ralphs_50 ralphs_100 ralphs_150 ralphs_200
+
+.PHONY : test clean timing plot 
+all: test
+
+test: $(TEST)
+
+timing: $(TIMING)
+
+ralphs_0 :
+	$(MY_ENV) ./run_one 0
+ralphs_10 :
+	@$(MY_ENV) ./run_one 10
+ralphs_20 :
+	@$(MY_ENV) ./run_one 20
+
+clean:
+	@rm -rf ralphs_* run_plot plot timing dump.file
+
+$(TIMING):
+	@$(MY_ENV) ./run_one $(subst ralphs_,,$@)
+
+plot:
+	@make clean
+	cp ../../plotting/run_plot .
+	@make -s test
+	@make -s timing
+	@./run_plot ralphs
Index: tests/scaling_tests/haystack/ralphs_prover/Makefile.in
===================================================================
--- tests/scaling_tests/haystack/ralphs_prover/Makefile.in	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
+++ tests/scaling_tests/haystack/ralphs_prover/Makefile.in	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -0,0 +1,425 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+#
+# haystack/ralphs_prover
+#
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = tests/scaling_tests/haystack/ralphs_prover
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_openssl.m4 \
+	$(top_srcdir)/m4/ax_check_xml2.m4 \
+	$(top_srcdir)/m4/ax_check_xmlsec1.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OPENSSL_INCLUDES = @OPENSSL_INCLUDES@
+OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@
+OPENSSL_LIBS = @OPENSSL_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PKG_CONFIG = @PKG_CONFIG@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SITE_PERL = @SITE_PERL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+XML2_CONFIG = @XML2_CONFIG@
+XML2_INCLUDES = @XML2_INCLUDES@
+XML2_LDFLAGS = @XML2_LDFLAGS@
+XML2_LIBS = @XML2_LIBS@
+XMLSEC1_CONFIG = @XMLSEC1_CONFIG@
+XMLSEC1_INCLUDES = @XMLSEC1_INCLUDES@
+XMLSEC1_LDFLAGS = @XMLSEC1_LDFLAGS@
+XMLSEC1_LIBS = @XMLSEC1_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+TEST = ralphs_0 ralphs_10 ralphs_20
+TIMING = ralphs_30 ralphs_40 ralphs_50 ralphs_100 ralphs_150 ralphs_200
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/scaling_tests/haystack/ralphs_prover/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign tests/scaling_tests/haystack/ralphs_prover/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	distclean distclean-generic distclean-libtool distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
+
+
+include  ${TESTDIR}/abac.mk
+
+.PHONY : test clean timing plot 
+all: test
+
+test: $(TEST)
+
+timing: $(TIMING)
+
+ralphs_0 :
+	$(MY_ENV) ./run_one 0
+ralphs_10 :
+	@$(MY_ENV) ./run_one 10
+ralphs_20 :
+	@$(MY_ENV) ./run_one 20
+
+clean:
+	@rm -rf ralphs_* run_plot plot timing dump.file
+
+$(TIMING):
+	@$(MY_ENV) ./run_one $(subst ralphs_,,$@)
+
+plot:
+	@make clean
+	cp ../../plotting/run_plot .
+	@make -s test
+	@make -s timing
+	@./run_plot ralphs
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: tests/scaling_tests/haystack/ralphs_prover/base/QUERY
===================================================================
--- tests/scaling_tests/haystack/ralphs_prover/base/QUERY	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
+++ tests/scaling_tests/haystack/ralphs_prover/base/QUERY	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -0,0 +1,38 @@
+#!/usr/bin/env sh
+
+# number of credentials, 9 + 4 x #VAL#
+
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=../../../..
+fi
+. ${TESTDIR}/test_util.sh
+keyloc=`pwd`
+
+ralphs=`$eloc/creddy --keyid --cert $keyloc/Ralphs_ID.pem`
+apple=`$eloc/creddy --keyid --cert $keyloc/Apple_ID.pem`
+computer=`$eloc/creddy --keyid --cert $keyloc/Computer_ID.pem`
+Alice=`$eloc/creddy --keyid --cert $keyloc/Alice_ID.pem`
+
+
+# [keyid:ralphs].role:order <-?- [keyid:apple] (yes)
+# [keyid:ralphs].role:order <-?- [keyid:computer] (no)
+
+ralphs_order="$ralphs.order"
+apple_prin="$apple"
+computer_prin="$computer"
+
+`$ploc/abac_prover  --keystore $keyloc --dump dump.file`
+
+
+echo "===good=============== Ralphs.order <- Apple"
+runTest scaling_tests/haystack/ralphs_prover test1 \
+"$ploc/abac_prover  --keystore $keyloc --role $ralphs_order --principal $apple_prin" \
+0 \
+"simple good query"
+
+echo "===bad=============== Ralphs.order <- Computer"
+runTest scaling_tests/haystack/ralphs_prover test1 \
+"$ploc/abac_prover  --keystore $keyloc --role $ralphs_order --principal $computer_prin" \
+1 \
+"simple bad query"
+
Index: tests/scaling_tests/haystack/ralphs_prover/base/README
===================================================================
--- tests/scaling_tests/haystack/ralphs_prover/base/README	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
+++ tests/scaling_tests/haystack/ralphs_prover/base/README	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -0,0 +1,111 @@
+#!/usr/bin/env sh
+#
+#  This demonstrates scalability of libabac.
+#       10 principal/attribute credentials with couple 
+#          of linked roles attributes are added, 
+#       2 sets of #VAL# attribute credentials along 
+#           with #VAL# different principal ids are added.
+# number of credentials, 9 + 4 x #VAL#
+# 
+
+rm -rf *.pem *.xml
+if [ -z "${TESTDIR}" ] ; then
+    TESTDIR=../../../..
+fi
+. ${TESTDIR}/test_util.sh
+
+$eloc/creddy --generate --cn District
+$eloc/creddy --generate --cn Huntington
+$eloc/creddy --generate --cn Alice
+$eloc/creddy --generate --cn Ralphs
+
+$eloc/creddy --generate --cn Apple
+$eloc/creddy --generate --cn Orange
+$eloc/creddy --generate --cn Banana
+$eloc/creddy --generate --cn Computer
+
+# [keyid:District].role:buys 
+#               <- [keyid:District].role:employee.role:buys
+$eloc/creddy --attribute \
+       --issuer District_ID.pem --key District_private.pem --role "buys" \
+       --subject-cert District_ID.pem --subject-role employee.buys \
+       --out district_buys__district_employee_buys_attr.xml
+
+# [keyid:District].role:employee 
+#               <- [keyid:District].role:school.role:admin
+$eloc/creddy --attribute \
+       --issuer District_ID.pem --key District_private.pem --role "employee" \
+       --subject-cert District_ID.pem --subject-role school.admin \
+       --out district_employee__district_school_admin_attr.xml
+
+# [keyid:District].role:school <- [keyid:Huntington]
+$eloc/creddy --attribute \
+       --issuer District_ID.pem --key District_private.pem --role "school" \
+       --subject-cert Huntington_ID.pem \
+       --out district_school__huntington_attr.xml
+
+# [keyid:Huntington].role:admin <- [keyid:Alice]
+$eloc/creddy --attribute \
+       --issuer Huntington_ID.pem --key Huntington_private.pem --role "admin" \
+       --subject-cert Alice_ID.pem \
+       --out huntington_admin__alice_attr.xml
+
+# [keyid:Alice].role:buys <- [keyid:Apple]
+$eloc/creddy --attribute \
+       --issuer Alice_ID.pem --key Alice_private.pem --role "buys" \
+       --subject-cert Apple_ID.pem \
+       --out alice_buys__apple_attr.xml
+
+# [keyid:Alice].role:buys <- [keyid:Orange]
+$eloc/creddy --attribute \
+       --issuer Alice_ID.pem --key Alice_private.pem --role "buys" \
+       --subject-cert Orange_ID.pem \
+       --out alice_buys__orange_attr.xml
+
+# [keyid:Alice].role:buys <- [keyid:Banana]
+$eloc/creddy --attribute \
+       --issuer Alice_ID.pem --key Alice_private.pem --role "buys" \
+       --subject-cert Banana_ID.pem \
+       --out alice_buys__banana_attr.xml
+
+
+# [keyid:Ralphs].role:order 
+#               <- [keyid:Ralphs].role:eduPartner.role:buys
+$eloc/creddy --attribute \
+       --issuer Ralphs_ID.pem --key Ralphs_private.pem --role "order" \
+       --subject-cert Ralphs_ID.pem --subject-role "eduPartner.buys" \
+       --out ralphs_order__ralphs_eduPartner_buys_attr.xml
+
+# [keyid:Ralphs].role:eduPartner <- [keyid:District]
+$eloc/creddy --attribute \
+       --issuer Ralphs_ID.pem --key Ralphs_private.pem --role "eduPartner" \
+       --subject-cert District_ID.pem \
+       --out ralphs_eduPartner__district_attr.xml
+
+
+############### NOISE #######################################
+# [keyid:Ralphs].role:eduPartner  <- [keyid:DistrictX]
+for i in $(seq 1 #VAL#);
+do
+  district="District$i"
+  $eloc/creddy --generate --cn $district 
+  fstr="ralphs_eduPartner__${district}_attr.xml"
+  $eloc/creddy --attribute \
+        --issuer Ralphs_ID.pem --key Ralphs_private.pem \
+        --role "eduPartner" \
+        --subject-cert ${district}_ID.pem \
+        --out $fstr
+done
+
+# [keyid:Huntington].role:admin  <- [keyid:BobX]
+for i in $(seq 1 #VAL#);
+do
+  bob="Bob$i"
+  $eloc/creddy --generate --cn $bob 
+  fstr="huntington_admin__${bob}_attr.xml"
+  $eloc/creddy --attribute \
+        --issuer Huntington_ID.pem --key Huntington_private.pem \
+        --role "admin" \
+        --subject-cert ${bob}_ID.pem \
+        --out $fstr
+done
Index: tests/scaling_tests/haystack/ralphs_prover/run_one
===================================================================
--- tests/scaling_tests/haystack/ralphs_prover/run_one	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
+++ tests/scaling_tests/haystack/ralphs_prover/run_one	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -0,0 +1,39 @@
+#!/usr/bin/env sh
+noise=$1
+
+if [ -z "$noise" ]; then
+    exit
+fi 
+
+echo "---running haystack ralphs_prover $noise scaling"
+
+rm -rf ralphs_$noise
+mkdir ralphs_$noise
+
+sed "s/#VAL#/$noise/" base/README > ralphs_$noise/README
+sed "s/#VAL#/$noise/" base/QUERY > ralphs_$noise/run_query
+
+cd ralphs_$noise
+
+chmod +x README run_query
+./README 1>/dev/null 2>&1
+time env ABAC_CN=1 ./run_query 1>ralphs.tmp 2> ralphs.time
+
+
+s=`grep -c "success" ralphs.tmp 2>/dev/null`
+f=`grep -c "failure" likes.tmp 2>/dev/null `
+
+if [ $s -ne 2 ] ; then
+    echo "BAD:scaling_tests/haystack/ralphs_python:$noise:number of success is not right"
+    exit 1
+fi
+
+if [ $f -ne 0 ] ; then
+    echo "BAD:scaling_tests/haystack/ralphs_python:$noise:there are unexpeced failure"
+    exit 1
+fi
+
+echo "GOOD:scaling_tests/haystack/ralphs_python:$noise:expected result"
+
+
+
Index: tests/test_util.sh
===================================================================
--- tests/test_util.sh	(revision a1631e7bf8b8de6fde0e026cdc49f17ee653f579)
+++ tests/test_util.sh	(revision 2be12d2391af2d7b94cec2e58c6bbf24dc62c1c9)
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-debug=0
+debug=1
 
 # look for creddy,
@@ -47,5 +47,5 @@
         echo "GOOD:${FNAME}:${LABEL}:${MSG}"
     else
-        if [ $EXPECT ]; then
+        if [ $EXPECT -eq 1 ]; then
            echo "BAD:${FNAME}:${LABEL}:expected failure but got success,${MSG}"
         else
@@ -54,4 +54,6 @@
     fi
     if [ $debug -eq 1 ]; then
+	echo ${EXPECT}
+	echo ${TESTBODY}
         echo $rc
     fi
