Index: tests/creddy_tests/Makefile
===================================================================
--- tests/creddy_tests/Makefile	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ tests/creddy_tests/Makefile	(revision 3c30b595cd3f27758e8966a9935589bdb92486d5)
@@ -1,15 +1,428 @@
-
-.PHONY : runcheck clean 
-runcheck: $(DIRECTORY)
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# tests/creddy_tests/Makefile.  Generated from Makefile.in by configure.
+
+# 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.
+
+
+
+#
+# creddy_tests
+#
+
+pkgdatadir = $(datadir)/abac
+pkgincludedir = $(includedir)/abac
+pkglibdir = $(libdir)/abac
+pkglibexecdir = $(libexecdir)/abac
+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 = i686-pc-linux-gnu
+host_triplet = i686-pc-linux-gnu
+subdir = tests/creddy_tests
+DIST_COMMON = README $(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 = ${SHELL} /home/mei/Deter/abac0-master/missing --run aclocal-1.11
+AMTAR = ${SHELL} /home/mei/Deter/abac0-master/missing --run tar
+AR = ar
+AUTOCONF = ${SHELL} /home/mei/Deter/abac0-master/missing --run autoconf
+AUTOHEADER = ${SHELL} /home/mei/Deter/abac0-master/missing --run autoheader
+AUTOMAKE = ${SHELL} /home/mei/Deter/abac0-master/missing --run automake-1.11
+AWK = gawk
+AX_SWIG_PYTHON_CPPFLAGS = -I/usr/local/include/python2.7
+AX_SWIG_PYTHON_OPT = -python
+CC = gcc
+CCDEPMODE = depmode=gcc3
+CFLAGS = -g -O2
+CPP = gcc -E
+CPPFLAGS = 
+CXX = g++
+CXXCPP = g++ -E
+CXXDEPMODE = depmode=gcc3
+CXXFLAGS = -g -O2
+CYGPATH_W = echo
+DEFS = -DPACKAGE_NAME=\"ABAC\" -DPACKAGE_TARNAME=\"abac\" -DPACKAGE_VERSION=\"0.1.5\" -DPACKAGE_STRING=\"ABAC\ 0.1.5\" -DPACKAGE_BUGREPORT=\"faber@ISI.EDU\" -DPACKAGE_URL=\"\" -DPACKAGE=\"abac\" -DVERSION=\"0.1.5\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_PYTHON=\"2.7\" -DHAVE_INTTYPES_H=1 -DHAVE_STDDEF_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_PATHS_H=1 -DHAVE__BOOL=1 -DHAVE_STDBOOL_H=1 -DHAVE_PTRDIFF_T=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_ATEXIT=1 -DHAVE_MEMSET=1 -DHAVE_STRCHR=1 -DHAVE_STRDUP=1
+DEPDIR = .deps
+DSYMUTIL = 
+DUMPBIN = 
+ECHO_C = 
+ECHO_N = -n
+ECHO_T = 
+EGREP = /bin/grep -E
+EXEEXT = 
+FGREP = /bin/grep -F
+GREP = /bin/grep
+INSTALL = /usr/bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+LD = /usr/bin/ld
+LDFLAGS = 
+LIBOBJS = 
+LIBS = 
+LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LIPO = 
+LN_S = ln -s
+LTLIBOBJS = 
+MAKEINFO = ${SHELL} /home/mei/Deter/abac0-master/missing --run makeinfo
+MKDIR_P = /bin/mkdir -p
+NM = /usr/bin/nm -B
+NMEDIT = 
+OBJDUMP = objdump
+OBJEXT = o
+OPENSSL_INCLUDES =  
+OPENSSL_LDFLAGS =  
+OPENSSL_LIBS = -lssl -lcrypto  
+OTOOL = 
+OTOOL64 = 
+PACKAGE = abac
+PACKAGE_BUGREPORT = faber@ISI.EDU
+PACKAGE_NAME = ABAC
+PACKAGE_STRING = ABAC 0.1.5
+PACKAGE_TARNAME = abac
+PACKAGE_URL = 
+PACKAGE_VERSION = 0.1.5
+PATH_SEPARATOR = :
+PERL = perl
+PKG_CONFIG = /usr/bin/pkg-config
+PYTHON = /usr/local/bin/python
+PYTHON_CPPFLAGS = -I/usr/local/include/python2.7
+PYTHON_EXEC_PREFIX = ${exec_prefix}
+PYTHON_EXTRA_LDFLAGS = -Xlinker -export-dynamic
+PYTHON_EXTRA_LIBS =  -lpthread -ldl  -lutil -lm
+PYTHON_LDFLAGS = -L/usr/local/lib/python2.7/config -lpython2.7
+PYTHON_PLATFORM = linux2
+PYTHON_PREFIX = ${prefix}
+PYTHON_SITE_PKG = /usr/local/lib/python2.7/site-packages
+PYTHON_VERSION = 2.7
+RANLIB = ranlib
+SED = /bin/sed
+SET_MAKE = 
+SHELL = /bin/bash
+SITE_PERL = /usr/local/lib/site_perl
+STRIP = strip
+SWIG = /usr/local/bin/swig -c++
+SWIG_LIB = /usr/local/share/swig/2.0.4
+VERSION = 0.1.5
+XML2_CONFIG = /usr/bin/xml2-config
+XML2_INCLUDES = -I/usr/include/libxml2
+XML2_LDFLAGS = -lxml2
+XML2_LIBS = -lxml2
+XMLSEC1_CONFIG = /usr/bin/xmlsec1-config
+XMLSEC1_INCLUDES = -D__XMLSEC_FUNCTION__=__FUNCTION__ -DXMLSEC_NO_GOST=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -I/usr/include/xmlsec1 -I/usr/include/libxml2 -DXMLSEC_OPENSSL_098=1 -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_CRYPTO=\"openssl\"
+XMLSEC1_LDFLAGS = -L/usr/lib -lxmlsec1-openssl -lxmlsec1 -lxslt -lxml2 -lssl -lcrypto
+XMLSEC1_LIBS = -L/usr/lib -lxmlsec1-openssl -lxmlsec1 -lxslt -lxml2 -lssl -lcrypto
+abs_builddir = /home/mei/Deter/abac0-master/tests/creddy_tests
+abs_srcdir = /home/mei/Deter/abac0-master/tests/creddy_tests
+abs_top_builddir = /home/mei/Deter/abac0-master
+abs_top_srcdir = /home/mei/Deter/abac0-master
+ac_ct_CC = gcc
+ac_ct_CXX = g++
+ac_ct_DUMPBIN = 
+am__include = include
+am__leading_dot = .
+am__quote = 
+am__tar = ${AMTAR} chof - "$$tardir"
+am__untar = ${AMTAR} xf -
+bindir = ${exec_prefix}/bin
+build = i686-pc-linux-gnu
+build_alias = 
+build_cpu = i686
+build_os = linux-gnu
+build_vendor = pc
+builddir = .
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+host = i686-pc-linux-gnu
+host_alias = 
+host_cpu = i686
+host_os = linux-gnu
+host_vendor = pc
+htmldir = ${docdir}
+includedir = ${prefix}/include
+infodir = ${datarootdir}/info
+install_sh = ${SHELL} /home/mei/Deter/abac0-master/install-sh
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+lt_ECHO = echo
+mandir = ${datarootdir}/man
+mkdir_p = /bin/mkdir -p
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+pkgpyexecdir = ${pyexecdir}/abac
+pkgpythondir = ${pythondir}/abac
+prefix = /usr/local
+program_transform_name = s,x,x,
+psdir = ${docdir}
+pyexecdir = ${exec_prefix}/lib/python2.7/site-packages
+pythondir = ${prefix}/lib/python2.7/site-packages
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+srcdir = .
+sysconfdir = ${prefix}/etc
+target_alias = 
+top_build_prefix = ../../
+top_builddir = ../..
+top_srcdir = ../..
+INCLUDES = -I$(abs_top_srcdir)/libabac
+LDADD = $(abs_top_builddir)/libabac/libabac.la
+CREDDY_ENV = CREDDY_LOCATION=$(abs_top_builddir)/creddy
+PROVER_ENV = PROVER_LOCATION=$(abs_top_builddir)/libabac
+TEST_ENV = TESTDIR=$(abs_top_builddir)/tests
+MY_ENV = env $(CREDDY_ENV) $(PROVER_ENV) $(TEST_ENV)
+SCRIPT = verify roles attribute keyid generate display attribute_rule 
+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/creddy_tests/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign tests/creddy_tests/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 clean-local 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 \
+	clean-local 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
+
+
+.PHONY: runcheck clean-local setup
+
+runcheck: setup.sh
+	@echo 'running libabac CREDDY testing...' | tee result
+	@make clean
+	@$(MY_ENV) ./setup.sh
+	@touch error
+	@for i in $(SCRIPT); do \
+	  echo "---running $$i script"  >> result; \
+	  $(MY_ENV) ./$$i.sh | tee -a result |grep BAD >> error; cd .; \
+	done
+	@if test -f error ; \
+	  then \
+	    (if test `cat error | wc -l ` -eq 0 ; \
+	      then echo "   PASSED"; \
+	      else (echo "   ERROR!!!"; cat error;) \
+	    fi) \
+	  else echo "   PASSED"; \
+	fi
 
 clean:
-	rm -rf *.xml *.pem *.out
-	rm -rf result
-
-runcheck: 
-	@echo 'running libabac CREDDY 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
+	@rm -rf *.xml *.pem error result
+
+clean-local:
+	@rm -rf *.xml *.pem error result
+
+# 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/creddy_tests/Makefile.am
===================================================================
--- tests/creddy_tests/Makefile.am	(revision 3c30b595cd3f27758e8966a9935589bdb92486d5)
+++ tests/creddy_tests/Makefile.am	(revision 3c30b595cd3f27758e8966a9935589bdb92486d5)
@@ -0,0 +1,40 @@
+#
+# creddy_tests
+#
+
+.PHONY: runcheck clean-local setup
+
+INCLUDES = -I$(abs_top_srcdir)/libabac
+LDADD = $(abs_top_builddir)/libabac/libabac.la
+CREDDY_ENV = CREDDY_LOCATION=$(abs_top_builddir)/creddy
+PROVER_ENV = PROVER_LOCATION=$(abs_top_builddir)/libabac
+TEST_ENV = TESTDIR=$(abs_top_builddir)/tests
+MY_ENV = env $(CREDDY_ENV) $(PROVER_ENV) $(TEST_ENV)
+
+SCRIPT=verify roles attribute keyid generate display attribute_rule 
+
+runcheck: setup.sh
+	@echo 'running libabac CREDDY testing...' | tee result
+	@make clean
+	@$(MY_ENV) ./setup.sh
+	@touch error
+	@for i in $(SCRIPT); do \
+	  echo "---running $$i script"  >> result; \
+	  $(MY_ENV) ./$$i.sh | tee -a result |grep BAD >> error; cd .; \
+	done
+	@if test -f error ; \
+	  then \
+	    (if test `cat error | wc -l ` -eq 0 ; \
+	      then echo "   PASSED"; \
+	      else (echo "   ERROR!!!"; cat error;) \
+	    fi) \
+	  else echo "   PASSED"; \
+	fi
+
+clean:
+	@rm -rf *.xml *.pem error result
+
+clean-local:
+	@rm -rf *.xml *.pem error result
+
+
Index: tests/creddy_tests/ProtoGENI.xml_save
===================================================================
--- tests/creddy_tests/ProtoGENI.xml_save	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ 	(revision )
@@ -1,125 +1,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<signed-credential xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.protogeni.net/resources/credential/credential.xsd" xsi:schemaLocation="http://www.protogeni.net/resources/credential/ext/policy/1 http://www.protogeni.net/resources/credential/ext/policy/1/policy.xsd">
-  <credential xml:id="refCB16DEE0B6F8507C">
- <type>privilege</type>
- <serial>15102</serial>
- <owner_gid>MIIEQTCCA6qgAwIBAgICBAcwDQYJKoZIhvcNAQEEBQAwgeMxCzAJBgNVBAYTAlVT
-MQ0wCwYDVQQIEwRVdGFoMRswGQYDVQQHExJTYWx0IExha2UgU2ltIENpdHkxITAf
-BgNVBAoTGFV0YWggTmV0d29yayBTZWNvbmQgTGlmZTEeMBwGA1UECxMVQ2VydGlm
-aWNhdGUgQXV0aG9yaXR5MSkwJwYDVQQDEyBteWJvc3Muam9ubGFiLnRlc3RiZWQu
-ZW11bGFiLm5ldDE6MDgGCSqGSIb3DQEJARYrdGVzdGJlZC1v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vK/5i1PtolKqUg5MCAwEAAaOB4zCB4DAdBgNVHQ4EFgQUbXWxdwVR
-Ouopn6qnsRp9jaY9nBYwQgYDVR0RBDswOYY3dXJuOnB1YmxpY2lkOklETitqb25s
-YWIudGVzdGJlZC5lbXVsYWIubmV0K2F1dGhvcml0eStzYTAPBgNVHRMBAf8EBTAD
-AQH/MGoGCCsGAQUFBwEBBF4wXDBaBhRpg8yTgKiYzKjHvbGngICqrteKG4ZCaHR0
-cHM6Ly9teWJvc3Muam9ubGFiLnRlc3RiZWQuZW11bGFiLm5ldDoxMjM2OS9wcm90
-b2dlbmkveG1scnBjL3NhMA0GCSqGSIb3DQEBBAUAA4GBAHUtR537wn94Em+BJUS4
-lb6qQ/mDG49l1K12XJghyKU40pQCxRKlp4EWScghgtwcpBTaCcA3+ZOgkdwnHXLx
-pCabA69clBKdncqaaUzSCx4AGjGe9yMX6WliBvvh2dODQZeFlK7C9B7mTvkTFv4Z
-iMdQbxu/Fh8LdtU+ymuXekid
-</target_gid>
- <target_urn>urn:publicid:IDN+jonlab.testbed.emulab.net+authority+sa</target_urn>
- <uuid>9bc8ec4e-c869-11e2-b001-0024e87927eb</uuid>
- <expires>2013-05-30T14:11:08Z</expires>
-  <privileges>
-<privilege><name>*</name><can_delegate>1</can_delegate></privilege>
-</privileges></credential>
-  <signatures>
-    <Signature xmlns="http://www.w3.org/2000/09/xmldsig#" xml:id="Sig_refCB16DEE0B6F8507C">
- <SignedInfo>
-  <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
-  <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
-  <Reference URI="#refCB16DEE0B6F8507C">
-    <Transforms>
-      <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
-    </Transforms>
-    <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
-    <DigestValue>9/uW8NR0sHZpLAPzxZ32SOLAZhY=</DigestValue>
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nnt/siD8ULqXwYMwHHDhr+wQnqgjiPoo0FT69lbfiQ3
-P1IH6TVn8j5vK/5i1PtolKqUg5MCAwEAAaOB4zCB4DAdBgNVHQ4EFgQUbXWxdwVR
-Ouopn6qnsRp9jaY9nBYwQgYDVR0RBDswOYY3dXJuOnB1YmxpY2lkOklETitqb25s
-YWIudGVzdGJlZC5lbXVsYWIubmV0K2F1dGhvcml0eStzYTAPBgNVHRMBAf8EBTAD
-AQH/MGoGCCsGAQUFBwEBBF4wXDBaBhRpg8yTgKiYzKjHvbGngICqrteKG4ZCaHR0
-cHM6Ly9teWJvc3Muam9ubGFiLnRlc3RiZWQuZW11bGFiLm5ldDoxMjM2OS9wcm90
-b2dlbmkveG1scnBjL3NhMA0GCSqGSIb3DQEBBAUAA4GBAHUtR537wn94Em+BJUS4
-lb6qQ/mDG49l1K12XJghyKU40pQCxRKlp4EWScghgtwcpBTaCcA3+ZOgkdwnHXLx
-pCabA69clBKdncqaaUzSCx4AGjGe9yMX6WliBvvh2dODQZeFlK7C9B7mTvkTFv4Z
-iMdQbxu/Fh8LdtU+ymuXekid</X509Certificate>
-<X509SubjectName>emailAddress=testbed-ops@myops.jonlab.testbed.emulab.net,CN=e1a2133d-ab67-11e2-b001-0024e87927eb,OU=jonlab.sa,O=Utah Network Second Life,ST=Utah,C=US</X509SubjectName>
-<X509IssuerSerial>
-<X509IssuerName>emailAddress=testbed-ops@myops.jonlab.testbed.emulab.net,CN=myboss.jonlab.testbed.emulab.net,OU=Certificate Authority,O=Utah Network Second Life,L=Salt Lake Sim City,ST=Utah,C=US</X509IssuerName>
-<X509SerialNumber>1016</X509SerialNumber>
-</X509IssuerSerial>
-</X509Data>
-  <KeyValue>
-<RSAKeyValue>
-<Modulus>
-zYZo6Dq9Yo+LZ/AhM2f6r/jkO/tJow5h6A4F4kqZfHIS1lyN/zICra47qjHpgrBC
-3npR5+ibr4AosC4mwDo09yFHbS0CUSIGuemt7Nnt/siD8ULqXwYMwHHDhr+wQnqg
-jiPoo0FT69lbfiQ3P1IH6TVn8j5vK/5i1PtolKqUg5M=
-</Modulus>
-<Exponent>
-AQAB
-</Exponent>
-</RSAKeyValue>
-</KeyValue>
- </KeyInfo>
-</Signature>
-  </signatures>
-</signed-credential>
-
Index: tests/creddy_tests/attribute.ck
===================================================================
--- tests/creddy_tests/attribute.ck	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ 	(revision )
@@ -1,16 +1,0 @@
-#!/bin/sh
-
-# attribute.ck
-
-result=`diff attribute.out attribute.save 2>/dev/null`
-
-if [ "$result" = "" ]; then
-    return 0
-else
-    return 1
-fi
-
-
-# ignore
-#
-
Index: tests/creddy_tests/attribute.save
===================================================================
--- tests/creddy_tests/attribute.save	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ 	(revision )
@@ -1,14 +1,0 @@
----running attribute 
-Usage: creddy --attribute \
-                --issuer <cert> --key <key> --role <role> \
-                [ --subject-cert <cert> | --subject-id <sha1> \
-                    [ --subject-role <role> ]  ... ] \
-                [ --validity <time> ] --out <file>
-    default validity: 365 days
-    provide exactly one of --subject-cert / --subject-id
-    give multiple --subject-{cert,id} / --subject-role pairs for intersection
-
-    time is specified with optional suffix: s m h d y
-    defaults to days if unspecified
-wrong private key for the cert!!
-creddy: Can't load private key from Coyote_private.pem
Index: tests/creddy_tests/attribute.sh
===================================================================
--- tests/creddy_tests/attribute.sh	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ tests/creddy_tests/attribute.sh	(revision 3c30b595cd3f27758e8966a9935589bdb92486d5)
@@ -1,30 +1,33 @@
 #!/bin/sh
+#attribute.sh
 
-pwd=`pwd`
-eloc=`which creddy | sed 's/\/creddy//'`
-if [ "$eloc" = "" ]; then
-  echo "ERROR: creddy is not in the search path!!!"
-  exit 1
-fi
+. ${TESTDIR}/test_util.sh
 
-$eloc/creddy --attribute \
+runTest "creddy_tests/attribute.sh" "test1"  \
+"$eloc/creddy --attribute \
        --issuer Acme_ID.pem --key Acme_private.pem --role roleOne \
        --subject-cert Acme_ID.pem --subject-role simple_subject_role \
-       --out Acme_roleOne__Acme_simple_subject_role_attr.xml
+       --out Acme_roleOne__Acme_simple_subject_role_attr.xml" \
+0  "simple role attribute creation with same issuer"
 
-$eloc/creddy --attribute \
+runTest "creddy_tests/attribute.sh" "test2"  \
+"$eloc/creddy --attribute \
        --issuer Acme_ID.pem --role roleTwo \
        --subject-cert Acme_ID.pem --subject-role simple_subject_role \
-       --out Acme_roleTwo__Acme_simple_subject_role_attr.xml
+       --out Acme_roleTwo__Acme_simple_subject_role_attr.xml" \
+1  "simple role attribute creation without privkey key"
 
-$eloc/creddy --attribute \
+runTest "creddy_tests/attribute.sh" "test3"  \
+"$eloc/creddy --attribute \
        --issuer Acme_ID.pem --key Acme_private.pem --role roleThree \
        --subject-cert Coyote_ID.pem --subject-role simple_subject_role \
-       --out Acme_roleThree__Coyote_simple_subject_role_attr.xml
+       --out Acme_roleThree__Coyote_simple_subject_role_attr.xml" \
+0  "simple role attribute creation with differ issuer certs"
 
-$eloc/creddy --attribute \
+runTest "creddy_tests/attribute.sh" "test4"  \
+"$eloc/creddy --attribute \
        --issuer Acme_ID.pem --key Coyote_private.pem --role roleFour \
        --subject-cert Coyote_ID.pem --subject-role simple_subject_role \
-       --out Acme_roleFour__Coyote_simple_subject_role_attr.xml
+       --out Acme_roleFour__Coyote_simple_subject_role_attr.xml" \
+1  "simple role attribute creation with wrong privkey key"
 
-
Index: tests/creddy_tests/attribute_rule.ck
===================================================================
--- tests/creddy_tests/attribute_rule.ck	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ 	(revision )
@@ -1,21 +1,0 @@
-#!/bin/sh
-
-# attribute_rule.ck
-
-result=`diff -I "sneaky_friend" attribute_rule.out attribute_rule.save 2>/dev/null`
-
-if [ "$result" = "" ]; then
-    return 0
-else
-    return 1
-fi
-
-
-# ignore
-
-#
-#2c2
-#< 42d367c6c599ac9d505cafa9abe92fd00d587db5.sneaky_friend<-a1dca2221c256393553edb5369980b4c04768dc0
-#---
-#> 0331e8fb4e0b4a58fcda5b938eaeab6a0663d7d3.sneaky_friend<-7ab52740e981d1c98589bed128e94fbefffa181a
-#
Index: tests/creddy_tests/attribute_rule.save
===================================================================
--- tests/creddy_tests/attribute_rule.save	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ 	(revision )
@@ -1,2 +1,0 @@
----running attribute_rule 
-0331e8fb4e0b4a58fcda5b938eaeab6a0663d7d3.sneaky_friend<-7ab52740e981d1c98589bed128e94fbefffa181a
Index: tests/creddy_tests/attribute_rule.sh
===================================================================
--- tests/creddy_tests/attribute_rule.sh	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ tests/creddy_tests/attribute_rule.sh	(revision 3c30b595cd3f27758e8966a9935589bdb92486d5)
@@ -1,26 +1,21 @@
 #!/bin/sh
-
 #attribute_rule.sh
 
-pwd=`pwd`
-eloc=`which creddy | sed 's/\/creddy//'`
-if [ "$eloc" = "" ]; then
-  echo "ERROR: creddy is not in the search path!!!"
-  exit 1
-fi
+. ${TESTDIR}/test_util.sh
 
-$eloc/creddy --generate --cn Bigbird 1>/dev/null 2>& 1
-$eloc/creddy --generate --cn Coyote 1>/dev/null 2>& 1
-
-bigbird=`creddy --keyid --cert Bigbird_ID.pem`
-coyote=`creddy --keyid --cert Coyote_ID.pem`
+bigbird=`$eloc/creddy --keyid --cert Bigbird_ID.pem`
+coyote=`$eloc/creddy --keyid --cert Coyote_ID.pem`
 
 rule="$coyote.sneaky_friend<-$bigbird"
 
-$eloc/creddy --attribute \
+runTest "creddy_tests/attribute_rule.sh" "test1"  \
+"$eloc/creddy --attribute \
        --issuer Coyote_ID.pem --key Coyote_private.pem \
        --attrrule "$rule" \
-       --out Coyote_sneakyFriend__Bigbird_attr.xml
+       --out Coyote_sneakyFriend__Bigbird_attr.xml"  \
+0  "trying making attribute using attrrule option"
 
-$eloc/creddy --roles --cert Coyote_sneakyFriend__Bigbird_attr.xml
+runTest "creddy_tests/attribute_rule.sh" "test2"  \
+"$eloc/creddy --roles --cert Coyote_sneakyFriend__Bigbird_attr.xml"  \
+0  "double check on the attribute made with atttrrule option"
 
Index: tests/creddy_tests/display.ck
===================================================================
--- tests/creddy_tests/display.ck	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ 	(revision )
@@ -1,14 +1,0 @@
-#!/bin/sh
-
-# display.ck
-
-result=`diff -I "UTC" -I "GMT" display.out display.save 2>/dev/null |wc -l`
-
-if [ $result -eq 22 ]; then
-    return 0
-else
-    return 1
-fi
-
-## ignore timestamp difference being flagged between UTC and GMT
-
Index: tests/creddy_tests/display.save
===================================================================
--- tests/creddy_tests/display.save	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ 	(revision )
@@ -1,73 +1,0 @@
----running display 
-Issuer: /CN=Acme
-Subject: /CN=Acme
-Validity:
-    Not before: 2013-06-05 17:43:03 PST [1370482983]
-    Not after:  2016-05-20 17:43:03 PST [1463794983]
-creddy: Couldn't load Acme_private.pem as an ID or attribute
-Issuer: /CN=Acme
-Subject: /CN=Acme
-Validity:
-    Not before: 2013-06-05 17:43:13 GMT [1370482993]
-    Not after:  2014-06-05 17:43:05 GMT [1402018985]
-Roles: 30371212e9d3d12cf599d221f11bf3450086ef74.buy_rockets<-30371212e9d3d12cf599d221f11bf3450086ef74.preferred_customer
-Issuer: /CN=Acme
-Subject: /CN=Acme
-Validity:
-    Not before: 2013-06-05 17:43:13 GMT [1370482993]
-    Not after:  2014-06-05 17:43:05 GMT [1402018985]
-Roles: 30371212e9d3d12cf599d221f11bf3450086ef74.preferred_customer<-f8fb28f96aa2e5cc0cf60ffbb34a6fd6887f6c29
-creddy: Couldn't load bad_attr.xml as an ID or attribute
-Issuer: /C=US/ST=California/L=Marina del Rey/O=DETER Network Security Testbed/OU=Certificate Authority/CN=boss.isi.deterlab.net/emailAddress=testbed-ops@isi.deterlab.net
-Subject: /C=US/ST=California/O=DETER Network Security Testbed/OU=sslxmlrpc/CN=70f4db5c-c7f5-11dc-a204-000423c28e76/emailAddress=faber@isi.deterlab.net
-Validity:
-    Not before: 2010-11-05 22:35:12 PST [1289025312]
-    Not after:  2013-08-01 22:35:12 PST [1375425312]
-Issuer: /C=US/ST=California/L=Marina del Rey/O=DETER Network Security Testbed/OU=Certificate Authority/CN=boss.isi.deterlab.net/emailAddress=testbed-ops@isi.deterlab.net
-Subject: /C=US/ST=California/O=DETER Network Security Testbed/OU=sslxmlrpc/CN=70f4db5c-c7f5-11dc-a204-000423c28e76/emailAddress=faber@isi.deterlab.net
-Validity:
-    Not before: 2013-06-05 17:43:13 GMT [1370482993]
-    Not after:  2014-05-20 17:39:55 GMT [1400636395]
-Roles: 0a778934b93d546406d195d18e4f208af11ea84a.test_attr<-633aadf1753647ba60f28b7310f5a56cd32ab7e2
-creddy: Couldn't load ProtoGENI.xml as an ID or attribute
-Issuer: /C=US/ST=Utah/L=Salt Lake Sim City/O=Utah Network Second Life/OU=Certificate Authority/CN=myboss.jonlab.testbed.emulab.net/emailAddress=testbed-ops@myops.jonlab.testbed.emulab.net
-Subject: /C=US/ST=Utah/O=Utah Network Second Life/OU=jonlab.sa/CN=e1a2133d-ab67-11e2-b001-0024e87927eb/emailAddress=testbed-ops@myops.jonlab.testbed.emulab.net
-Validity:
-    Not before: 2013-04-22 15:15:43 PST [1366672543]
-    Not after:  2018-10-13 16:15:43 PST [1539476143]
-Issuer: /CN=issuer
-Subject: /CN=issuer
-Validity:
-    Not before: 2013-06-05 17:43:14 GMT [1370482994]
-    Not after:  2015-07-14 19:52:08 GMT [1436932328]
-Roles: 378a1922494c157372be987d9b8657633119d9e0.speaks_for_f75358f7f87f3fe641121ad37fd5c3163b0896ff <- f75358f7f87f3fe641121ad37fd5c3163b0896ff.speaks_for_f75358f7f87f3fe641121ad37fd5c3163b0896ff
-Issuer: /CN=issuer
-Subject: /CN=issuer
-Validity:
-    Not before: 2013-06-05 17:43:14 GMT [1370482994]
-    Not after:  2015-07-14 19:52:08 GMT [1436932328]
-Roles: 378a1922494c157372be987d9b8657633119d9e0.speaks_for_f75358f7f87f3fe641121ad37fd5c3163b0896ff <- f75358f7f87f3fe641121ad37fd5c3163b0896ff
-Issuer: /CN=issuer
-Subject: /CN=issuer
-Validity:
-    Not before: 2013-06-05 17:43:14 GMT [1370482994]
-    Not after:  2015-07-14 19:52:08 GMT [1436932328]
-Roles: 378a1922494c157372be987d9b8657633119d9e0.refresh_633aadf1753647ba60f28b7310f5a56cd32ab7e2 <- 378a1922494c157372be987d9b8657633119d9e0.speaks_for_f75358f7f87f3fe641121ad37fd5c3163b0896ff
-Issuer: /CN=issuer
-Subject: /CN=issuer
-Validity:
-    Not before: 2013-06-05 17:43:14 GMT [1370482994]
-    Not after:  2015-07-14 19:52:08 GMT [1436932328]
-Roles: 378a1922494c157372be987d9b8657633119d9e0.test2_633aadf1753647ba60f28b7310f5a56cd32ab7e2 <- 378a1922494c157372be987d9b8657633119d9e0.speaks_for_f75358f7f87f3fe641121ad37fd5c3163b0896ff
-Issuer: /CN=issuer
-Subject: /CN=issuer
-Validity:
-    Not before: 2013-06-05 17:43:14 GMT [1370482994]
-    Not after:  2015-07-14 19:52:08 GMT [1436932328]
-Roles: 378a1922494c157372be987d9b8657633119d9e0.test2_633aadf1753647ba60f28b7310f5a56cd32ab7e2 <- 378a1922494c157372be987d9b8657633119d9e0.can_delegate_test2_633aadf1753647ba60f28b7310f5a56cd32ab7e2.test2_633aadf1753647ba60f28b7310f5a56cd32ab7e2
-Issuer: /CN=issuer
-Subject: /CN=issuer
-Validity:
-    Not before: 2013-06-05 17:43:14 GMT [1370482994]
-    Not after:  2015-07-14 19:52:08 GMT [1436932328]
-Roles: 378a1922494c157372be987d9b8657633119d9e0.can_delegate_test2_633aadf1753647ba60f28b7310f5a56cd32ab7e2 <- f75358f7f87f3fe641121ad37fd5c3163b0896ff
Index: tests/creddy_tests/display.sh
===================================================================
--- tests/creddy_tests/display.sh	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ tests/creddy_tests/display.sh	(revision 3c30b595cd3f27758e8966a9935589bdb92486d5)
@@ -1,21 +1,50 @@
 #!/bin/sh
+#display.sh
 
-pwd=`pwd`
-eloc=`which creddy | sed 's/\/creddy//'`
-if [ "$eloc" = "" ]; then
-  echo "ERROR: creddy is not in the search path!!!"
-  exit 1
-fi
+. ${TESTDIR}/test_util.sh
 
-$eloc/creddy --display --show=all --cert Acme_ID.pem
-$eloc/creddy --display --show=all --cert Acme_private.pem
-$eloc/creddy --display --show=all --cert Acme_buy_rockets__Acme_preferred_customer_attr.xml
-$eloc/creddy --display --show=all --cert Acme_preferred_customer__Coyote_attr.xml
-$eloc/creddy --display --show=all --cert bad_attr.xml
+runTest "creddy_tests/display.sh" "test1"  \
+"$eloc/creddy --display --show=all --cert Acme_ID.pem" \
+0  "display an issuer cert"
 
-$eloc/creddy --display --show=all --cert not_ss.pem
-$eloc/creddy --display --show=all --cert not_ss.xml
+runTest "creddy_tests/display.sh" "test2"  \
+"$eloc/creddy --display --show=all --cert Acme_private.pem" \
+1  "display a privkey file"
 
-$eloc/creddy --display --show=all --cert ProtoGENI.xml
-$eloc/creddy --display --show=all --cert PGissuer.pem
-$eloc/creddy --display --show=all --cert priv.xml
+runTest "creddy_tests/display.sh" "test3"  \
+"$eloc/creddy --display --show=all --cert Acme_buy_rockets__Acme_preferred_customer_attr.xml" \
+0  "display an attribute cert"
+
+runTest "creddy_tests/display.sh" "test4"  \
+"$eloc/creddy --display --show=all --cert Acme_preferred_customer__Coyote_attr.xml" \
+0  "display an attribute cert"
+
+runTest "creddy_tests/display.sh" "test5"  \
+"$eloc/creddy --display --show=all --cert bad_attr.xml" \
+1  "supplied a none existing attribute cert"
+
+runTest "creddy_tests/display.sh" "test6"  \
+"$eloc/creddy --display --show=all --cert not_ss.pem" \
+0  "display an none self signed issuer cert"
+
+runTest "creddy_tests/display.sh" "test7"  \
+"$eloc/creddy --display --show=all --cert not_ss.xml" \
+0  "display a none self signed attribute cert"
+
+runTest "creddy_tests/display.sh" "test8"  \
+"$eloc/creddy --display --show=all --cert iProtoGENI.xml" \
+1  "display an expired GENI signed attribute cert"
+
+runTest "creddy_tests/display.sh" "test9"  \
+"$eloc/creddy --display --show=all --cert ProtoGENI.xml" \
+0  "FAKE:display a valid GENI signed attribute cert"
+
+runTest "creddy_tests/display.sh" "test10"  \
+"$eloc/creddy --display --show=all --cert PGissuer.pem" \
+0  "display a GENI issuer cert"
+
+runTest "creddy_tests/display.sh" "test11"  \
+"$eloc/creddy --display --show=all --cert priv.xml" \
+0  "display a GENI privilege attribute cert"
+
+
Index: tests/creddy_tests/generate.ck
===================================================================
--- tests/creddy_tests/generate.ck	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ 	(revision )
@@ -1,17 +1,0 @@
-#!/bin/sh
-
-# generate.ck
-
-result=`diff -I "buy_rockets" generate.out generate.save 2>/dev/null`
-list=`ls -l *ID.pem |wc -l`
-
-if [ "$result" = "" -a $list -eq 6 ]; then
-    return 0
-else
-    return 1
-fi
-
-
-# ignore
-#
-
Index: tests/creddy_tests/generate.sh
===================================================================
--- tests/creddy_tests/generate.sh	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ tests/creddy_tests/generate.sh	(revision 3c30b595cd3f27758e8966a9935589bdb92486d5)
@@ -1,14 +1,21 @@
 #!/bin/sh
+#generate.sh
 
-pwd=`pwd`
-eloc=`which creddy | sed 's/\/creddy//'`
-if [ "$eloc" = "" ]; then
-  echo "ERROR: creddy is not in the search path!!!"
-  exit 1
-fi
+. ${TESTDIR}/test_util.sh
 
-$eloc/creddy --generate --cn Bigbird
-$eloc/creddy --generate --cn 12_3
-## looks like optarg just picked up the 'Bad' part
-$eloc/creddy --generate --cn Bad$name
-$eloc/creddy --generate --cn abc --cert bad_attr.xml
+runTest "creddy_tests/generate.sh" "test1", \
+"$eloc/creddy --generate --cn Bigbird"  \
+0  "simple id credential generation"
+
+runTest "creddy_tests/generate.sh" "test2", \
+"$eloc/creddy --generate --cn 12_3"  \
+0  "generate with underline in name"
+
+runTest "creddy_tests/generate.sh" "test3", \
+"$eloc/creddy --generate --cn Bad$name"  \
+0  "generate with special $ as Bad$name, later part just got dropped"
+
+runTest "creddy_tests/generate.sh" "test4", \
+"$eloc/creddy --generate --cn abc --cert gen_attr.xml"  \
+0  "generate with supplied attribute name"
+
Index: tests/creddy_tests/iProtoGENI.xml_save
===================================================================
--- tests/creddy_tests/iProtoGENI.xml_save	(revision 3c30b595cd3f27758e8966a9935589bdb92486d5)
+++ tests/creddy_tests/iProtoGENI.xml_save	(revision 3c30b595cd3f27758e8966a9935589bdb92486d5)
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<signed-credential xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.protogeni.net/resources/credential/credential.xsd" xsi:schemaLocation="http://www.protogeni.net/resources/credential/ext/policy/1 http://www.protogeni.net/resources/credential/ext/policy/1/policy.xsd">
+  <credential xml:id="refCB16DEE0B6F8507C">
+ <type>privilege</type>
+ <serial>15102</serial>
+ <owner_gid>MIIEQTCCA6qgAwIBAgICBAcwDQYJKoZIhvcNAQEEBQAwgeMxCzAJBgNVBAYTAlVT
+MQ0wCwYDVQQIEwRVdGFoMRswGQYDVQQHExJTYWx0IExha2UgU2ltIENpdHkxITAf
+BgNVBAoTGFV0YWggTmV0d29yayBTZWNvbmQgTGlmZTEeMBwGA1UECxMVQ2VydGlm
+aWNhdGUgQXV0aG9yaXR5MSkwJwYDVQQDEyBteWJvc3Muam9ubGFiLnRlc3RiZWQu
+ZW11bGFiLm5ldDE6MDgGCSqGSIb3DQEJARYrdGVzdGJlZC1vcHNAbXlvcHMuam9u
+bGFiLnRlc3RiZWQuZW11bGFiLm5ldDAeFw0xMzA1MjkxMzU5MDFaFw0xNDA1Mjkx
+MzU5MDFaMIGzMQswCQYDVQQGEwJVUzENMAs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
+YWIudGVzdGJlZC5lbXVsYWIubmV0K2F1dGhvcml0eStzYTAPBgNVHRMBAf8EBTAD
+AQH/MGoGCCsGAQUFBwEBBF4wXDBaBhRpg8yTgKiYzKjHvbGngICqrteKG4ZCaHR0
+cHM6Ly9teWJvc3Muam9ubGFiLnRlc3RiZWQuZW11bGFiLm5ldDoxMjM2OS9wcm90
+b2dlbmkveG1scnBjL3NhMA0GCSqGSIb3DQEBBAUAA4GBAHUtR537wn94Em+BJUS4
+lb6qQ/mDG49l1K12XJghyKU40pQCxRKlp4EWScghgtwcpBTaCcA3+ZOgkdwnHXLx
+pCabA69clBKdncqaaUzSCx4AGjGe9yMX6WliBvvh2dODQZeFlK7C9B7mTvkTFv4Z
+iMdQbxu/Fh8LdtU+ymuXekid
+</target_gid>
+ <target_urn>urn:publicid:IDN+jonlab.testbed.emulab.net+authority+sa</target_urn>
+ <uuid>9bc8ec4e-c869-11e2-b001-0024e87927eb</uuid>
+ <expires>2013-05-30T14:11:08Z</expires>
+  <privileges>
+<privilege><name>*</name><can_delegate>1</can_delegate></privilege>
+</privileges></credential>
+  <signatures>
+    <Signature xmlns="http://www.w3.org/2000/09/xmldsig#" xml:id="Sig_refCB16DEE0B6F8507C">
+ <SignedInfo>
+  <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
+  <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
+  <Reference URI="#refCB16DEE0B6F8507C">
+    <Transforms>
+      <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
+    </Transforms>
+    <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+    <DigestValue>9/uW8NR0sHZpLAPzxZ32SOLAZhY=</DigestValue>
+    </Reference>
+ </SignedInfo>
+ <SignatureValue>UfAUZ5RyncNw+YWJOAbmfnOYbpWxeyVLDZ9Kg7yw4idRUE0/CnL0bNkUAT5g2IYF
+W/kKxooWz/1P15/E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R
+Ouopn6qnsRp9jaY9nBYwQgYDVR0RBDswOYY3dXJuOnB1YmxpY2lkOklETitqb25s
+YWIudGVzdGJlZC5lbXVsYWIubmV0K2F1dGhvcml0eStzYTAPBgNVHRMBAf8EBTAD
+AQH/MGoGCCsGAQUFBwEBBF4wXDBaBhRpg8yTgKiYzKjHvbGngICqrteKG4ZCaHR0
+cHM6Ly9teWJvc3Muam9ubGFiLnRlc3RiZWQuZW11bGFiLm5ldDoxMjM2OS9wcm90
+b2dlbmkveG1scnBjL3NhMA0GCSqGSIb3DQEBBAUAA4GBAHUtR537wn94Em+BJUS4
+lb6qQ/mDG49l1K12XJghyKU40pQCxRKlp4EWScghgtwcpBTaCcA3+ZOgkdwnHXLx
+pCabA69clBKdncqaaUzSCx4AGjGe9yMX6WliBvvh2dODQZeFlK7C9B7mTvkTFv4Z
+iMdQbxu/Fh8LdtU+ymuXekid</X509Certificate>
+<X509SubjectName>emailAddress=testbed-ops@myops.jonlab.testbed.emulab.net,CN=e1a2133d-ab67-11e2-b001-0024e87927eb,OU=jonlab.sa,O=Utah Network Second Life,ST=Utah,C=US</X509SubjectName>
+<X509IssuerSerial>
+<X509IssuerName>emailAddress=testbed-ops@myops.jonlab.testbed.emulab.net,CN=myboss.jonlab.testbed.emulab.net,OU=Certificate Authority,O=Utah Network Second Life,L=Salt Lake Sim City,ST=Utah,C=US</X509IssuerName>
+<X509SerialNumber>1016</X509SerialNumber>
+</X509IssuerSerial>
+</X509Data>
+  <KeyValue>
+<RSAKeyValue>
+<Modulus>
+zYZo6Dq9Yo+LZ/AhM2f6r/jkO/tJow5h6A4F4kqZfHIS1lyN/zICra47qjHpgrBC
+3npR5+ibr4AosC4mwDo09yFHbS0CUSIGuemt7Nnt/siD8ULqXwYMwHHDhr+wQnqg
+jiPoo0FT69lbfiQ3P1IH6TVn8j5vK/5i1PtolKqUg5M=
+</Modulus>
+<Exponent>
+AQAB
+</Exponent>
+</RSAKeyValue>
+</KeyValue>
+ </KeyInfo>
+</Signature>
+  </signatures>
+</signed-credential>
+
Index: tests/creddy_tests/keyid.ck
===================================================================
--- tests/creddy_tests/keyid.ck	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ 	(revision )
@@ -1,13 +1,0 @@
-#!/bin/sh
-
-# keyid.ck
-
-q=`diff -q keyid.out keyid.save 2>/dev/null |grep -c differ`
-result=`diff keyid.out keyid.save 2>/dev/null |wc -l`
-
-if [ $q -eq 1 -a $result -eq 4 ]; then
-    return 0
-else
-    return 1
-fi
-
Index: tests/creddy_tests/keyid.save
===================================================================
--- tests/creddy_tests/keyid.save	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ 	(revision )
@@ -1,10 +1,0 @@
----running keyid 
-cfa52808c42825751443522edd790b05e4937049
-creddy: Couldn't load ID cert from Acme_private.pem
-creddy: Couldn't load ID cert from Acme_buy_rockets__Acme_preferred_customer_attr.xml
-creddy: Couldn't load ID cert from bad_attr.xml
-0a778934b93d546406d195d18e4f208af11ea84a
-creddy: Couldn't load ID cert from not_ss.xml
-creddy: Couldn't load ID cert from priv.xml
-6d75b17705513aea299faaa7b11a7d8da63d9c16
-creddy: Couldn't load ID cert from ProtoGENI.xml
Index: tests/creddy_tests/keyid.sh
===================================================================
--- tests/creddy_tests/keyid.sh	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ tests/creddy_tests/keyid.sh	(revision 3c30b595cd3f27758e8966a9935589bdb92486d5)
@@ -1,20 +1,41 @@
 #!/bin/sh
+# keyid.sh
 
-pwd=`pwd`
-eloc=`which creddy | sed 's/\/creddy//'`
-if [ "$eloc" = "" ]; then
-  echo "ERROR: creddy is not in the search path!!!"
-  exit 1
-fi
+. ${TESTDIR}/test_util.sh
 
-$eloc/creddy --keyid --cert Acme_ID.pem
-$eloc/creddy --keyid --cert Acme_private.pem
-$eloc/creddy --keyid --cert Acme_buy_rockets__Acme_preferred_customer_attr.xml
-$eloc/creddy --keyid --cert bad_attr.xml
+runTest "creddy_tests/keyid.sh" "test1"  \
+"$eloc/creddy --keyid --cert Acme_ID.pem" \
+0  "supplied with good identity cert"
 
-$eloc/creddy --keyid --cert not_ss.pem
-$eloc/creddy --keyid --cert not_ss.xml
-$eloc/creddy --keyid --cert priv.xml
-$eloc/creddy --keyid --cert PGissuer.pem
-$eloc/creddy --keyid --cert ProtoGENI.xml
+runTest "creddy_tests/keyid.sh" "test2"  \
+"$eloc/creddy --keyid --cert Acme_private.pem" \
+1  "supplied with privkey"
 
+runTest "creddy_tests/keyid.sh" "test3"  \
+"$eloc/creddy --keyid --cert Acme_buy_rockets__Acme_preferred_customer_attr.xml" \
+1  "supplied with attribute cert instead"
+
+runTest "creddy_tests/keyid.sh" "test4"  \
+"$eloc/creddy --keyid --cert bad_attr.xml" \
+1  "supplied with non existing attribute cert"
+
+runTest "creddy_tests/keyid.sh" "test5"  \
+"$eloc/creddy --keyid --cert not_ss.pem" \
+0  "supplied with good none self signed identity cert"
+
+runTest "creddy_tests/keyid.sh" "test6"  \
+"$eloc/creddy --keyid --cert not_ss.xml" \
+1  "supplied with none self signed attribute cert"
+
+runTest "creddy_tests/keyid.sh" "test7"  \
+"$eloc/creddy --keyid --cert priv.xml" \
+1  "supplied with GENI privilege attribute cert"
+
+runTest "creddy_tests/keyid.sh" "test8"  \
+"$eloc/creddy --keyid --cert PGissuer.pem" \
+0  "supplied with GENI issuer cert"
+
+runTest "creddy_tests/keyid.sh" "test9"  \
+"$eloc/creddy --keyid --cert ProtoGENI.xml" \
+1  "supplied with GENI issued attribute cert"
+
Index: tests/creddy_tests/result.save
===================================================================
--- tests/creddy_tests/result.save	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ 	(revision )
@@ -1,7 +1,0 @@
-   creddy_tests, verify PASSED
-   creddy_tests, roles PASSED
-   creddy_tests, attribute PASSED
-   creddy_tests, keyid PASSED
-   creddy_tests, generate PASSED
-   creddy_tests, display PASSED
-   creddy_tests, attribute_rule PASSED
Index: tests/creddy_tests/roles.ck
===================================================================
--- tests/creddy_tests/roles.ck	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ 	(revision )
@@ -1,12 +1,0 @@
-#!/bin/sh
-
-# roles.ck
-
-result=`diff -I "buy_rockets" roles.out roles.save 2>/dev/null`
-
-if [ "$result" = "" ]; then
-    return 0
-else
-    return 1
-fi
-
Index: tests/creddy_tests/roles.save
===================================================================
--- tests/creddy_tests/roles.save	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ 	(revision )
@@ -1,5 +1,0 @@
----running roles 
-creddy: Couldn't get cert from Acme_ID.pem
-creddy: Couldn't get cert from Acme_private.pem
-6a84d8b51dd08c6248a44d52b8709239c663cc90.buy_rockets<-6a84d8b51dd08c6248a44d52b8709239c663cc90.preferred_customer
-creddy: Couldn't get cert from bad_attr.xml
Index: tests/creddy_tests/roles.sh
===================================================================
--- tests/creddy_tests/roles.sh	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ tests/creddy_tests/roles.sh	(revision 3c30b595cd3f27758e8966a9935589bdb92486d5)
@@ -1,13 +1,35 @@
 #!/bin/sh
+#roles.sh
 
-pwd=`pwd`
-eloc=`which creddy | sed 's/\/creddy//'`
-if [ "$eloc" = "" ]; then
-  echo "ERROR: creddy is not in the search path!!!"
-  exit 1
-fi
+. ${TESTDIR}/test_util.sh
 
-$eloc/creddy --roles --cert Acme_ID.pem
-$eloc/creddy --roles --cert Acme_private.pem
-$eloc/creddy --roles --cert Acme_buy_rockets__Acme_preferred_customer_attr.xml
-$eloc/creddy --roles --cert bad_attr.xml
+runTest "creddy_tests/role.sh" "test1"  \
+"$eloc/creddy --roles --cert Acme_ID.pem" \
+ 1  "supplied  with a issuer cert"
+
+runTest "creddy_tests/role.sh" "test2"  \
+"$eloc/creddy --roles --cert Acme_private.pem" \
+ 1  "supplied with a privkey"
+
+runTest "creddy_tests/role.sh" "test3"  \
+"$eloc/creddy --roles --cert Acme_buy_rockets__Acme_preferred_customer_attr.xml" \
+ 0  "supplied with right attribute cert"
+
+runTest "creddy_tests/role.sh" "test4"  \
+"$eloc/creddy --roles --cert bad_attr.xml" \
+ 1  "supplied with a none existing cert"
+
+runTest "creddy_tests/role.sh" "test5"  \
+"$eloc/creddy --roles --cert priv.xml" \
+ 0  "supplied with a GENI priviledge cert"
+
+runTest "creddy_tests/role.sh" "test6"  \
+"$eloc/creddy --roles --cert not_ss.xml" \
+ 0  "supplied with a none self signed attribute cert"
+
+runTest "creddy_tests/role.sh" "test7"  \
+"$eloc/creddy --roles --cert iProtoGENI.xml" \
+ 1  "supplied with an expired  GENI signed attribute cert"
+
+
+
Index: tests/creddy_tests/run_test
===================================================================
--- tests/creddy_tests/run_test	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ 	(revision )
@@ -1,28 +1,0 @@
-#!/bin/sh
-#########
-# run_test
-#
-
-./setup.sh 1>/dev/null 2>&1
-
-# a_run type
-a_run()
-{
-    echo "---running $1 " > $1.out
-    ./$1.sh 1 >> $1.out 2>& 1
-    `./$1.ck`
-    if [ $? -eq 0 ]; then
-       echo "   creddy_tests, $1 PASSED"
-    else
-       echo "   creddy-tests, $1 FAILED"
-    fi
-}
-
-a_run verify
-a_run roles
-a_run attribute
-a_run keyid
-a_run generate
-a_run display
-a_run attribute_rule
-
Index: tests/creddy_tests/setup.sh
===================================================================
--- tests/creddy_tests/setup.sh	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ tests/creddy_tests/setup.sh	(revision 3c30b595cd3f27758e8966a9935589bdb92486d5)
@@ -4,15 +4,11 @@
 #Acme.preferred_customer <- Coyote
 
-rm -rf *.pem *.xml *.out
+. ${TESTDIR}/test_util.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 --generate --cn Acme 1>/dev/null 2>&1
+$eloc/creddy --generate --cn Coyote 1>/dev/null 2>&1
 
-$eloc/creddy --generate --cn Acme
-$eloc/creddy --generate --cn Coyote
+$eloc/creddy --generate --cn Bigbird 1>/dev/null 2>& 1
+$eloc/creddy --generate --cn Coyote 1>/dev/null 2>& 1
 
 $eloc/creddy --attribute \
@@ -30,4 +26,6 @@
 cp priv.xml_save priv.xml
 cp PGissuer.pem_save PGissuer.pem
-cp ProtoGENI.xml_save ProtoGENI.xml
+cp iProtoGENI.xml_save iProtoGENI.xml
+## waiting for a real valid one..
+cp iProtoGENI.xml_save ProtoGENI.xml
 
Index: tests/creddy_tests/verify.ck
===================================================================
--- tests/creddy_tests/verify.ck	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ 	(revision )
@@ -1,12 +1,0 @@
-#!/bin/sh
-
-# verify.ck
-
-result=`diff verify.out verify.save 2>/dev/null`
-
-if [ "$result" = "" ]; then
-    return 0
-else
-    return 1
-fi
-
Index: tests/creddy_tests/verify.save
===================================================================
--- tests/creddy_tests/verify.save	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ 	(revision )
@@ -1,33 +1,0 @@
----running verify 
-creddy verify, issuer: Coyote_ID.pem
-               attribute cert: Acme_buy_rockets__Acme_preferred_customer_attr.xml
-  issuer and attribute cert have mismatched principals
-  issuer cert still valid
-  attribute cert still valid
-creddy verify, issuer: Acme_ID.pem
-               attribute cert: Acme_buy_rockets__Acme_preferred_customer_attr.xml
-  issuer and attribute cert have matching principals
-  issuer cert still valid
-  attribute cert still valid
-creddy: Can't load issuer cert from Acme_private.pem
-creddy verify, issuer: Acme_private.pem
-creddy verify, issuer: Acme_ID.pem
-               attribute cert: bad_attr.xml
-  fail to extract attribute cert but...
-  issuer cert still valid
-creddy: Can't load issuer cert from Acme_buy_rockets__Acme_preferred_customer_attr.xml
-creddy verify, issuer: Acme_buy_rockets__Acme_preferred_customer_attr.xml
-creddy: Can't load issuer cert from bad_attr.xml
-creddy verify, issuer: bad_attr.xml
-creddy verify, issuer: Coyote_ID.pem
-  issuer cert still valid
-creddy verify, issuer: not_ss.pem
-  issuer cert still valid
-creddy: Can't load issuer cert from not_ss.xml
-creddy verify, issuer: not_ss.xml
-creddy: Can't load issuer cert from priv.xml
-creddy verify, issuer: priv.xml
-creddy verify, issuer: PGissuer.pem
-  issuer cert still valid
-creddy: Can't load issuer cert from ProtoGENI.xml
-creddy verify, issuer: ProtoGENI.xml
Index: tests/creddy_tests/verify.sh
===================================================================
--- tests/creddy_tests/verify.sh	(revision 6d3fc40db9f81457a345b1fb0d08f73522fb409d)
+++ tests/creddy_tests/verify.sh	(revision 3c30b595cd3f27758e8966a9935589bdb92486d5)
@@ -1,24 +1,60 @@
 #!/bin/sh
-#creddy --verify --cert <cert> [ --attrcert <cert> ]
+#creddy --verify --cert <issuer> [ --attrcert <cert> ]
+#verify.sh
 
-pwd=`pwd`
-eloc=`which creddy | sed 's/\/creddy//'`
-if [ "$eloc" = "" ]; then
-  echo "ERROR: creddy is not in the search path!!!"
-  exit 1
-fi
+. ${TESTDIR}/test_util.sh
 
-$eloc/creddy --verify --cert Coyote_ID.pem --attrcert Acme_buy_rockets__Acme_preferred_customer_attr.xml
-$eloc/creddy --verify --cert Acme_ID.pem --attrcert Acme_buy_rockets__Acme_preferred_customer_attr.xml
+runXTest "creddy_tests/verify.sh" "test1" \
+"$eloc/creddy --verify --cert Coyote_ID.pem --attrcert Acme_buy_rockets__Acme_preferred_customer_attr.xml" \
+0  "have mismatched principals" "ID and attr are still valid but differ in principals"
 
-$eloc/creddy --verify --cert Acme_private.pem
-$eloc/creddy --verify --cert Acme_ID.pem --attrcert bad_attr.xml
-$eloc/creddy --verify --cert Acme_buy_rockets__Acme_preferred_customer_attr.xml
-$eloc/creddy --verify --cert bad_attr.xml
-$eloc/creddy --verify --cert Coyote_ID.pem
+runTest "creddy_tests/verify.sh" "test2" \
+"$eloc/creddy --verify --cert Acme_ID.pem --attrcert Acme_buy_rockets__Acme_preferred_customer_attr.xml" \
+0  "matching principal and attribute"
 
-$eloc/creddy --verify --cert not_ss.pem
-$eloc/creddy --verify --cert not_ss.xml
-$eloc/creddy --verify --cert priv.xml
-$eloc/creddy --verify --cert PGissuer.pem
-$eloc/creddy --verify --cert ProtoGENI.xml
+runTest "creddy_tests/verify.sh" "test3" \
+"$eloc/creddy --verify --cert Acme_private.pem" \
+1 "verify with just a privkey"
+
+## this should really fail with a specific error code, 
+runTest "creddy_tests/verify.sh" "test4" \
+"$eloc/creddy --verify --cert Acme_ID.pem --attrcert bad_attr.xml" \
+0  "verify with non existing attribute, but still pass because issuer is okay"
+
+runTest "creddy_tests/verify.sh" "test5"  \
+"$eloc/creddy --verify --cert Acme_buy_rockets__Acme_preferred_customer_attr.xml " \
+1  "verify with just an attribute"
+
+runTest "creddy_tests/verify.sh" "test6"  \
+"$eloc/creddy --verify --cert bad_attr.xml" \
+1  "verify with just a none existing attribute"
+
+runTest "creddy_tests/verify.sh" "test7"  \
+"$eloc/creddy --verify --cert Coyote_ID.pem" \
+0  "verify just an issuer"
+
+runTest "creddy_tests/verify.sh" "test8"  \
+"$eloc/creddy --verify --cert not_ss.pem" \
+0  "verify just a none self signed principal pem"
+
+runTest "creddy_tests/verify.sh" "test9" \
+"$eloc/creddy --verify --attrcert not_ss.xml" \
+1  "verify just a none self signed attribute"
+
+runTest "creddy_tests/verify.sh" "test10" \
+"$eloc/creddy --verify --cert not_ss.xml" \
+1  "incorrectly trying to verify a none self signed attribute as an issuer cert"
+
+runTest "creddy_tests/verify.sh" "test11"  \
+"$eloc/creddy --verify --cert priv.xml" \
+1  "trying to verify GENI privilege attribute as an issuer cert"
+
+runTest "creddy_tests/verify.sh" "test12"  \
+"$eloc/creddy --verify --cert PGissuer.pem" \
+0  "verify a GENI's issuer pem"
+
+runTest "creddy_tests/verify.sh" "test13"  \
+"$eloc/creddy --verify --cert ProtoGENI.xml" \
+1  "incorrectly trying to verify a GENI issued attribute as issuer cert"
+
+
