From f7b52ef0c417bddc5bd47b0e673a62b458c16c99 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Milo=C5=A1=20Mula=C4=8D?= Date: Wed, 8 Feb 2006 15:06:24 +0000 Subject: [PATCH] - added AuthZ test --- org.glite.jp.index/Makefile | 2 +- org.glite.jp.index/doc/README | 11 +++++++++++ org.glite.jp.index/test/authz.out | 14 ++++++++++++++ org.glite.jp.index/test/run-test.sh | 11 ++++++++++- 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 org.glite.jp.index/test/authz.out diff --git a/org.glite.jp.index/Makefile b/org.glite.jp.index/Makefile index 7fd19bc..599f060 100644 --- a/org.glite.jp.index/Makefile +++ b/org.glite.jp.index/Makefile @@ -49,7 +49,7 @@ INSTALL:=libtool --mode=install install daemon:=glite-jp-indexd examples:=glite-jpis-test glite-jpis-client test:=run-test.sh -test_files:=dump1.sql simple_query.in simple_query.out complex_query.in complex_query.out +test_files:=dump1.sql simple_query.in simple_query.out complex_query.in complex_query.out authz.out is_prefix:=jpis_ is_client_prefix:=jpis_client_ ps_prefix:=jpps_ diff --git a/org.glite.jp.index/doc/README b/org.glite.jp.index/doc/README index 1f72084..267b88a 100644 --- a/org.glite.jp.index/doc/README +++ b/org.glite.jp.index/doc/README @@ -138,6 +138,17 @@ includes following tests: Test query has form (status=Done OR status=Ready) AND (user!=God). +* AuthZ test +- behaves exactly as simple query, except the fact that the index server + does compare query owner with jobs owner. These two differ and result + should be empty answer. +- scenario that checking ownership is swithed off (IS with -n option) is + covered by Simple query test +- scenario that only user jobs are returned and no others is covered by + Feed & query test + + + The testing shell script is highly configurable via environmental varibles. Please, run the script (run-test.sh) with '-?' option to get list of all variables and their meaning, if you are not satisfied with default setting. diff --git a/org.glite.jp.index/test/authz.out b/org.glite.jp.index/test/authz.out new file mode 100644 index 0000000..18e2d30 --- /dev/null +++ b/org.glite.jp.index/test/authz.out @@ -0,0 +1,14 @@ +query: using JPIS http://localhost:10000 + +Conditions: + http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus + == Ready +Attributes: + http://egee.cesnet.cz/en/Schema/JP/System:owner + http://egee.cesnet.cz/en/Schema/JP/System:jobId + http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus + http://egee.cesnet.cz/en/Schema/LB/Attributes:user + +OK +Result 0 jobs: + \ No newline at end of file diff --git a/org.glite.jp.index/test/run-test.sh b/org.glite.jp.index/test/run-test.sh index 53080b9..c6c34bc 100644 --- a/org.glite.jp.index/test/run-test.sh +++ b/org.glite.jp.index/test/run-test.sh @@ -140,7 +140,7 @@ run_test_query() { $GLITE_LOCATION/stage/examples/glite-jpis-client -q $1 \ -i http://localhost:$GLITE_JPIS_TEST_PORT &>/tmp/result DIFF=`diff --ignore-matching-lines="query: using JPIS" $2 /tmp/result` - if [ -z "$DIFF" ] ; then + if [ -z "$DIFF" -a "$?" -eq "0" ] ; then echo "OK." rm /tmp/result else @@ -150,6 +150,7 @@ run_test_query() { cat $2 echo "Obtained result (in /tmp/result):" cat /tmp/result + echo drop_db; kill_is; exit 1 @@ -201,4 +202,12 @@ run_test_feed; drop_db; kill_is; +echo -n "Authz test........... " +create_db; +run_is; +import_db $GLITE_LOCATION/stage/examples/dump1.sql; +run_test_query $GLITE_LOCATION/stage/examples/simple_query.in $GLITE_LOCATION/stage/examples/authz.out; +drop_db; +kill_is; + -- 1.8.2.3