source: tests/example_scripts/python/Makefile.am @ 2d56f83

abac0-leakabac0-mei
Last change on this file since 2d56f83 was 2d56f83, checked in by Mei <mei@…>, 11 years ago

1) overhaul the tests directory that now we can regression test against
a build directory or a installed setup

  • Property mode set to 100644
File size: 2.9 KB
Line 
1#
2# example_scripts/python
3#
4
5include  ${TESTDIR}/abac.mk
6
7.PHONY: clean-local
8
9all: run_attr run_id run_id2 run_id3 run_prove
10
11clean:
12        @rm -f *.pem *.xml pfile
13
14setup:
15        @$(MY_ENV) ./setup.sh 1>/dev/null 2>&1
16
17run_attr:
18        @echo "---running (python) attr script"
19        @make clean
20        @make setup
21        @(rc=`$(MY_ENV) ./abac_attr.py IceCream_ID.pem IceCream_private.pem IceCream_attr.xml Chocolate_ID.pem |grep success` ; \
22        if [ -z "$$rc" ]; then \
23          echo "BAD:example_scripts/python/abac_attr.py:using libabac to create principal/attrs and make a simple query"; \
24        else \
25          echo "GOOD:example_scripts/python/abac_attr.py:using libabac to create principal/attrs and make a simple query"; \
26        fi)
27
28run_id:
29        @echo "---running (python) id script"
30        @make clean
31        @make setup
32        @(rc=`$(MY_ENV) ./abac_keyid.py IceCream_ID.pem | grep okay` ; \
33        if [ -z "$$rc" ]; then \
34          echo "BAD:example_scripts/python/abac_keyid.py:using libabac to extract principal"; \
35        else \
36          echo "GOOD:example_scripts/python/abac_keyid.py:using libabac to extract principal"; \
37        fi)
38
39
40run_id2:
41        @echo "---running (python) id2 script, expected failure"
42        @make clean
43        @make setup
44        @(rc=`$(MY_ENV) ./abac_keyid.py IceCream_private.pem  | grep okay` ; \
45        if [ -z "$$rc" ]; then \
46          echo "GOOD:example_scripts/python/abac_keyid.py:supplied with just a privkey"; \
47        else \
48          echo "BAD:example_scripts/python/abac_keyid.py:supplied with just a privkey, should fail"; \
49        fi)
50
51
52run_id3:
53        @echo "---running (python) id3 script"
54        @make clean
55        @make setup
56        @(rc=`$(MY_ENV) ./abac_keyid2.py IceCream_ID.pem IceCream_private.pem | grep okay` ; \
57        if [ -z "$$rc" ]; then \
58          echo "BAD:example_scripts/python/abac_keyid.py:supplied both id and privkey pem files"; \
59        else \
60          echo "GOOD:example_scripts/python/abac_keyid.py:supplied with id and privkey pem files"; \
61        fi)
62
63run_prove:
64        @echo "---running (python) prover script"
65        @make clean
66        @make setup
67        @$(MY_ENV) ./abac_attr.py IceCream_ID.pem IceCream_private.pem IceCream_attr.xml Chocolate_ID.pem 1>/dev/null 2>&1
68        @(rc=`$(MY_ENV) ./run_prover| grep success` ; \
69        if [ -z "$$rc" ]; then \
70          echo "BAD:example_scripts/python/abac_prover.py:trying out libabac python api to make a prover"; \
71        else \
72          echo "GOOD:example_scripts/python/abac_prover.py:trying out libabac python api to make a prover"; \
73        fi)
74
75#this needed to be run by hand (input dumdum twice)...
76#echo '---running (python) encrypted key attr script'
77#./run_e_prover 1> e_prover.log 2>& 1
78#result=`grep success e_prover.log 2>/dev/null |wc -l`
79#if [ "$result" = "2" ]; then
80#   echo "   PASSED"
81#else
82#   echo "   ERROR"
83#fi
84#run_e_attr:
85#       make clean
86#       rm -rf e_attr.log pfile
87#       echo "dumdum" > pfile
88#       openssl genrsa -des3 -out Soda_private.pem -passout file:pfile
89#       creddy --generate --cn Soda --key Soda_private.pem --p=pfile
90#       creddy --generate --cn Cream
91#       ./abac_e_attr.py Soda_ID.pem Soda_private.pem Soda_attr.xml pfile Cream_ID.pem 1>e_attr.log 2>&1
92
Note: See TracBrowser for help on using the repository browser.