#! /bin/sh conv () { sexp-conv -s transport | tee test.in } die () { echo "Test failed:" "$@" exit 1 } check_sexp () { file="$1" shift sexp-conv -s canonical > test.canonical || die "sexp-conv failed" cmp "$file" test.canonical || die "$@" } TAG1='(3:tag(1:*))' TAG2='(3:tag3:foo)' TAG3='(3:tag(1:*6:prefix1:f))' ../tools/spki-delegate >testhome/.spki/acls \ --tag="$TAG3" \ --subject="`conv <"$srcdir/key-1.pub"`" \ --propagate check_sexp testhome/.spki/acls "ACLs differ" <testhome/.spki/certificates \ --tag="$TAG1" \ --issuer="`conv <"$srcdir/key-1.pub"`" \ --subject="`conv <"$srcdir/key-2.pub"`" \ --key="$srcdir/key-1" check_sexp testhome/.spki/certificates "Certificates differ" < test.out \ --acl-file=testhome/.spki/acls || die "Reduction failed." check_sexp test.out <