Index: examples/attr_tests/Makefile
===================================================================
--- examples/attr_tests/Makefile	(revision c00fcc313b5464d08120b7f2abf7938882ac07c2)
+++ examples/attr_tests/Makefile	(revision c00fcc313b5464d08120b7f2abf7938882ac07c2)
@@ -0,0 +1,15 @@
+
+.PHONY : runcheck clean 
+runcheck: $(DIRECTORY)
+
+clean:
+	rm -rf *.out *.xml
+	rm -rf result
+
+runcheck: 
+	@echo 'running libabac ATTRS testing...' 
+	@./run_test > result 2>/dev/null; \
+	if test -f result && test `diff -q result.save result |wc -l ` -eq 0 ; \
+	then echo "   PASSED"; \
+	else echo "   ERROR:got changes!!!"; \
+	fi
Index: examples/attr_tests/README
===================================================================
--- examples/attr_tests/README	(revision c00fcc313b5464d08120b7f2abf7938882ac07c2)
+++ examples/attr_tests/README	(revision c00fcc313b5464d08120b7f2abf7938882ac07c2)
@@ -0,0 +1,10 @@
+
+In this testing suite, different flavors of attribute xml is tried.
+
+privilege_attr.xml,  a valid self-signed priviledge GENI attribute credential 
+                     with multiple attribute rules 
+
+abac_attr.xml,  a valid self-signed abac attribute credential with a single 
+                attribute rule
+
+
Index: examples/attr_tests/abac_attr.xml_save
===================================================================
--- examples/attr_tests/abac_attr.xml_save	(revision c00fcc313b5464d08120b7f2abf7938882ac07c2)
+++ examples/attr_tests/abac_attr.xml_save	(revision c00fcc313b5464d08120b7f2abf7938882ac07c2)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<signed-credential>
+    <credential xml:id="ref0">
+	<type>abac</type>
+	<version>1.0</version>
+	<expires>2014-05-16T17:36:16Z</expires>
+	<rt0>1b4b34112e1f4fb09e1cf6aab3005b823bc32f15.delicious&lt;-3853ed099d57a77f122d1e1c77330f47cb6895bb</rt0>
+    </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>HpQK7L1O2ko+B3YKSIVsnLqGeIU=</DigestValue>
+		</Reference>
+	    </SignedInfo>
+	    <SignatureValue>V8QPbNBEOjsMuwAll/IMZ1D9qmxOwGSqYJqH2PO8AUWOSnBOU2DGoz91c2xHpNWb
+DaC/9yAEvpfauW4mjB0kDnZynVYWAFyRv8gid1KRYVTQFQufAwJLB7aW9yLecmwo
+A+sCXfHhvnP2dEee3QDErSDB90SkhQY18NY4vFqOxEUfu6j9NGvXFyK6bbhRw5bz
+q9nvyq6xhX9AkgPxA8A6mN/AL09I8KWzk6+Jk8nvTHUUI1U2seSF3JlN7PgV8HSR
+DloiNUdnR5WzFeeDDgJVidh07kK9MKTIIln98rNHFdfs97DjN/K9IBoHbGu91RoG
+DzcAPzGE+cJqpJODrErL9g==</SignatureValue>
+	    <KeyInfo>
+	      <KeyValue>
+<RSAKeyValue>
+<Modulus>
+nZ8zZ7HhvVG4IciQL98FqqvyDLamCDRo4jnXh1lIyQTvrPTeHarwBj0yr7NP2olH
+0IaxahYkOa4kzQY0vB9CAfPLoMoi+d3q9m9m+GE3WSiZMA0S04RqMWR3G27/+emR
+dL5ELkmFHSv3QQLYKWNXXlasNNUqopZONvme/5jVsqY25T5eeI3Hbk9HkbDWx9Ue
+kFx1/I4QuTOgPtBmYCgpOk5SMBw9Nrb5q8p7VIe6Oeqr9ko/HqA2d3cptb1Yytok
+8AzrNUKHAemCRwSrStG5p9jx05jZ9GoUM2/BJ8Mj6/6JvCUx024uVT7p/N3AOh3V
+RBnJEEUQE/wjoG1NJZ3REQ==
+</Modulus>
+<Exponent>
+AQAB
+</Exponent>
+</RSAKeyValue>
+</KeyValue>
+		<X509Data>
+		    
+		    
+		    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0xDH0DlO+8A8ri6aUg==</X509Certificate>
+<X509SubjectName>CN=IceCream</X509SubjectName>
+<X509IssuerSerial>
+<X509IssuerName>CN=IceCream</X509IssuerName>
+<X509SerialNumber>15498459534543063866</X509SerialNumber>
+</X509IssuerSerial>
+</X509Data>
+	    </KeyInfo>
+	</Signature>
+    </signatures>
+</signed-credential>
Index: examples/attr_tests/privilege_attr.xml_save
===================================================================
--- examples/attr_tests/privilege_attr.xml_save	(revision c00fcc313b5464d08120b7f2abf7938882ac07c2)
+++ examples/attr_tests/privilege_attr.xml_save	(revision c00fcc313b5464d08120b7f2abf7938882ac07c2)
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<signed-credential><credential xml:id="ref0"><type>privilege</type><serial>8</serial>
+    <owner_gid>
+MIIDBjCCAe6gAwIBAgIJAPE7s3B5kTdLMA0GCSqGSIb3DQEBBQUAMBAxDjAMBgNV
+BAMTBW93bmVyMB4XDTEzMDUwOTAwNTEwN1oXDTE2MDQyMzAwNTEwN1owEDEOMAwG
+A1UEAxMFb3duZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCkKGUk
+ruciVF3pt6EoZIPE658WP/r3y+VYJ8qz7vaOaq7zhtWAxJU+3D/bLwDVgIa/pJhy
+80HfU1w1sT5BF7u04jz8kXk3a2yG6blYIMSESyTmGG1Kh3qQIvAQCzG6u9JE9/Dl
+jv/FaI7xppRQfSWNCJjEAg6Yp+Zh1pIdmQ0L4XgCJpZ3J0sjDBF3klZOlSNdXHP+
+VFPZM2zFVGN8Psf9talcDsPPxiyjIFOP3ZNaAHbSTFqs0Fet6mBCcyUq5ihxBmMy
+1DzrYGokcT+BhUOOloIOM2a6FUyS2dnVQdYUJUC49MJzS7eRoq7HFtF2SkkJGoPI
+QhwXBYQATOgCHri9AgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/
+BAQDAgEGMB0GA1UdDgQWBBT3U1j3+H8/5k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EAAaNjMGEwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8B
+Af8EBAMCAQYwHQYDVR0OBBYEFGM6rfF1Nke6YPKLcxD1pWzTKrfiMB8GA1UdIwQY
+MBaAFGM6rfF1Nke6YPKLcxD1pWzTKrfiMA0GCSqGSIb3DQEBBQUAA4IBAQAlm3pV
+IjFjshe1SWsOeBOO4gMrLa2BsZLFKdkcm2pBrRn/L+fzfBl5qOnXoojq7oM/8PGB
+pPGuptXE2H3ybVkS0s5vl4kqrgGAFfUAXzOrc6b5QVntj8oOGEwTf+eQ+mpOB3Zy
+I5CxDJ1EYa6Ad0QCteGuygGzcXa4X1Lu0ueiTAltQ9FpvTclFSqKROM9OMkMSDRm
+PcDbrRZVObXSgqlIKnHB6wLyPSWLkIylWx8TYEWqfRtTHQMJqUFNDiPUvIjzk6J8
+rTke0E30WVS7F08Pipa5TC+5pnrYrXv7zp5cwE2CbAmKxZDK9rFVaSlESDoXOWfj
+kUZGc3/3pSEX0WMC
+    </target_gid><target_urn>urn:publicid:IDN+plc:gpo:site2+user+jkarlin</target_urn><uuid/><expires>2015-07-14T19:52:08Z</expires><privileges><privilege><name>refresh</name><can_delegate>false</can_delegate></privilege><privilege><name>test2</name><can_delegate>true</can_delegate></privilege></privileges></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>oVidj/V4RM0KRcoC08rhAFkfpL4=</DigestValue>
+</Reference>
+</SignedInfo>
+<SignatureValue>l3/o8Zr0v+hPzO2BrgT3066h5MI5H8DWID3C0g+MYcV4d1bYh53L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1UxTt4eAfLaIyanp76AWbhPbJIPn0Ryz2LCDZDmTitmmr9xvu8Sa
+OQfpjSCrVrSxy/CYx9D8ViYMka/Fl3lZ08oUdoe36xkb9YN2fZprE+prPFRAdxtM
+CVhvrxo9mU9DLOsXSS2gfO3iIk6zH21L5QHlo3nLS/rI8TwbA8xQ073W4P8ILhQR
+Xj9JPC3tmHAbkEqQG5G7ZN+/5adL22jOXHZPmwJpPypMD72sl/br0OcJevre16q5
+2qkvKZeS960ut4AnFwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB
+/wQEAwIBBjAdBgNVHQ4EFgQUN4oZIklMFXNyvph9m4ZXYzEZ2eAwHwYDVR0jBBgw
+FoAUN4oZIklMFXNyvph9m4ZXYzEZ2eAwDQYJKoZIhvcNAQEFBQADggEBAA+6vPDp
+M77Zx1beqO1glS2J9b6FqrIanzSI7BiR8cg6dHcCjIZUD6exrvx6SR/rM9vqmgiY
+76H3Y8ezN2C7RnNBj0I22e17sqFzOsyyriBLCk8f52K/M7RnTFawvGaJKAazzOD6
+Dl3FSbnyqZFrTvEmEhRlqqisoHB+93XP3FD5nUCqRY+NQs0y32oBvUR2l2czqgNW
+HOKQtOABuTOQVy0EdEfkRjIgo+XiN9f8rMbv1It71X3We5PNqjTBifC/v4dxkvQq
+/C52P3tMDlK9Nxq9M9/VAxOyrW1wqLVE0/UfULnri52VI9S4JBwq00YaZPtNmK/W
+Y8ftygeJzodeRXI=</X509Certificate>
+<X509SubjectName>CN=issuer</X509SubjectName>
+<X509IssuerSerial>
+<X509IssuerName>CN=issuer</X509IssuerName>
+<X509SerialNumber>3233825962338707039</X509SerialNumber>
+</X509IssuerSerial>
+</X509Data>
+</KeyInfo>
+</Signature></signatures></signed-credential>
+
+
Index: examples/attr_tests/result.save
===================================================================
--- examples/attr_tests/result.save	(revision c00fcc313b5464d08120b7f2abf7938882ac07c2)
+++ examples/attr_tests/result.save	(revision c00fcc313b5464d08120b7f2abf7938882ac07c2)
@@ -0,0 +1,2 @@
+   attr_tests, privilege PASSED
+   attr_tests, abac PASSED
Index: examples/attr_tests/run_test
===================================================================
--- examples/attr_tests/run_test	(revision c00fcc313b5464d08120b7f2abf7938882ac07c2)
+++ examples/attr_tests/run_test	(revision c00fcc313b5464d08120b7f2abf7938882ac07c2)
@@ -0,0 +1,21 @@
+#!/bin/sh
+#########
+# run_test
+#
+rm -rf *.out *.xml
+ 
+# a_run type #attr
+a_run()
+{
+    cp $1_attr.xml_save $1_attr.xml
+    ./show.sh $1_attr.xml 1> $1.out 2>& 1
+    result=`grep "<-" $1.out 2>/dev/null | wc -l`
+    if [ $result -eq $2 ]; then
+       echo "   attr_tests, $1 PASSED"
+    else
+       echo "   attr-tests, $1 FAILED"
+    fi
+}
+
+a_run privilege 6
+a_run abac 1
Index: examples/attr_tests/show.sh
===================================================================
--- examples/attr_tests/show.sh	(revision c00fcc313b5464d08120b7f2abf7938882ac07c2)
+++ examples/attr_tests/show.sh	(revision c00fcc313b5464d08120b7f2abf7938882ac07c2)
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+pwd=`pwd`
+eloc=`which creddy | sed 's/\/creddy//'`
+if [ "$eloc" = "" ]; then
+  echo "ERROR: creddy is not in the search path!!!"
+  exit 1
+fi
+
+$eloc/creddy --roles --cert $1
