source: tests/creddy_prover_tests/acme_rockets_rt0/run_query

Last change on this file was 4f79997, checked in by Mei <mei@…>, 11 years ago

1) add a new scaling test -haystack/ralphs
2) tweak some libabac code here and there

  • Property mode set to 100755
File size: 1.8 KB
Line 
1#!/usr/bin/env sh
2
3. ${TESTDIR}/test_util.sh
4if [ -z "${TESTDIR}" ] ; then
5    TESTDIR=../..
6fi
7
8keyloc=`pwd`
9
10acme=`$eloc/creddy --keyid --cert $keyloc/Acme_ID.pem`
11coyote=`$eloc/creddy --keyid --cert $keyloc/Coyote_ID.pem`
12
13preferred_customer="$acme.preferred_customer"
14buy_rockets="$acme.buy_rockets"
15coyote_prin="$coyote"
16friend="$acme.friend"
17acme_prin="$acme"
18
19#[keyid:Acme].role:preferred_customer <-?- [keyid:Coyote]
20#isMember(pCoyote, role(pAcme,preferred_customer), C).
21echo "===good============ Acme.preferred_customer <- Coyote"
22runTest creddy_prover_test/acme_rockets_rt0 test1 \
23  "$ploc/abac_prover  --keystore $keyloc --role $preferred_customer --principal $coyote_prin" \
24  0 \
25  "simple rt0 query with 1 matched rule"
26
27#[keyid:Acme].role:buy_rockets <-?- [keyid:Coyote]
28#isMember(pCoyote, role(pAcme,buy_rockets), C).
29echo "===good=============== Acme.buy_rockets <- Coyote"
30runTest creddy_prover_test/acme_rockets_rt0 test2 \
31  "$ploc/abac_prover  --keystore $keyloc --role $buy_rockets --principal $coyote_prin" \
32  0 \
33  "rt0 query that returns 2 rules"
34
35## this is not suppose to work
36#[keyid:Acme].role:buy_rockets <-?- [keyid:Acme].role:preferred_customer
37echo "===bad=============== Acme.buy_rockets <- Acme.preferred_customer"
38runTest creddy_prover_test/acme_rockets_rt0 test3 \
39  "$ploc/abac_prover  --keystore $keyloc --role $buy_rockets --principal $preferred_customer" \
40  0 \
41  "this query is not suppose to work but alas did not block it, a.r1 <- b.r2"
42
43#[keyid:Coyote].role:friend <-?- [keyid:Acme]
44#isMember(pAcme, role(pCoyote,friend), C).
45echo "===bad=============== Coyote.friend <- Acme"
46runTest creddy_prover_test/acme_rockets_rt0 test4 \
47  "$ploc/abac_prover  --keystore $keyloc --role $friend --principal $acme_prin" \
48  1 \
49  "the assumption is not supported by rules "
Note: See TracBrowser for help on using the repository browser.