abac0-leakabac0-mei
Last change
on this file since 2be12d2 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:
1.7 KB
|
Rev | Line | |
---|
[3c30b59] | 1 | # |
---|
| 2 | # python_tests |
---|
| 3 | # |
---|
| 4 | |
---|
[2d56f83] | 5 | include ${TESTDIR}/abac.mk |
---|
[3c30b59] | 6 | |
---|
[2d56f83] | 7 | EXPECTED_OKAY=11 |
---|
| 8 | |
---|
| 9 | DIRECTORY=acme_rockets_intersection_rt0 acme_rockets_rt0 experiment_create_rt0 |
---|
[3c30b59] | 10 | OTHER=basic_attribute basic_id |
---|
| 11 | |
---|
[2d56f83] | 12 | .PHONY: clean-local runcheck clean |
---|
[3c30b59] | 13 | all: runcheck |
---|
| 14 | |
---|
[2d56f83] | 15 | clean: |
---|
[3c30b59] | 16 | @for i in $(DIRECTORY); do \ |
---|
| 17 | here=`pwd`; \ |
---|
| 18 | cd $$i; \ |
---|
| 19 | rm -rf *.pem *.xml; \ |
---|
| 20 | cd $$here; \ |
---|
| 21 | done |
---|
| 22 | @(cd basic_id; rm -rf *.pem *.xml) |
---|
| 23 | @(cd basic_attribute; rm -rf *.pem *.xml) |
---|
| 24 | @rm -rf result error |
---|
| 25 | |
---|
| 26 | runcheck : |
---|
| 27 | @touch error |
---|
| 28 | @echo 'running libabac PYTHON testing...' | tee result |
---|
| 29 | @make clean |
---|
| 30 | @for i in $(DIRECTORY); do \ |
---|
| 31 | here=`pwd`; \ |
---|
| 32 | cd $$i; \ |
---|
| 33 | printf "\n ==> RUN on %s\n" "$$i" >> $$here/result ; \ |
---|
| 34 | $(MY_ENV) ./setup.py 1>/dev/null 2>&1; \ |
---|
| 35 | $(MY_ENV) ./attr.py 1>/dev/null 2>&1; \ |
---|
| 36 | $(MY_ENV) ./query.py |tee -a $$here/result |grep BAD >> $$here/error; \ |
---|
| 37 | cd $$here; \ |
---|
| 38 | done |
---|
| 39 | make ids |
---|
| 40 | make attrs |
---|
| 41 | @if test -f error ; \ |
---|
[2d56f83] | 42 | then \ |
---|
| 43 | (if test `cat error | wc -l ` -eq 0 ; \ |
---|
| 44 | then \ |
---|
| 45 | (if test `grep GOOD result | wc -l ` -eq $(EXPECTED_OKAY) ; \ |
---|
| 46 | then echo " PASSED!!!"; \ |
---|
| 47 | else echo " ERROR, no error but not enough good results!!!"; \ |
---|
| 48 | fi); \ |
---|
| 49 | else (echo " ERROR!!!"; cat error;); \ |
---|
| 50 | fi); \ |
---|
| 51 | else echo " PASSED"; \ |
---|
| 52 | fi |
---|
[3c30b59] | 53 | |
---|
| 54 | ids: |
---|
| 55 | @printf "\n ==> RUN on basic_id\n" >> result |
---|
| 56 | @(cd basic_id; \ |
---|
| 57 | $(MY_ENV) ./setup.py 1>/dev/null 2>&1; \ |
---|
| 58 | $(MY_ENV) ./query.py |tee -a ../result |grep BAD >> ../error; \ |
---|
| 59 | cd ..) |
---|
| 60 | |
---|
| 61 | attrs: |
---|
| 62 | @printf "\n ==> RUN on basic_attr\n" >> result |
---|
| 63 | @(cd basic_attribute; \ |
---|
| 64 | $(MY_ENV) ./setup.py 1>/dev/null 2>&1; \ |
---|
| 65 | $(MY_ENV) ./query.py |tee -a ../result |grep BAD >> ../error; \ |
---|
| 66 | cd ..) |
---|
| 67 | |
---|
| 68 | clean-local: |
---|
| 69 | @rm -rf result error |
---|
Note: See
TracBrowser
for help on using the repository browser.