source: examples/creddy_prover_tests/fruits_rt2/run_query @ 4b46680

mei_rt2mei_rt2_fix_1
Last change on this file since 4b46680 was 5110d42, checked in by Mei <mei@…>, 13 years ago

1) reorganized the test directory to include python tests
2) attribute via api and principal via api from python scripts is

working (although there is a annoying seg fault at the very end
that must be related to something not been dup()ed.. need to wait
for c example to debug it)

3) able to query via api
4) replicated access_rt2 example in python and the query result matches
5) expanded api to make it easier to generate rt2 structure

  • Property mode set to 100755
File size: 1.6 KB
Line 
1
2# fruits_rt2_typed
3
4pwd=`pwd`
5
6eloc=${ABAC_PROVER_PATH}
7keyloc=$pwd
8
9ralphs=`creddy --keyid --cert $keyloc/Ralphs_ID.pem`
10bob=`creddy --keyid --cert $keyloc/Bob_ID.pem`
11mary=`creddy --keyid --cert $keyloc/Mary_ID.pem`
12
13mary_what2eat="[keyid:$mary].oset:what2eat"
14bob_what2eat="[keyid:$bob].oset:what2eat"
15ralphs_apple="[keyid:$ralphs].oset:fruitprice([float:1.50])"
16
17## dump all credentials
18$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
19
20# [keyid:mary].oset:what2eat <-?- [string:'navel orange'] (yes)
21echo " "
22echo "===good============ mary.what2eat <- navel orange"
23$eloc/abac_prover_yap  --keystore $keyloc --oset "$mary_what2eat" --object "[string:'navel orange']"
24
25# [keyid:mary].oset:what2eat <-?- [string:'kiwi'] (yes)
26echo " "
27echo "===good============ mary.what2eat <- kiwi"
28$eloc/abac_prover_yap  --keystore $keyloc --oset "$mary_what2eat" --object "[string:'kiwi']"
29
30# [keyid:bob].oset:what2eat <-?- [string:'navel orange'] (no)
31echo " "
32echo "===bad============ bob.what2eat <- navel orange"
33$eloc/abac_prover_yap  --keystore $keyloc --oset "$bob_what2eat" --object "[string:'navel orange']"
34
35# [keyid:$ralphs].oset:fruitprice([float:1.50]) <-?- [string:'apple'] (yes)
36echo " "
37echo "===good============ ralphs.fruitprice(1.50) <- apple"
38$eloc/abac_prover_yap  --keystore $keyloc --oset "$ralphs_apple" --object "[string:'apple']"
39
40# [keyid:$ralphs].oset:fruitprice([float:1.50]) <-?- [string:'green apple'] (no)
41echo " "
42echo "===bad============ ralphs.fruitprice(1.50) <- green apple"
43$eloc/abac_prover_yap  --keystore $keyloc --oset "$ralphs_apple" --object "[string:'green apple']"
44
45
Note: See TracBrowser for help on using the repository browser.