1 | #!/usr/bin/env sh |
---|
2 | |
---|
3 | . ${TESTDIR}/test_util.sh |
---|
4 | if [ -z "${TESTDIR}" ] ; then |
---|
5 | TESTDIR=../.. |
---|
6 | fi |
---|
7 | |
---|
8 | keyloc=`pwd` |
---|
9 | |
---|
10 | acme=`$eloc/creddy --keyid --cert $keyloc/Acme_ID.pem` |
---|
11 | batman=`$eloc/creddy --keyid --cert $keyloc/Batman_ID.pem` |
---|
12 | coyote=`$eloc/creddy --keyid --cert $keyloc/Coyote_ID.pem` |
---|
13 | |
---|
14 | buy_rockets="$acme.buy_rockets" |
---|
15 | coyote_prin="$coyote" |
---|
16 | batman_prin="$batman" |
---|
17 | bad_buy_rockets="$acme.bad_buy_rockets" |
---|
18 | bad_buy_rockets2="99$acme.buy_rockets" |
---|
19 | |
---|
20 | echo "===good============ Acme.buy_rockets <- Coyote" |
---|
21 | runTest creddy_prover_test/acme_rockets_intersection_rt0 test1 \ |
---|
22 | "$ploc/abac_prover --keystore $keyloc --role $buy_rockets --principal $coyote_prin" \ |
---|
23 | 0 \ |
---|
24 | "simple rt0 query" |
---|
25 | |
---|
26 | echo "===bad============ Acme.bad_buy_rockets <- Coyote" |
---|
27 | runTest creddy_prover_test/acme_rockets_intersection_rt0 test2 \ |
---|
28 | "$ploc/abac_prover --keystore $keyloc --role $bad_buy_rockets --principal $coyote_prin" \ |
---|
29 | 1 \ |
---|
30 | "expected failure, query fail with unfound role but should return with partial proof" |
---|
31 | |
---|
32 | echo "===bad============ 99Acme.buy_rockets <- Coyote" |
---|
33 | runTest creddy_prover_test/acme_rockets_intersection_rt0 test3 \ |
---|
34 | "$ploc/abac_prover --keystore $keyloc --role $bad_buy_rockets2 --principal $coyote_prin" \ |
---|
35 | 1 \ |
---|
36 | "expected failure, query fail with none existing issuer principal" |
---|
37 | |
---|
38 | echo "===bad=============== Acme.buy_rockets <- Batman" |
---|
39 | runTest creddy_prover_test/acme_rockets_intersection_rt0 test4 \ |
---|
40 | "$ploc/abac_prover --keystore $keyloc --role $buy_rockets --principal $batman_prin" \ |
---|
41 | 1 \ |
---|
42 | "expected failure, query fail with none existing target principal" |
---|
43 | |
---|