Index: examples/python_tests/leader_rt1/attr.py
===================================================================
--- examples/python_tests/leader_rt1/attr.py	(revision 7211a95f1601147c8c72a41f8043ef08062de055)
+++ examples/python_tests/leader_rt1/attr.py	(revision 7211a95f1601147c8c72a41f8043ef08062de055)
@@ -0,0 +1,151 @@
+#!/usr/bin/env python
+
+"""
+  to test with python
+
+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"
+
+geniID=ABAC.ID("Geni_ID.pem");
+geniID.id_load_privkey_file("Geni_private.pem");
+geni=geniID.id_keyid()
+
+bobID=ABAC.ID("Bob_ID.pem");
+bobID.id_load_privkey_file("Bob_private.pem");
+bob=bobID.id_keyid()
+
+jackID=ABAC.ID("Jack_ID.pem");
+jackID.id_load_privkey_file("Jack_private.pem");
+jack=jackID.id_keyid()
+
+joeID=ABAC.ID("Joe_ID.pem");
+joeID.id_load_privkey_file("Joe_private.pem");
+joe=joeID.id_keyid()
+
+################################################
+# [keyid:geni].role:leader
+#         <- [keyid:geni].role:equivalent([principal:?P[keyid:geni].role:leader])
+head=ABAC.Role(geni,"leader")
+condoset=ABAC.Role(geni,"leader")
+cond=ABAC.Constraint(condoset)
+param=ABAC.DataTerm("principal","P", cond)
+tail = ABAC.Role(geni,"equivalent")
+tail.role_add_data_term(param)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("geni_leader__geni_leader_qP_attr.der")
+ctxt.load_attribute_file("geni_leader__geni_leader_qP_attr.der")
+print attr.string() 
+print attr.typed_string()
+print "\n"
+
+#################################################
+# [keyid:geni].role:leader <- [keyid:bob]
+head=ABAC.Role(geni,"leader")
+tail = ABAC.Role(bob)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("geni_leader__Bob_attr.der")
+ctxt.load_attribute_file("geni_leader__Bob_attr.der")
+print attr.string() 
+print attr.typed_string()
+print "\n"
+
+#################################################
+# [keyid:geni].role:equivalent([keyid:bob]) <- [keyid:Joe]
+param=ABAC.DataTerm(bobID)
+head = ABAC.Role(geni,"equivalent")
+head.role_add_data_term(param)
+tail = ABAC.Role(joe)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("geni_equivalent_Bob__Joe_attr.der")
+ctxt.load_attribute_file("geni_equivalent_Bob__Joe_attr.der")
+print attr.string() 
+print attr.typed_string()
+print "\n"
+
+#################################################
+# [keyid:geni].role:equivalent([keyid:Joe]) <- [keyid:Bob]
+param=ABAC.DataTerm(joeID)
+head = ABAC.Role(geni,"equivalent")
+head.role_add_data_term(param)
+tail = ABAC.Role(bob)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("geni_equivalent_Joe__Bob_attr.der")
+ctxt.load_attribute_file("geni_equivalent_Joe__Bob_attr.der")
+print attr.string() 
+print attr.typed_string()
+print "\n"
+
+#################################################
+# [keyid:Bob].role:niceCoworker <- [keyid:Maryann])
+head = ABAC.Role(bob,"niceCoworker")
+tail = ABAC.Role(jack)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("Bob_nicecoworker__Maryann_attr.der")
+ctxt.load_attribute_file("Bob_nicecoworker__Maryann_attr.der")
+print attr.string() 
+print attr.typed_string()
+print "\n"
+
+#################################################
+# [keyid:geni].role:evaluatorOf([keyid:Joe]) <-[keyid:Bob]
+param=ABAC.DataTerm(joeID)
+head = ABAC.Role(geni,"evaluatorOf")
+head.role_add_data_term(param)
+tail = ABAC.Role(bob)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("Alpha_evaluator_j__Bob_attr.der")
+ctxt.load_attribute_file("Alpha_evaluator_j__Bob_attr.der")
+print attr.string() 
+print attr.typed_string()
+print "\n"
+
+#################################################
+# [keyid:Bob].role:goodPerformance <- [keyid:Joe])
+head = ABAC.Role(bob,"goodPerformance")
+tail = ABAC.Role(joe)
+attr=ABAC.Attribute(head, 1800)
+attr.attribute_add_tail(tail)
+attr.attribute_bake()
+attr.attribute_write_cert("Bob_goodperformance__Joe_attr.der")
+ctxt.load_attribute_file("Bob_goodperformance__Joe_attr.der")
+print attr.string() 
+print attr.typed_string()
+print "\n"
+
+
+ctxt.dump_yap_db()
+##
