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