Index: examples/creddy_prover_tests/alice_rt1/README
===================================================================
--- examples/creddy_prover_tests/alice_rt1/README	(revision 5f551d32ce8befe42bdd0b6cc9391e217749c595)
+++ examples/creddy_prover_tests/alice_rt1/README	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -23,5 +23,5 @@
 guestof_marchhare="guestOf([keyid:$marchhare_keyid])"
 
-about_party="about([keyid:$tea_keyid],[time:20101010T],[boolean:true],[integer:4],[float:-200.0],[float:8],[time:20120205T182930],[string:'guest list'],[urn:'file://usr/local/party/~teaparty'])"
+about_party="about([keyid:$tea_keyid],[time:20101010T],[boolean:true],[integer:4],[float:-200.0],[float:8],[time:20120205T182930],[string:'guest'],[urn:'file://usr/local/party/~teaparty'])"
 
 about_other_party="about_other_party([keyid:$tea_keyid],[?],[integer:99],[time:?AAA],[integer:?BBB],[boolean:true],[integer:?])"
Index: examples/python_tests/README
===================================================================
--- examples/python_tests/README	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
+++ examples/python_tests/README	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -0,0 +1,30 @@
+
+This directory contains various ABAC scenarios that exercise
+various feature of the current RT2 implmentation using YAP prolog.
+
+Both the setting up of the credential db and the front end query
+utilize the python interface to libabac library made possible
+through swig.
+
+Each subdirectory has a README script which contains a description
+of the scenario. The run_test script controls the sequence of script
+calls within the subdirectory. There is a setup.py that sets up the
+principals needed for the scenario and an attr.py that sets up the
+access attribute policy and the query.py that makes various query
+into to the db. All of these files can be combined into a single 
+script if preferred.
+
+runall, is the top level script that will wipe clean all by products
+of a validation run or initiate run_test in each subdirectory.
+
+runcheck, is the top level script that initiates a complete 
+validation run; captures the result and compares with the baseline 
+result stored in allout.save.  
+
+Typical commands to call:
+    
+    runall clean
+    runcheck
+
+
+
Index: examples/python_tests/access_rt2/README
===================================================================
--- examples/python_tests/access_rt2/README	(revision 5f551d32ce8befe42bdd0b6cc9391e217749c595)
+++ examples/python_tests/access_rt2/README	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -1,10 +1,41 @@
-#!/bin/sh
-
 #####################################################################
-# This directory contains examples that use libabac api call to
-# access and generate attribute policy rules using python
+# access_rt2
+# This example demonstrates using an oset (object set) to control access
+# to files based on the attributes of the principals.  The script creates
+# three principals Alpha, Bob and Joe and sets out the access policy.
+# 
+# files are named by URNs and are not principals.
+# 
+# A principal's access rights are controlled by the Alpha principal.  If a 
+# principal has the role role::aceess(string:'Read', urn:filename) that 
+# principal can Read filename.  
+# The policy names 2 teams, proj1 and proj1.  A principal is on proj1 if it
+# has the role team(string:'proj1') defined by Alpha (written
+# [keyid:Alpha}.role:team(string:'proj1')).  Each project has an associated set
+# of files, defined by object sets.  A file is in proj1's documents if it is in
+# the oset of documents('proj1') defined by Alpha, written
+# [keyid:Alpha].oset:documents(string:'proj1'))
+# 
+# The example below lays out the policy that members of a given project can
+# Read the documents of that project in Credential 1 and adds file://fileA to
+# the document set for proj1 in Credential 2 - note that no principal is
+# required for fileA.  Credentials 3 & 4 add Bob to proj1 and Joe to proj2.
 #
-# Two pre-existing id credentials are generated using separate python
-# script
-
-
+# The attached query.py file runs 3 queries.  First it confirms that Bob can Read
+# fileA, then it confirms that Joe cannot.  Finally it confirms that Joe is in
+# proj2.
+# Credential 1
+#[keyid:alpha].role:access([string:'Read'],
+#                    [urn:?F[keyid:alpha].oset:documents([string:?P])])
+#                                     <- [keyid:alpha].role:team([string:?P]) 
+# Credential 2
+#[keyid:alpha].oset:documents([string:'proj1'])<-[urn:'file//fileA'] 
+# Credential 3
+# [keyid:alpha].role:team([string:'proj1'])<-[keyid:Bob]
+# Credential 4
+# [keyid:alpha].role:team([string:'proj2'])<-[keyid:Joe]
+creddy --attribute \
+        --issuer Alpha_ID.pem --key Alpha_private.pem \
+        --role "team([string:'proj2'])" \
+        --subject-cert Joe_ID.pem \
+        --out Alpha_team_proj2__Joe_attr.der
Index: examples/python_tests/access_rt2/attr.py
===================================================================
--- examples/python_tests/access_rt2/attr.py	(revision 5f551d32ce8befe42bdd0b6cc9391e217749c595)
+++ examples/python_tests/access_rt2/attr.py	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -37,10 +37,8 @@
 joe=joeID.id_keyid()
 
-#ctxt.load_id_file("Alpha_ID.pem","Alpha_private.pem")
 alphaID=ABAC.ID("Alpha_ID.pem")
 alphaID.id_load_privkey_file("Alpha_private.pem");
 alpha=alphaID.id_keyid()
 
-#ctxt.load_id_file("Bob_ID.pem","Bob_private.pem")
 bobID=ABAC.ID("Bob_ID.pem")
 bobID.id_load_privkey_file("Bob_private.pem");
@@ -51,10 +49,10 @@
 param1=ABAC.DataTerm("string", "'Read'")
 param2=ABAC.DataTerm("urn","'file//fileB'")
-role = ABAC.Role(alpha,"access")
-role.role_add_data_term(param1)
-role.role_add_data_term(param2)
-p = ABAC.Role(bob)
-attr=ABAC.Attribute(role, 1800)
-attr.attribute_add_tail(p)
+head = ABAC.Role(alpha,"access")
+head.role_add_data_term(param1)
+head.role_add_data_term(param2)
+tail = ABAC.Role(bob)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
 attr.attribute_bake()
 attr.attribute_write_cert("Alpha_access_fileB__Bob_attr.der")
@@ -67,8 +65,8 @@
 ## [keyid:alpha].role:team([string:'proj1'])<-[keyid:bob]
 param1=ABAC.DataTerm("string", "'proj1'")
-role = ABAC.Role(alpha,"team")
-role.role_add_data_term(param1)
+head = ABAC.Role(alpha,"team")
+head.role_add_data_term(param1)
 tail = ABAC.Role(bob)
-attr=ABAC.Attribute(role, 1800)
+attr=ABAC.Attribute(head, 1800)
 attr.attribute_add_tail(tail)
 attr.attribute_bake()
@@ -82,8 +80,8 @@
 ## [keyid:alpha].role:team([string:'proj2'])<-[keyid:Joe]
 param1=ABAC.DataTerm("string", "'proj2'")
-role = ABAC.Role(alpha,"team")
-role.role_add_data_term(param1)
+head = ABAC.Role(alpha,"team")
+head.role_add_data_term(param1)
 tail = ABAC.Role(joe)
-attr=ABAC.Attribute(role, 1800)
+attr=ABAC.Attribute(head, 1800)
 attr.attribute_add_tail(tail)
 attr.attribute_bake()
@@ -94,5 +92,4 @@
 print "\n"
 
-## bad beause of that constraint.. 
 ################################################
 # [keyid:alpha].role:access([string:'Read',
@@ -111,10 +108,8 @@
 tail = ABAC.Role(alpha,"team")
 tail.role_add_data_term(param3)
-
 attr=ABAC.Attribute(head, 1800)
 attr.attribute_add_tail(tail)
 attr.attribute_bake()
 attr.attribute_write_cert("Alpha_access_qFqP__alpha_team_qP_attr.der")
-#ctxt.load_attribute_file("Alpha_access_qFqP__alpha_team_qP_attr.der")
 ctxt.load_attribute(attr)
 #print attr.string() 
@@ -126,13 +121,12 @@
 ## [keyid:alpha].oset:documents([string:'proj1'])<-[urn:'file//fileA']
 param1=ABAC.DataTerm("string", "'proj1'")
-oset = ABAC.Oset(alpha,"documents")
-oset.oset_add_data_term(param1)
+head = ABAC.Oset(alpha,"documents")
+head.oset_add_data_term(param1)
 obj = ABAC.DataTerm("urn", "'file//fileA'")
 tail= ABAC.Oset(obj)
-attr=ABAC.Attribute(oset, 1800)
+attr=ABAC.Attribute(head, 1800)
 attr.attribute_add_tail(tail)
 attr.attribute_bake()
 attr.attribute_write_cert("Alpha_team_proj1__fileA_attr.der")
-#ctxt.load_attribute_file("Alpha_team_proj1__fileA_attr.der")
 ctxt.load_attribute(attr)
 print attr.string() 
Index: examples/python_tests/access_rt2/run_test
===================================================================
--- examples/python_tests/access_rt2/run_test	(revision 5f551d32ce8befe42bdd0b6cc9391e217749c595)
+++ examples/python_tests/access_rt2/run_test	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -9,5 +9,5 @@
 
 echo '---setup attributes'
-env keystore=`pwd` ./attr.py 1>/dev/null 2>& 1
+env keystore=`pwd` ./attr.py 1>access.log 2>& 1
 
 echo '---run queries'
Index: examples/python_tests/acme_friend_rt1/attr.py
===================================================================
--- examples/python_tests/acme_friend_rt1/attr.py	(revision 5f551d32ce8befe42bdd0b6cc9391e217749c595)
+++ examples/python_tests/acme_friend_rt1/attr.py	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -56,5 +56,6 @@
 attr.attribute_bake()
 attr.attribute_write_cert("Acme_preferred_customer__Acme_friendof_Roadrunner_attr.der")
-ctxt.load_attribute_file("Acme_preferred_customer__Acme_friendof_Roadrunner_attr.der")
+#ctxt.load_attribute_file("Acme_preferred_customer__Acme_friendof_Roadrunner_attr.der")
+ctxt.load_attribute(attr)
 print attr.string() 
 print attr.typed_string()
@@ -69,5 +70,6 @@
 attr.attribute_bake()
 attr.attribute_write_cert("Acme_preferred_customer__Coyote_attr.der")
-ctxt.load_attribute_file("Acme_preferred_customer__Coyote_attr.der")
+#ctxt.load_attribute_file("Acme_preferred_customer__Coyote_attr.der")
+ctxt.load_attribute(attr)
 print attr.string() 
 print attr.typed_string()
@@ -84,5 +86,6 @@
 attr.attribute_bake()
 attr.attribute_write_cert("Acme_friendof_Roadrunner__Jackrabbit_attr.der")
-ctxt.load_attribute_file("Acme_friendof_Roadrunner__Jackrabbit_attr.der")
+#ctxt.load_attribute_file("Acme_friendof_Roadrunner__Jackrabbit_attr.der")
+ctxt.load_attribute(attr)
 print attr.string() 
 print attr.typed_string()
Index: examples/python_tests/acme_friend_rt1/run_test
===================================================================
--- examples/python_tests/acme_friend_rt1/run_test	(revision 5f551d32ce8befe42bdd0b6cc9391e217749c595)
+++ examples/python_tests/acme_friend_rt1/run_test	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -8,5 +8,5 @@
 
 echo '---setup attributes'
-env keystore=`pwd` ./attr.py 1>/dev/null 2>& 1
+env keystore=`pwd` ./attr.py 1>friend.log 2>& 1
 
 echo '---run queries'
Index: examples/python_tests/acme_rockets_intersection_rt0/run_test
===================================================================
--- examples/python_tests/acme_rockets_intersection_rt0/run_test	(revision 5f551d32ce8befe42bdd0b6cc9391e217749c595)
+++ examples/python_tests/acme_rockets_intersection_rt0/run_test	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -8,5 +8,5 @@
 
 echo '---setup attributes'
-env keystore=`pwd` ./attr.py 1>/dev/null 2>& 1
+env keystore=`pwd` ./attr.py 1>intersect.log 2>& 1
 
 echo '---run queries'
Index: examples/python_tests/acme_rockets_rt0/run_test
===================================================================
--- examples/python_tests/acme_rockets_rt0/run_test	(revision 5f551d32ce8befe42bdd0b6cc9391e217749c595)
+++ examples/python_tests/acme_rockets_rt0/run_test	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -8,5 +8,5 @@
 
 echo '---setup attributes'
-env keystore=`pwd` ./attr.py 1>/dev/null 2>& 1
+env keystore=`pwd` ./attr.py 1>rocket.log 2>& 1
 
 echo '---run queries'
Index: examples/python_tests/alice_rt1/README
===================================================================
--- examples/python_tests/alice_rt1/README	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
+++ examples/python_tests/alice_rt1/README	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -0,0 +1,172 @@
+#!/bin/sh
+
+## trying out different data param types
+
+# alice_rt1_typed
+
+creddy --generate --cn Alice
+creddy --generate --cn Hatter
+creddy --generate --cn MarchHare
+creddy --generate --cn Dormouse
+creddy --generate --cn Tea
+creddy --generate --cn Party 
+
+alice_keyid=`creddy --keyid --cert Alice_ID.pem`
+party_keyid=`creddy --keyid --cert Party_ID.pem`
+tea_keyid=`creddy --keyid --cert Tea_ID.pem`
+hatter_keyid=`creddy --keyid --cert Hatter_ID.pem`
+marchhare_keyid=`creddy --keyid --cert MarchHare_ID.pem`
+dormouse_keyid=`creddy --keyid --cert Dormouse_ID.pem`
+
+friendof_alice="friendOf-alice([keyid:$alice_keyid])"
+friendof_marchhare="friendOf([keyid:$marchhare_keyid])"
+guestof_marchhare="guestOf([keyid:$marchhare_keyid])"
+
+about_party="about([keyid:$tea_keyid],[time:20101010T],[boolean:true],[integer:4],[float:-200.0],[float:8],[time:20120205T182930],[string:'guest list'],[urn:'file://usr/local/party/~teaparty'])"
+
+about_other_party="about_other_party([keyid:$tea_keyid],[?],[integer:99],[time:?AAA],[integer:?BBB],[boolean:true],[integer:?])"
+
+about_time="about_time([time:20201101T])"
+about_another_time="about_another_time([time:20201101T182930])"
+about_key="about_key([keyid:$tea_keyid])"
+about_boolean="about_boolean([boolean:true])"
+about_integer="about_integer([integer:4])"
+about_another_integer="about_another_integer([integer:-7])"
+about_float="about_float([float:-200.0])"
+about_another_float="about_another_float([float:8])"
+about_third_float="about_another_float([float:0.22])"
+about_urn="about_urn([urn:'file://user/local/party/~sillyparty'])"
+about_string="about_string([string:'a confused party'])"
+about_string2="about_string([string:'a mangled \'string\''])"
+
+
+#[keyid:Party].role:about([keyid:tea],[time:201010],[string:'guest list'],[boolean:true],[integer:4]) <- [keyid:Party].role:guestOf([keyid:MarchHare])
+#echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_party\" --subject-cert Party_ID.pem --subject-role  \"$guestof_marchhare\" --out party_about_party__guestof_marchhare_attr.der"
+creddy --attribute \
+       --issuer Party_ID.pem --key Party_private.pem --role "$about_party" \
+       --subject-cert Party_ID.pem --subject-role  "$guestof_marchhare" \
+       --out party_about_party__guestof_marchhare_attr.der
+#echo "  "
+#echo "double checking with creddy --roles -certs party_about_party__guestof_marchhare_attr.der"
+#creddy --roles --cert party_about_party__guestof_marchhare_attr.der
+
+#[keyid:Party].role:about_other_party([keyid:$tea_keyid],[time:?],[boolean:true]) <- [keyid:MarchHare]
+#echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_other_party\" --subject-cert MarchHare_ID.pem --out party_about_other_party__marchhare_attr.der"
+creddy --attribute \
+       --issuer Party_ID.pem --key Party_private.pem --role "$about_other_party" \
+       --subject-cert MarchHare_ID.pem \
+       --out party_about_other_party__marchhare_attr.der
+
+#[keyid:Party].role:about_string([string:'a confused party']) <- [keyid:MarchHare]
+#echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_string\" --subject-cert MarchHare_ID.pem --out party_about_string__marchhare_attr.der"
+creddy --attribute \
+       --issuer Party_ID.pem --key Party_private.pem --role "$about_string" \
+       --subject-cert MarchHare_ID.pem \
+       --out party_about_string__marchhare_attr.der
+
+#[keyid:Party].role:about_string2([string:'a mangled \'string\'']) <- [keyid:MarchHare]
+#echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_string2\" --subject-cert MarchHare_ID.pem --out party_about_string2__marchhare_attr.der"
+creddy --attribute \
+       --issuer Party_ID.pem --key Party_private.pem --role "$about_string2" \
+       --subject-cert MarchHare_ID.pem \
+       --out party_about_string2__marchhare_attr.der
+
+#[keyid:Party].role:about_urn([urn:'file://user/local/party/~sillyparty']) <- [keyid:MarchHare]
+#echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_urn\" --subject-cert MarchHare_ID.pem --out party_about_urn__marchhare_attr.der"
+creddy --attribute \
+       --issuer Party_ID.pem --key Party_private.pem --role "$about_urn" \
+       --subject-cert MarchHare_ID.pem \
+       --out party_about_urn__marchhare_attr.der
+
+#[keyid:Party].role:about_third_float([float:0.22]) <- [keyid:MarchHare]
+#echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_third_float\" --subject-cert MarchHare_ID.pem --out party_about_third_float__marchhare_attr.der"
+creddy --attribute \
+       --issuer Party_ID.pem --key Party_private.pem --role "$about_third_float" \
+       --subject-cert MarchHare_ID.pem \
+       --out party_about_third_float__marchhare_attr.der
+
+#[keyid:Party].role:about_another_float([float:8]) <- [keyid:MarchHare]
+#echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_another_float\" --subject-cert MarchHare_ID.pem --out party_about_another_float__marchhare_attr.der"
+creddy --attribute \
+       --issuer Party_ID.pem --key Party_private.pem --role "$about_another_float" \
+       --subject-cert MarchHare_ID.pem \
+       --out party_about_another_float__marchhare_attr.der
+
+#[keyid:Party].role:about_float([float:-200.0]) <- [keyid:MarchHare]
+#echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_float\" --subject-cert MarchHare_ID.pem --out party_about_float__marchhare_attr.der"
+creddy --attribute \
+       --issuer Party_ID.pem --key Party_private.pem --role "$about_float" \
+       --subject-cert MarchHare_ID.pem \
+       --out party_about_float__marchhare_attr.der
+
+#[keyid:Party].role:about_another_integer([integer:-7]) <- [keyid:MarchHare]
+#echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_another_integer\" --subject-cert MarchHare_ID.pem --out party_about_another_integer__marchhare_attr.der"
+creddy --attribute \
+       --issuer Party_ID.pem --key Party_private.pem --role "$about_another_integer" \
+       --subject-cert MarchHare_ID.pem \
+       --out party_about_another_nteger__marchhare_attr.der
+
+#[keyid:Party].role:about_integer([integer:4]) <- [keyid:MarchHare]
+#echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_integer\" --subject-cert MarchHare_ID.pem --out party_about_integer__marchhare_attr.der"
+creddy --attribute \
+       --issuer Party_ID.pem --key Party_private.pem --role "$about_integer" \
+       --subject-cert MarchHare_ID.pem \
+       --out party_about_integer__marchhare_attr.der
+
+#[keyid:Party].role:about_boolean([boolean:true]) <- [keyid:MarchHare]
+#echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_boolean\" --subject-cert MarchHare_ID.pem --out party_about_boolean__marchhare_attr.der"
+creddy --attribute \
+       --issuer Party_ID.pem --key Party_private.pem --role "$about_boolean" \
+       --subject-cert MarchHare_ID.pem \
+       --out party_about_boolean__marchhare_attr.der
+
+#[keyid:Party].role:about_key([keyid:$tea_keyid]) <- [keyid:MarchHare]
+#echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_key\" --subject-cert MarchHare_ID.pem --out party_about_key__marchhare_attr.der"
+creddy --attribute \
+       --issuer Party_ID.pem --key Party_private.pem --role "$about_key" \
+       --subject-cert MarchHare_ID.pem \
+       --out party_about_key__marchhare_attr.der
+
+#[keyid:Party].role:about_another_time([time:20201101T182930]) <- [keyid:MarchHare]
+#echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_another_time\" --subject-cert MarchHare_ID.pem --out party_about_another_time__marchhare_attr.der"
+creddy --attribute \
+       --issuer Party_ID.pem --key Party_private.pem --role "$about_another_time" \
+       --subject-cert MarchHare_ID.pem \
+       --out party_about_another_time__marchhare_attr.der
+
+#[keyid:Party].role:about_time([time:20201101T]) <- [keyid:MarchHare]
+#echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_time\" --subject-cert MarchHare_ID.pem --out party_about_time__marchhare_attr.der"
+creddy --attribute \
+       --issuer Party_ID.pem --key Party_private.pem --role "$about_time" \
+       --subject-cert MarchHare_ID.pem \
+       --out party_about_time__marchhare_attr.der
+
+#[keyid:Party].role:guestof([principal:?V]) <- [keyid:Party].role:friendOf([principal:?V])
+#echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role 'guestOf([principal:?V])' --subject-cert Party_ID.pem --subject-role 'friendOf([principal:?V])' --out party_guestof_qV__party_friendof_qV_attr.der"
+creddy --attribute \
+       --issuer Party_ID.pem --key Party_private.pem --role 'guestOf([principal:?V])' \
+       --subject-cert Party_ID.pem --subject-role  'friendOf([principal:?V])' \
+       --out party_guestof_qV__party_friendof_qV_attr.der
+
+#[keyid:Party].role:guests <- [keyid:Party].role:friendOf([keyid:MarchHare])
+#echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role guests --subject-cert Party_ID.pem --subject-role  \"$friendof_marchhare\" --out party_guests__party_friendof_marchhare_attr.der"
+creddy --attribute \
+       --issuer Party_ID.pem --key Party_private.pem --role guests \
+       --subject-cert Party_ID.pem --subject-role  "$friendof_marchhare" \
+       --out party_guests__party_friendof_marchhare_attr.der
+
+#[keyid:Party].role:friendOf([keyid:MarchHare]) <- [keyid:Dormouse]
+#echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$friendof_marchhare\" --subject-cert Dormouse_ID.pem --out party_friendof_marchhare__dormouse_attr.der"
+creddy --attribute \
+       --issuer Party_ID.pem --key Party_private.pem --role "$friendof_marchhare" \
+       --subject-cert Dormouse_ID.pem \
+       --out party_friendof_marchhare__dormouse_attr.der
+
+#[keyid:Party].role:friendOf([keyid:Alice]) <- [keyid:Hatter]
+#echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$friendof_alice\" --subject-cert Hatter_ID.pem --out party_friendof_alice__hatter_attr.der"
+creddy --attribute \
+       --issuer Party_ID.pem --key Party_private.pem --role "$friendof_alice" \
+       --subject-cert Hatter_ID.pem \
+       --out party_friendof_alice__hatter_attr.der
+
+
Index: examples/python_tests/alice_rt1/alice.save
===================================================================
--- examples/python_tests/alice_rt1/alice.save	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
+++ examples/python_tests/alice_rt1/alice.save	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -0,0 +1,41 @@
+% Restoring file /usr/local/lib/Yap/startup.yss
+
+===good============ Party.guests <- dourmouse
+YAP query succeed
+pParty.guests <- pParty.friendOf(pMarchhare)
+pParty.friendOf(pMarchhare) <- pDormouse
+
+===bad============ Party.guests <- hatter
+YAP query failed
+
+...final principal set...
+(pAlice,keyid,y) 
+(pDormouse,keyid,y) 
+(pHatter,keyid,y) 
+(pMarchhare,keyid,y) 
+(pParty,keyid,y) 
+(pTea,keyid,y) 
+
+
+
+...final policy attribute set...
+pParty.about_another_float(8) <- pMarchhare
+pParty.about_another_integer(-7) <- pMarchhare
+pParty.about_another_time(time(2020,11,01,18,29,30)) <- pMarchhare
+pParty.about_boolean(true) <- pMarchhare
+pParty.about_float(-200.0) <- pMarchhare
+pParty.about_integer(4) <- pMarchhare
+pParty.about_key(pTea) <- pMarchhare
+pParty.about_other_party(pTea,_,99,AAA,BBB,true,_) <- pMarchhare
+pParty.about(pTea,time(2010,10,10,00,00,00),true,4,-200.0,8,time(2012,02,05,18,29,30),'guest','file://usr/party/~teaparty') <- pParty.guestOf(pMarchhare)
+pParty.about_string2('a mangled \'string\'') <- pMarchhare
+pParty.about_string('a confused party') <- pMarchhare
+pParty.about_another_float(0.22) <- pMarchhare
+pParty.about_time(time(2020,11,01,00,00,00)) <- pMarchhare
+pParty.about_urn('file://user/local/party/~sillyparty') <- pMarchhare
+pParty.friendOf(pAlice) <- pHatter
+pParty.friendOf(pMarchhare) <- pDormouse
+pParty.guestOf(V) <- pParty.friendOf(V)
+pParty.guests <- pParty.friendOf(pMarchhare)
+
+
Index: examples/python_tests/alice_rt1/attr.py
===================================================================
--- examples/python_tests/alice_rt1/attr.py	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
+++ examples/python_tests/alice_rt1/attr.py	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -0,0 +1,389 @@
+#!/usr/bin/env python
+
+"""
+  Setup access policy attribute rules
+
+cmd1:env keystore=`pwd` ./attr.py 
+
+"""
+
+import os
+import ABAC
+
+keystore=os.environ["keystore"]
+
+ctxt = ABAC.Context()
+print "ABAC version %s" % ctxt.version()
+
+ctxt.load_directory(keystore)
+
+out = ctxt.context_principals()
+print "...initial principal set..."
+for x in out[1]:
+    print "%s " % x.string()
+print "\n" 
+
+out = ctxt.context_credentials()
+print "...initial policy attribute set..."
+for c in out[1]:
+    print "%s <- %s" % (c.head_string(), c.tail_string())
+print "\n"
+
+aliceID=ABAC.ID("Alice_ID.pem")
+aliceID.id_load_privkey_file("Alice_private.pem")
+alice=aliceID.id_keyid()
+
+partyID=ABAC.ID("Party_ID.pem")
+partyID.id_load_privkey_file("Party_private.pem")
+party=partyID.id_keyid()
+
+teaID=ABAC.ID("Tea_ID.pem")
+teaID.id_load_privkey_file("Tea_private.pem")
+tea=teaID.id_keyid()
+
+hatterID=ABAC.ID("Hatter_ID.pem")
+hatterID.id_load_privkey_file("Hatter_private.pem")
+hatter=hatterID.id_keyid()
+
+marchhareID=ABAC.ID("Marchhare_ID.pem")
+marchhareID.id_load_privkey_file("Marchhare_private.pem")
+marchhare=marchhareID.id_keyid()
+
+dormouseID=ABAC.ID("Dormouse_ID.pem")
+dormouseID.id_load_privkey_file("Dormouse_private.pem")
+dormouse=dormouseID.id_keyid()
+
+
+# can not have attribute string more than 382 characters or so
+# that would cause encoded attribute string more than 511 in length
+# and could not push/pull out of ietf_attribute_t properly
+###############################################
+# [keyid:Party].role: about([keyid:tea],[time:20101010T],[boolean:true],
+#                           [integer:4],[float:-200.0],[float:8],[time:20120205T182930],
+#                           [string:'guest'],[urn:'file://usr/party/~teaparty'])
+#                <- [keyid:Party].role:guestOf([keyid:MarchHare])
+head=ABAC.Role(party,"about")
+param=ABAC.DataTerm(teaID)
+head.role_add_data_term(param)
+param=ABAC.DataTerm("time","20101010T")
+head.role_add_data_term(param)
+param=ABAC.DataTerm("boolean","true")
+head.role_add_data_term(param)
+param=ABAC.DataTerm("integer","4")
+head.role_add_data_term(param)
+param=ABAC.DataTerm("float","-200.0")
+head.role_add_data_term(param)
+param=ABAC.DataTerm("float","8")
+head.role_add_data_term(param)
+param=ABAC.DataTerm("time","20120205T182930")
+head.role_add_data_term(param)
+param=ABAC.DataTerm("string","'guest'")
+head.role_add_data_term(param)
+param=ABAC.DataTerm("urn","'file://usr/party/~teaparty'")
+head.role_add_data_term(param)
+tail=ABAC.Role(party,"guestOf")
+param=ABAC.DataTerm(marchhareID)
+tail.role_add_data_term(param)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("party_about_party__guestof_marchhare_attr.der")
+ctxt.load_attribute_file("party_about_party__guestof_marchhare_attr.der")
+print attr.string() 
+print attr.typed_string()
+print "\n"
+
+###############################################
+# [keyid:Party].role:about_other_party([keyid:tea],[?],
+#                         [integer:99],[time:?AAA],[integer:?BBB],
+#                         [boolean:true],[integer:?])
+#                 <- [keyid:MarchHare]
+head=ABAC.Role(party,"about_other_party")
+param=ABAC.DataTerm(teaID)
+head.role_add_data_term(param)
+param=ABAC.DataTerm("anonymous","_")
+head.role_add_data_term(param)
+param=ABAC.DataTerm("integer","99")
+head.role_add_data_term(param)
+param=ABAC.DataTerm("time","AAA")
+head.role_add_data_term(param)
+param=ABAC.DataTerm("integer","BBB")
+head.role_add_data_term(param)
+param=ABAC.DataTerm("boolean","true")
+head.role_add_data_term(param)
+param=ABAC.DataTerm("integer","?")
+head.role_add_data_term(param)
+tail=ABAC.Role(marchhare)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("party_about_other_party__marchhare_attr.der")
+ctxt.load_attribute_file("party_about_other_party__marchhare_attr.der")
+print attr.string()
+print attr.typed_string()
+print "\n"
+
+###############################################
+# [keyid:Party].role:about_string([string:'a confused party'])
+#                 <- [keyid:MarchHare]
+head=ABAC.Role(party,"about_string")
+param=ABAC.DataTerm("string","'a confused party'")
+head.role_add_data_term(param)
+tail=ABAC.Role(marchhare)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("party_about_string__marchhare_attr.der")
+ctxt.load_attribute_file("party_about_string__marchhare_attr.der")
+print attr.string()
+print attr.typed_string()
+print "\n"
+
+###############################################
+# [keyid:Party].role:about_string2([string:'a mangled \\'string\\''])
+#                 <- [keyid:MarchHare]
+head=ABAC.Role(party,"about_string2")
+param=ABAC.DataTerm("string","'a mangled \\'string\\''")
+head.role_add_data_term(param)
+tail=ABAC.Role(marchhare)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("party_about_string2__marchhare_attr.der")
+ctxt.load_attribute_file("party_about_string2__marchhare_attr.der")
+print attr.string()
+print attr.typed_string()
+print "\n"
+
+###############################################
+# [keyid:Party].role:about_urn([urn:'file://user/local/party/~sillyparty'])
+#                 <- [keyid:MarchHare]
+head=ABAC.Role(party,"about_urn")
+param=ABAC.DataTerm("urn","'file://user/local/party/~sillyparty'")
+head.role_add_data_term(param)
+tail=ABAC.Role(marchhare)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("party_about_urn__marchhare_attr.der")
+ctxt.load_attribute_file("party_about_urn__marchhare_attr.der")
+print attr.string()
+print attr.typed_string()
+print "\n"
+
+###############################################
+# [keyid:Party].role:about_another_float([float:0.22])
+#                 <- [keyid:MarchHare]
+head=ABAC.Role(party,"about_another_float")
+param=ABAC.DataTerm("float","0.22")
+head.role_add_data_term(param)
+tail=ABAC.Role(marchhare)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("party_about_third_float__marchhare_attr.der")
+ctxt.load_attribute_file("party_about_third_float__marchhare_attr.der")
+print attr.string()
+print attr.typed_string()
+print "\n"
+
+###############################################
+# [keyid:Party].role:about_another_float([float:8])
+#                 <- [keyid:MarchHare]
+head=ABAC.Role(party,"about_another_float")
+param=ABAC.DataTerm("float","8")
+head.role_add_data_term(param)
+tail=ABAC.Role(marchhare)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("party_about_another_float__marchhare_attr.der")
+ctxt.load_attribute_file("party_about_another_float__marchhare_attr.der")
+print attr.string()
+print attr.typed_string()
+print "\n"
+
+###############################################
+# [keyid:Party].role:about_float([float:-200.0])
+#                 <- [keyid:MarchHare]
+head=ABAC.Role(party,"about_float")
+param=ABAC.DataTerm("float","-200.0")
+head.role_add_data_term(param)
+tail=ABAC.Role(marchhare)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("party_about_float__marchhare_attr.der")
+ctxt.load_attribute_file("party_about_float__marchhare_attr.der")
+print attr.string()
+print attr.typed_string()
+print "\n"
+
+###############################################
+# [keyid:Party].role:about_another_integer([integer:-7])
+#                 <- [keyid:MarchHare]
+head=ABAC.Role(party,"about_another_integer")
+param=ABAC.DataTerm("integer","-7")
+head.role_add_data_term(param)
+tail=ABAC.Role(marchhare)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("party_about_another_integer__marchhare_attr.der")
+ctxt.load_attribute_file("party_about_another_integer__marchhare_attr.der")
+print attr.string()
+print attr.typed_string()
+print "\n"
+
+###############################################
+# [keyid:Party].role:about_integer([integer:4])
+#                 <- [keyid:MarchHare]
+head=ABAC.Role(party,"about_integer")
+param=ABAC.DataTerm("integer","4")
+head.role_add_data_term(param)
+tail=ABAC.Role(marchhare)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("party_about_integer__marchhare_attr.der")
+ctxt.load_attribute_file("party_about_integer__marchhare_attr.der")
+print attr.string()
+print attr.typed_string()
+print "\n"
+
+###############################################
+# [keyid:Party].role:about_boolean([boolean:true])
+#                 <- [keyid:MarchHare]
+head=ABAC.Role(party,"about_boolean")
+param=ABAC.DataTerm("boolean","true")
+head.role_add_data_term(param)
+tail=ABAC.Role(marchhare)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("party_about_boolean__marchhare_attr.der")
+ctxt.load_attribute_file("party_about_boolean__marchhare_attr.der")
+print attr.string()
+print attr.typed_string()
+print "\n"
+
+###############################################
+# [keyid:Party].role:about_key([keyid:tea])
+#                 <- [keyid:MarchHare]
+head=ABAC.Role(party,"about_key")
+param=ABAC.DataTerm(teaID)
+head.role_add_data_term(param)
+tail=ABAC.Role(marchhare)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("party_about_key__marchhare_attr.der")
+ctxt.load_attribute_file("party_about_key__marchhare_attr.der")
+print attr.string()
+print attr.typed_string()
+print "\n"
+
+###############################################
+# [keyid:Party].role:about_another_time([time:20201101T182930])
+#                 <- [keyid:MarchHare]
+head=ABAC.Role(party,"about_another_time")
+param=ABAC.DataTerm("time","20201101T182930")
+head.role_add_data_term(param)
+tail=ABAC.Role(marchhare)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("party_about_another_time__marchhare_attr.der")
+ctxt.load_attribute_file("party_about_another_time__marchhare_attr.der")
+print attr.string()
+print attr.typed_string()
+print "\n"
+
+###############################################
+# [keyid:Party].role:about_time([time:20201101T])
+#                 <- [keyid:MarchHare]
+head=ABAC.Role(party,"about_time")
+param=ABAC.DataTerm("time","20201101T")
+head.role_add_data_term(param)
+tail=ABAC.Role(marchhare)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("party_about_time__marchhare_attr.der")
+ctxt.load_attribute_file("party_about_time__marchhare_attr.der")
+print attr.string()
+print attr.typed_string()
+print "\n"
+
+###############################################
+# [keyid:Party].role:guestof([principal:?V]) 
+#           <- [keyid:Party].role:friendOf([principal:?V])
+#
+head=ABAC.Role(party,"guestOf")
+param=ABAC.DataTerm("principal","V")
+head.role_add_data_term(param)
+tail=ABAC.Role(party,"friendOf")
+param=ABAC.DataTerm("principal","V")
+tail.role_add_data_term(param)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("party_guestof_qV__party_friendof_qV_attr.der")
+ctxt.load_attribute_file("party_guestof_qV__party_friendof_qV_attr.der")
+print attr.string()
+print attr.typed_string()
+print "\n"
+
+###############################################
+# [keyid:Party].role:guests 
+#        <- [keyid:Party].role:friendOf([keyid:MarchHare])
+#
+head=ABAC.Role(party,"guests")
+tail=ABAC.Role(party,"friendOf")
+param=ABAC.DataTerm(marchhareID)
+tail.role_add_data_term(param)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("party_guests__party_friendof_marchhare_attr.der")
+ctxt.load_attribute_file("party_guests__party_friendof_marchhare_attr.der")
+print attr.string()
+print attr.typed_string()
+print "\n"
+
+###############################################
+# [keyid:Party].role:friendOf([keyid:MarchHare]) 
+#                               <- [keyid:Dormouse]
+#
+head=ABAC.Role(party,"friendOf")
+param=ABAC.DataTerm(marchhareID)
+head.role_add_data_term(param)
+tail=ABAC.Role(dormouse)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("party_friendof_marchhare__dormouse_attr.der")
+ctxt.load_attribute_file("party_friendof_marchhare__dormouse_attr.der")
+print attr.string()
+print attr.typed_string()
+print "\n"
+
+###############################################
+# [keyid:Party].role:friendOf([keyid:Alice]) 
+#                               <- [keyid:Hatter]
+#
+head=ABAC.Role(party,"friendOf")
+param=ABAC.DataTerm(aliceID)
+head.role_add_data_term(param)
+tail=ABAC.Role(hatter)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("party_friendof_alice__hatter_attr.der")
+ctxt.load_attribute_file("party_friendof_alice__hatter_attr.der")
+print attr.string()
+print attr.typed_string()
+print "\n"
+
+ctxt.dump_yap_db()
+##
Index: examples/python_tests/alice_rt1/query.py
===================================================================
--- examples/python_tests/alice_rt1/query.py	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
+++ examples/python_tests/alice_rt1/query.py	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -0,0 +1,81 @@
+#!/usr/bin/env python
+
+"""
+  to test with python
+
+cmd1:env keystore=`pwd` ./query.py 
+cmd2: env ABAC_CN=1 keystore=`pwd` ./query.py
+
+"""
+
+import os
+import ABAC
+
+ctxt = ABAC.Context()
+
+# print "ABAC version %s" % ctxt.version()
+
+keystore=os.environ["keystore"]
+
+ctxt.load_directory(keystore)
+
+aliceID=ABAC.ID("Alice_ID.pem")
+aliceID.id_load_privkey_file("Alice_private.pem")
+alice=aliceID.id_keyid()
+
+partyID=ABAC.ID("Party_ID.pem")
+partyID.id_load_privkey_file("Party_private.pem")
+party=partyID.id_keyid()
+
+teaID=ABAC.ID("Tea_ID.pem")
+teaID.id_load_privkey_file("Tea_private.pem")
+tea=teaID.id_keyid()
+
+hatterID=ABAC.ID("Hatter_ID.pem")
+hatterID.id_load_privkey_file("Hatter_private.pem")
+hatter=hatterID.id_keyid()
+
+marchhareID=ABAC.ID("Marchhare_ID.pem")
+marchhareID.id_load_privkey_file("Marchhare_private.pem")
+marchhare=marchhareID.id_keyid()
+
+dormouseID=ABAC.ID("Dormouse_ID.pem")
+dormouseID.id_load_privkey_file("Dormouse_private.pem")
+dormouse=dormouseID.id_keyid()
+
+
+
+##########################################################################
+# role=[keyid:Party].role:guests 
+# p=[keyid:dormouse]
+role = ABAC.Role(party,"guests")
+p = ABAC.Role(dormouse)
+print "\n===good============ Party.guests <- dourmouse"
+out = ctxt.query(role, p)
+for c in out[1]:
+    print "%s <- %s" % (c.head_string(), c.tail_string())
+
+##########################################################################
+# role=[keyid:Party].role:guests 
+# p=[keyid:hatter]
+role = ABAC.Role(party,"guests")
+p = ABAC.Role(hatter)
+print "\n===bad============ Party.guests <- hatter"
+out = ctxt.query(role, p)
+for c in out[1]:
+    print "%s <- %s" % (c.head_string(), c.tail_string())
+
+
+##########################################################################
+# dump the loaded principals/policies
+#
+out = ctxt.context_principals()
+print "\n...final principal set..."
+for x in out[1]:
+    print "%s " % x.string()
+print "\n"
+out = ctxt.context_credentials()
+print "\n...final policy attribute set..."
+for c in out[1]:
+    print "%s <- %s" % (c.head_string(), c.tail_string())
+print "\n"
Index: examples/python_tests/alice_rt1/run_test
===================================================================
--- examples/python_tests/alice_rt1/run_test	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
+++ examples/python_tests/alice_rt1/run_test	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -0,0 +1,35 @@
+#!/bin/sh 
+
+ABAC_PROVER_PATH="/home/mei/Deter/abac/libabac"
+export ABAC_PROVER_PATH
+
+echo '---setup principals'
+env keystore=`pwd` ./setup.py 1>/dev/null 2>& 1
+
+echo '---setup attributes'
+env keystore=`pwd` ./attr.py 1> alice.log 2>& 1
+
+echo '---run queries'
+
+# Make prover queries
+g_cmd_sha=`grep "cmd1:" query.py |sed "s/cmd1://g" `
+g_cmd_cn=`grep "cmd2:" query.py |sed "s/cmd2://g" `
+
+echo '...with sha'
+eval $g_cmd_sha 2>/dev/null 1 > alice.sha
+
+echo '...with cn'
+eval $g_cmd_cn 1>alice.cn 2>&1
+
+result=`diff alice.cn alice.save 2>/dev/null`
+if [ $? -eq 0 ]; then
+    if [ "$result" = "" ]; then
+       echo "   PASSED"
+    else
+       echo "   ERROR:alice_rt1 test result differs!!!"
+    fi
+else
+    echo "   ERROR:alice_rt1 test result differs!!!"
+fi
+
+
Index: examples/python_tests/alice_rt1/setup.py
===================================================================
--- examples/python_tests/alice_rt1/setup.py	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
+++ examples/python_tests/alice_rt1/setup.py	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+
+"""
+  Setup principal ID credentials
+
+"""
+import os
+import ABAC
+
+ctxt = ABAC.Context()
+
+alice=ABAC.ID("Alice", 0)
+alice.id_write_cert("Alice_ID.pem")
+alice.id_write_privkey("Alice_private.pem")
+
+party=ABAC.ID("Party", 0)
+party.id_write_cert("Party_ID.pem")
+party.id_write_privkey("Party_private.pem")
+
+tea=ABAC.ID("Tea", 0)
+tea.id_write_cert("Tea_ID.pem")
+tea.id_write_privkey("Tea_private.pem")
+
+hatter=ABAC.ID("Hatter", 0)
+hatter.id_write_cert("Hatter_ID.pem")
+hatter.id_write_privkey("Hatter_private.pem")
+
+marchhare=ABAC.ID("Marchhare", 0)
+marchhare.id_write_cert("Marchhare_ID.pem")
+marchhare.id_write_privkey("Marchhare_private.pem")
+
+dormouse=ABAC.ID("Dormouse", 0)
+dormouse.id_write_cert("Dormouse_ID.pem")
+dormouse.id_write_privkey("Dormouse_private.pem")
+
+
Index: examples/python_tests/allout.save
===================================================================
--- examples/python_tests/allout.save	(revision 5f551d32ce8befe42bdd0b6cc9391e217749c595)
+++ examples/python_tests/allout.save	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -25,4 +25,12 @@
 
  ==> RUN on acme_rockets_rt0
+---setup principals
+---setup attributes
+---run queries
+...with sha
+...with cn
+   PASSED
+
+ ==> RUN on alice_rt1
 ---setup principals
 ---setup attributes
Index: examples/python_tests/alumni2_rt1/run_test
===================================================================
--- examples/python_tests/alumni2_rt1/run_test	(revision 5f551d32ce8befe42bdd0b6cc9391e217749c595)
+++ examples/python_tests/alumni2_rt1/run_test	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -8,5 +8,5 @@
 
 echo '---setup attributes'
-env keystore=`pwd` ./attr.py 1>/dev/null 2>& 1
+env keystore=`pwd` ./attr.py 1>alumni2.log 2>& 1
 
 echo '---run queries'
Index: examples/python_tests/alumni3_rt1/run_test
===================================================================
--- examples/python_tests/alumni3_rt1/run_test	(revision 5f551d32ce8befe42bdd0b6cc9391e217749c595)
+++ examples/python_tests/alumni3_rt1/run_test	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -8,5 +8,5 @@
 
 echo '---setup attributes'
-env keystore=`pwd` ./attr.py 1>/dev/null 2>& 1
+env keystore=`pwd` ./attr.py 1>alumni3.log 2>& 1
 
 echo '---run queries'
Index: examples/python_tests/alumni_rt1/README
===================================================================
--- examples/python_tests/alumni_rt1/README	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
+++ examples/python_tests/alumni_rt1/README	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -0,0 +1,90 @@
+#!/bin/sh
+#
+# This example shows an example of reasoning about a role's parameters.  There
+# are 4 principals StateU, Bob, Maryann, and Joe.  StateU wants to establish a
+# set of founding alumni based on the year of graduation.  On graduation each
+# alum has previously been issued a credential parameterized with their major
+# and graduation year.  StateU sets up a policy that says that a principal is a
+# founding alum if they graduated in 1955 through 1958 inclusive no matter what
+# major the principal had.  This policy is expressed in Credential 1.
+#
+# Credentials 2, 3, and 4 each assign a diploma credential to Bob (a 1960
+# mathematics degree), Joe (a 1955 zoology degree) and Maryann (a 1956
+# psychology degree).
+#
+# The attached ./run_query file asks if each of these principals are favored
+# alums and Joe and Maryann are.
+
+# alumni_rt1_typed
+
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Bob] (no)
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Maryann] (yes)
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Joe] (yes)
+
+creddy --generate --cn StateU
+creddy --generate --cn Bob
+creddy --generate --cn Maryann
+creddy --generate --cn Joe
+
+stateU_keyid=`creddy --keyid --cert StateU_ID.pem`
+bob_keyid=`creddy --keyid --cert Bob_ID.pem`
+maryann_keyid=`creddy --keyid --cert Maryann_ID.pem`
+joe_keyid=`creddy --keyid --cert Joe_ID.pem`
+
+diploma_q_qY="diploma([?], [integer:?Year:[1955..1958]])"
+
+diploma_m="diploma([string:'mathmatics'],[integer:1960])"
+diploma_z="diploma([string:'zoology'],[integer:1955])"
+diploma_p="diploma([string:'psychology'],[integer:1956])"
+
+# [keyid:stateU].role:foundingAlumni 
+#                   <- [keyid:stateU].role:diploma([?], [integer:?Year:[1955..1958]])
+# Credential 1
+creddy --attribute \
+       --issuer StateU_ID.pem --key StateU_private.pem --role "foundingAlumni" \
+       --subject-cert StateU_ID.pem --subject-role "$diploma_q_qY" \
+       --out StateU_foundingAlumni__stateU_diploma_q_qY_attr.der
+
+# [keyid:stateU].role:diploma([string:'mathmatics'],[integer:1960]) <- [keyid:bob]
+# Credential 2
+creddy --attribute \
+        --issuer StateU_ID.pem --key StateU_private.pem --role "$diploma_m" \
+        --subject-cert Bob_ID.pem \
+        --out StateU_diploma_m__Bob_attr.der
+
+# [keyid:stateU].role:diploma([string:'zoology'],[integer:1955]) <- [keyid:joe]
+# Credential 3
+creddy --attribute \
+        --issuer StateU_ID.pem --key StateU_private.pem --role "$diploma_z" \
+        --subject-cert Joe_ID.pem \
+        --out StateU_diploma_m__Joe_attr.der
+
+# [keyid:stateU].role:diploma([string:'psychology'],[integer:1956]) <- [keyid:maryann]
+# Credential 4
+creddy --attribute \
+        --issuer StateU_ID.pem --key StateU_private.pem --role "$diploma_p" \
+        --subject-cert Maryann_ID.pem \
+        --out StateU_diploma_m__Maryann_attr.der
+
+
+#####################################################################
+# stateU.foundingAlumni <- stateU.diploma(?, ?Year:[1955..1958])
+# [keyid:stateU].role:foundingAlumni 
+#                <- [keyid:stateU].role:diploma([?], [integer:?Year:[1955..1958]])
+# 
+# stateU.diploma(mathmatics,1960)<-bob
+# [keyid:stateU].role:diploma([string:'mathmatics'],[integer:1960]) <- [keyid:bob]
+# 
+# stateU.diploma(zoology,1955)<-joe
+# [keyid:stateU].role:diploma([string:'zoology'],[integer:1955]) <- [keyid:joe]
+#
+# stateU.diploma(psychology,1956)<-maryann
+# [keyid:stateU].role:diploma([string:'psychology'],[integer:1956]) <- [keyid:maryann]
+#
+# query,
+# stateU.foundingAlumni<-?-bob  bad
+# [keyid:stateU].role:foundingAlumni <- [keyid:bob]
+# 
+# stateU.foundingAlumni<-?-maryann  good
+# [keyid:stateU].role:foundingAlumni <- [keyid:maryann]
+#
Index: examples/python_tests/alumni_rt1/alumni.save
===================================================================
--- examples/python_tests/alumni_rt1/alumni.save	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
+++ examples/python_tests/alumni_rt1/alumni.save	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -0,0 +1,30 @@
+% Restoring file /usr/local/lib/Yap/startup.yss
+  
+===bad============ stateU.foundingAlumni <- Bob
+YAP query failed
+
+===good============ stateU.foundingAlumni <- Maryann
+YAP query succeed
+pStateU.foundingAlumni <- pStateU.diploma(_,Year:[1955 .. 1958])
+pStateU.diploma('psychology',1956) <- pMaryann
+
+===good============ stateU.foundingAlumni <- Joe
+YAP query succeed
+pStateU.foundingAlumni <- pStateU.diploma(_,Year:[1955 .. 1958])
+pStateU.diploma('zoology',1955) <- pJoe
+
+...final principal set...
+(pBob,keyid,y) 
+(pJoe,keyid,y) 
+(pMaryann,keyid,y) 
+(pStateU,keyid,y) 
+
+
+
+...final policy attribute set...
+pStateU.diploma('mathmatics',1960) <- pBob
+pStateU.diploma('psychology',1956) <- pMaryann
+pStateU.diploma('zoology',1955) <- pJoe
+pStateU.foundingAlumni <- pStateU.diploma(_,Year:[1955 .. 1958])
+
+
Index: examples/python_tests/alumni_rt1/attr.py
===================================================================
--- examples/python_tests/alumni_rt1/attr.py	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
+++ examples/python_tests/alumni_rt1/attr.py	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -0,0 +1,122 @@
+#!/usr/bin/env python
+
+"""
+  Setup access policy attribute rules
+
+cmd1:env keystore=`pwd` ./attr.py 
+
+"""
+
+import os
+import ABAC
+
+keystore=os.environ["keystore"]
+
+ctxt = ABAC.Context()
+print "ABAC version %s" % ctxt.version()
+
+ctxt.load_directory(keystore)
+
+out = ctxt.context_principals()
+print "...initial principal set..."
+for x in out[1]:
+    print "%s " % x.string()
+print "\n" 
+
+out = ctxt.context_credentials()
+print "...initial policy attribute set..."
+for c in out[1]:
+    print "%s <- %s" % (c.head_string(), c.tail_string())
+print "\n"
+
+stateUID=ABAC.ID("StateU_ID.pem")
+stateUID.id_load_privkey_file("StateU_private.pem")
+stateU=stateUID.id_keyid()
+
+bobID=ABAC.ID("Bob_ID.pem")
+bobID.id_load_privkey_file("Bob_private.pem")
+bob=bobID.id_keyid()
+
+joeID=ABAC.ID("Joe_ID.pem")
+joeID.id_load_privkey_file("Joe_private.pem")
+joe=joeID.id_keyid()
+
+maryannID=ABAC.ID("Maryann_ID.pem")
+maryannID.id_load_privkey_file("Maryann_private.pem")
+maryann=maryannID.id_keyid()
+
+
+################################################
+# [keyid:stateU].role:foundingAlumni
+#                   <- [keyid:stateU].role:diploma([?], [integer:?Year:[1955 .. 1958]])
+head = ABAC.Role(stateU,"foundingAlumni")
+param1=ABAC.DataTerm("anonymous", "_")
+cond=ABAC.Constraint("integer")
+cond.constraint_add_integer_min(1955)
+cond.constraint_add_integer_max(1958)
+param2=ABAC.DataTerm("integer", "Year", cond)
+tail = ABAC.Role(stateU,"diploma")
+tail.role_add_data_term(param1)
+tail.role_add_data_term(param2)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("StateU_foundingAlumni__stateU_diploma_q_qY_attr.der")
+ctxt.load_attribute_file("StateU_foundingAlumni__stateU_diploma_q_qY_attr.der")
+print attr.string() 
+print attr.typed_string()
+print "\n"
+
+#################################################
+# [keyid:stateU].role:diploma([string:'mathmatics'],[integer:1960]) <- [keyid:bob]
+param1=ABAC.DataTerm("string", "'mathmatics'")
+param2=ABAC.DataTerm("integer", "1960")
+head = ABAC.Role(stateU,"diploma")
+head.role_add_data_term(param1)
+head.role_add_data_term(param2)
+tail = ABAC.Role(bob)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("StateU_diploma_m__Bob_attr.der")
+ctxt.load_attribute_file("StateU_diploma_m__Bob_attr.der")
+print attr.string() 
+print attr.typed_string()
+print "\n"
+
+#################################################
+# [keyid:stateU].role:diploma([string:'zoology'],[integer:1955]) <- [keyid:joe]
+param1=ABAC.DataTerm("string", "'zoology'")
+param2=ABAC.DataTerm("integer", "1955")
+head = ABAC.Role(stateU,"diploma")
+head.role_add_data_term(param1)
+head.role_add_data_term(param2)
+tail = ABAC.Role(joe)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("StateU_diploma_z__Joe_attr.der")
+ctxt.load_attribute_file("StateU_diploma_z__Joe_attr.der")
+print attr.string() 
+print attr.typed_string()
+print "\n"
+
+#################################################
+# [keyid:stateU].role:diploma([string:'psychology'],[integer:1956]) <- [keyid:maryann]
+param1=ABAC.DataTerm("string", "'psychology'")
+param2=ABAC.DataTerm("integer", "1956")
+head = ABAC.Role(stateU,"diploma")
+head.role_add_data_term(param1)
+head.role_add_data_term(param2)
+tail = ABAC.Role(maryann)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("StateU_diploma_p__Maryann_attr.der")
+ctxt.load_attribute_file("StateU_diploma_p__Maryann_attr.der")
+print attr.string() 
+print attr.typed_string()
+print "\n"
+
+ctxt.dump_yap_db()
+##
Index: examples/python_tests/alumni_rt1/query.py
===================================================================
--- examples/python_tests/alumni_rt1/query.py	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
+++ examples/python_tests/alumni_rt1/query.py	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -0,0 +1,82 @@
+#!/usr/bin/env python
+
+"""
+  to test with python
+
+cmd1:env keystore=`pwd` ./query.py 
+cmd2: env ABAC_CN=1 keystore=`pwd` ./query.py
+
+"""
+
+import os
+import ABAC
+
+ctxt = ABAC.Context()
+
+# print "ABAC version %s" % ctxt.version()
+
+keystore=os.environ["keystore"]
+
+ctxt.load_directory(keystore)
+
+stateUID=ABAC.ID("StateU_ID.pem")
+stateUID.id_load_privkey_file("StateU_private.pem")
+stateU=stateUID.id_keyid()
+
+bobID=ABAC.ID("Bob_ID.pem")
+bobID.id_load_privkey_file("Bob_private.pem")
+bob=bobID.id_keyid()
+
+joeID=ABAC.ID("Joe_ID.pem")
+joeID.id_load_privkey_file("Joe_private.pem")
+joe=joeID.id_keyid()
+
+maryannID=ABAC.ID("Maryann_ID.pem")
+maryannID.id_load_privkey_file("Maryann_private.pem")
+maryann=maryannID.id_keyid()
+
+##########################################################################
+# role=[keyid:stateU].role:foundingAlumni
+# p=[keyid:Bob] 
+role = ABAC.Role(stateU,"foundingAlumni")
+p = ABAC.Role(bob)
+print "\n===bad============ stateU.foundingAlumni <- Bob"
+out = ctxt.query(role, p)
+for c in out[1]:
+    print "%s <- %s" % (c.head_string(), c.tail_string())
+
+##########################################################################
+# role=[keyid:stateU].role:foundingAlumni
+# p=[keyid:Maryann] 
+role = ABAC.Role(stateU,"foundingAlumni")
+p = ABAC.Role(maryann)
+print "\n===good============ stateU.foundingAlumni <- Maryann"
+out = ctxt.query(role, p)
+for c in out[1]:
+    print "%s <- %s" % (c.head_string(), c.tail_string())
+
+##########################################################################
+# role=[keyid:stateU].role:foundingAlumni
+# p=[keyid:Joe] 
+role = ABAC.Role(stateU,"foundingAlumni")
+p = ABAC.Role(joe)
+print "\n===good============ stateU.foundingAlumni <- Joe"
+out = ctxt.query(role, p)
+for c in out[1]:
+    print "%s <- %s" % (c.head_string(), c.tail_string())
+
+##########################################################################
+# dump the loaded principals/policies
+#
+out = ctxt.context_principals()
+print "\n...final principal set..."
+for x in out[1]:
+    print "%s " % x.string()
+print "\n"
+out = ctxt.context_credentials()
+print "\n...final policy attribute set..."
+for c in out[1]:
+    print "%s <- %s" % (c.head_string(), c.tail_string())
+print "\n"
+
+
Index: examples/python_tests/alumni_rt1/run_test
===================================================================
--- examples/python_tests/alumni_rt1/run_test	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
+++ examples/python_tests/alumni_rt1/run_test	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -0,0 +1,35 @@
+#!/bin/sh 
+
+ABAC_PROVER_PATH="/home/mei/Deter/abac/libabac"
+export ABAC_PROVER_PATH
+
+echo '---setup principals'
+env keystore=`pwd` ./setup.py 1>/dev/null 2>& 1
+
+echo '---setup attributes'
+env keystore=`pwd` ./attr.py 1>alumni.log 2>& 1
+
+echo '---run queries'
+
+# Make prover queries
+g_cmd_sha=`grep "cmd1:" query.py |sed "s/cmd1://g" `
+g_cmd_cn=`grep "cmd2:" query.py |sed "s/cmd2://g" `
+
+echo '...with sha'
+eval $g_cmd_sha 2>/dev/null 1 > alumni.sha
+
+echo '...with cn'
+eval $g_cmd_cn 1>alumni.cn 2>&1
+
+result=`diff alumni.cn alumni.save 2>/dev/null`
+if [ $? -eq 0 ]; then
+    if [ "$result" = "" ]; then
+       echo "   PASSED"
+    else
+       echo "   ERROR:alumni_rt1 test result differs!!!"
+    fi
+else
+    echo "   ERROR:alumni_rt1 test result differs!!!"
+fi
+
+
Index: examples/python_tests/alumni_rt1/setup.py
===================================================================
--- examples/python_tests/alumni_rt1/setup.py	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
+++ examples/python_tests/alumni_rt1/setup.py	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+
+"""
+  Setup 4 principal ID credentials
+
+"""
+import os
+import ABAC
+
+ctxt = ABAC.Context()
+
+stateU=ABAC.ID("StateU", 0)
+stateU.id_write_cert("StateU_ID.pem")
+stateU.id_write_privkey("StateU_private.pem")
+
+bob=ABAC.ID("Bob", 0)
+bob.id_write_cert("Bob_ID.pem")
+bob.id_write_privkey("Bob_private.pem")
+
+joe=ABAC.ID("Joe", 0)
+joe.id_write_cert("Joe_ID.pem")
+joe.id_write_privkey("Joe_private.pem")
+
+maryann=ABAC.ID("Maryann", 0)
+maryann.id_write_cert("Maryann_ID.pem")
+maryann.id_write_privkey("Maryann_private.pem")
+
+
Index: examples/python_tests/balltime_rt2/run_test
===================================================================
--- examples/python_tests/balltime_rt2/run_test	(revision 5f551d32ce8befe42bdd0b6cc9391e217749c595)
+++ examples/python_tests/balltime_rt2/run_test	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -8,5 +8,5 @@
 
 echo '---setup attributes'
-env keystore=`pwd` ./attr.py 1>/dev/null 2>& 1
+env keystore=`pwd` ./attr.py 1>ball.log 2>& 1
 
 echo '---run queries'
Index: examples/python_tests/basic_id/run_test
===================================================================
--- examples/python_tests/basic_id/run_test	(revision 5f551d32ce8befe42bdd0b6cc9391e217749c595)
+++ examples/python_tests/basic_id/run_test	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -8,5 +8,5 @@
 
 echo '---setup principals'
-./setup.py 2>/dev/null 1 > id.sha
+./setup.py 1>id.log 2>&1
 
 echo '---run with sha'
Index: examples/python_tests/basic_id/setup.py
===================================================================
--- examples/python_tests/basic_id/setup.py	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
+++ examples/python_tests/basic_id/setup.py	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -0,0 +1,21 @@
+#!/usr/bin/env python
+
+"""
+  to test with python
+
+
+"""
+import os
+import ABAC
+
+ctxt = ABAC.Context()
+
+jackID=ABAC.ID("Jack", 0)
+jackID.id_write_cert("Jack_ID.pem")
+jackID.id_write_privkey("Jack_private.pem")
+
+bobID=ABAC.ID("Bob", 0)
+bobID.id_write_cert("Bob_ID.pem")
+bobID.id_write_privkey("Bob_private.pem")
+
+
Index: examples/python_tests/evaluator_rt1/run_test
===================================================================
--- examples/python_tests/evaluator_rt1/run_test	(revision 5f551d32ce8befe42bdd0b6cc9391e217749c595)
+++ examples/python_tests/evaluator_rt1/run_test	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -9,5 +9,5 @@
 
 echo '---setup attributes'
-env keystore=`pwd` ./attr.py 1>/dev/null 2>& 1
+env keystore=`pwd` ./attr.py 1>eveluator.log 2>& 1
 
 echo '---run queries'
Index: examples/python_tests/experiment_create_rt0/experiment.save
===================================================================
--- examples/python_tests/experiment_create_rt0/experiment.save	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
+++ examples/python_tests/experiment_create_rt0/experiment.save	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -0,0 +1,31 @@
+% Restoring file /usr/local/lib/Yap/startup.yss
+
+===good=============== Globotron.admin <- Alice
+YAP query succeed
+pGlobotron.admin <- pAlice
+
+===bad=============== Globotron.admin <- Bob
+YAP query failed
+
+===good=============== Acme.experiment_create <- Bob
+YAP query succeed
+pAcme.experiment_create <- pGlobotron.admin.power_user
+pGlobotron.admin <- pAlice
+pAlice.power_user <- pBob
+
+...final principal set...
+(pAcme,keyid,y) 
+(pAlice,keyid,y) 
+(pBob,keyid,y) 
+(pGlobotron,keyid,y) 
+
+
+
+...final policy attribute set...
+pAcme.experiment_create <- pAcme.partner.experiment_create
+pAcme.partner <- pGlobotron
+pAlice.power_user <- pBob
+pGlobotron.admin <- pAlice
+pAcme.experiment_create <- pGlobotron.admin.power_user
+
+
Index: examples/python_tests/experiment_create_rt0/run_test
===================================================================
--- examples/python_tests/experiment_create_rt0/run_test	(revision 5f551d32ce8befe42bdd0b6cc9391e217749c595)
+++ examples/python_tests/experiment_create_rt0/run_test	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -9,5 +9,5 @@
 
 echo '---setup attributes'
-env keystore=`pwd` ./attr.py 1>/dev/null 2>& 1
+env keystore=`pwd` ./attr.py 1>experiment.log 2>& 1
 
 echo '---run queries'
Index: examples/python_tests/file_read_rt2/run_test
===================================================================
--- examples/python_tests/file_read_rt2/run_test	(revision 5f551d32ce8befe42bdd0b6cc9391e217749c595)
+++ examples/python_tests/file_read_rt2/run_test	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -9,5 +9,5 @@
 
 echo '---setup attributes'
-env keystore=`pwd` ./attr.py 1>/dev/null 2>& 1
+env keystore=`pwd` ./attr.py 1>file.log 2>& 1
 
 echo '---run queries'
Index: examples/python_tests/fruits_rt2/run_test
===================================================================
--- examples/python_tests/fruits_rt2/run_test	(revision 5f551d32ce8befe42bdd0b6cc9391e217749c595)
+++ examples/python_tests/fruits_rt2/run_test	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -8,5 +8,5 @@
 
 echo '---setup attributes'
-env keystore=`pwd` ./attr.py 1>/dev/null 2>& 1
+env keystore=`pwd` ./attr.py 1>fruit.log 2>& 1
 
 echo '---run queries'
Index: examples/python_tests/leader_rt1/run_test
===================================================================
--- examples/python_tests/leader_rt1/run_test	(revision 5f551d32ce8befe42bdd0b6cc9391e217749c595)
+++ examples/python_tests/leader_rt1/run_test	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -8,5 +8,5 @@
 
 echo '---setup attributes'
-env keystore=`pwd` ./attr.py 1>/dev/null 2>& 1
+env keystore=`pwd` ./attr.py 1>leader.log 2>& 1
 
 echo '---run queries'
Index: examples/python_tests/payraise_rt1/run_test
===================================================================
--- examples/python_tests/payraise_rt1/run_test	(revision 5f551d32ce8befe42bdd0b6cc9391e217749c595)
+++ examples/python_tests/payraise_rt1/run_test	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -9,5 +9,5 @@
 
 echo '---setup attributes'
-env keystore=`pwd` ./attr.py 1>/dev/null 2>& 1
+env keystore=`pwd` ./attr.py 1>pay.log 2>& 1
 
 echo '---run queries'
Index: examples/python_tests/runall
===================================================================
--- examples/python_tests/runall	(revision 5f551d32ce8befe42bdd0b6cc9391e217749c595)
+++ examples/python_tests/runall	(revision 669b4810acfbeee6bdec4a2443a99b2994efedc8)
@@ -22,5 +22,5 @@
            rm -rf ../allout.tmp
            printf "\n ==> CLEANING on %s\n" "$i" >& 2 ;
-           rm -rf *.der *.pem *.cn *.sha
+           rm -rf *.der *.pem *.cn *.sha *.log
        elif [ "$1" = "run" ] ; then
            printf "\n ==> RUN on %s\n" "$i" >& 2;
