From fd41313f5c3ffd4679a534238cdb879f8364da8e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ji=C5=99=C3=AD=20Sitera?= Date: Thu, 9 Mar 2006 22:54:42 +0000 Subject: [PATCH] IS query tests moved from test directory --- org.glite.jp.index/examples/query-tests/authz.out | 14 + .../examples/query-tests/complex_query.in | 36 ++ .../examples/query-tests/complex_query.out | 35 ++ org.glite.jp.index/examples/query-tests/dump1.sql | 593 +++++++++++++++++++++ .../examples/query-tests/run-test.sh | 218 ++++++++ .../examples/query-tests/simple_query.in | 19 + .../examples/query-tests/simple_query.out | 23 + 7 files changed, 938 insertions(+) create mode 100644 org.glite.jp.index/examples/query-tests/authz.out create mode 100644 org.glite.jp.index/examples/query-tests/complex_query.in create mode 100644 org.glite.jp.index/examples/query-tests/complex_query.out create mode 100644 org.glite.jp.index/examples/query-tests/dump1.sql create mode 100755 org.glite.jp.index/examples/query-tests/run-test.sh create mode 100644 org.glite.jp.index/examples/query-tests/simple_query.in create mode 100644 org.glite.jp.index/examples/query-tests/simple_query.out diff --git a/org.glite.jp.index/examples/query-tests/authz.out b/org.glite.jp.index/examples/query-tests/authz.out new file mode 100644 index 0000000..18e2d30 --- /dev/null +++ b/org.glite.jp.index/examples/query-tests/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/examples/query-tests/complex_query.in b/org.glite.jp.index/examples/query-tests/complex_query.in new file mode 100644 index 0000000..d80b1d5 --- /dev/null +++ b/org.glite.jp.index/examples/query-tests/complex_query.in @@ -0,0 +1,36 @@ + + + + + http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus + + EQUAL + + Done + + + + EQUAL + + Ready + + + + + + http://egee.cesnet.cz/en/Schema/LB/Attributes:user + + UNEQUAL + + God + + + + + 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 + + + diff --git a/org.glite.jp.index/examples/query-tests/complex_query.out b/org.glite.jp.index/examples/query-tests/complex_query.out new file mode 100644 index 0000000..65e14e9 --- /dev/null +++ b/org.glite.jp.index/examples/query-tests/complex_query.out @@ -0,0 +1,35 @@ +query: using JPIS http://localhost:10000 + +Conditions: + http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus + == Done + == Ready + http://egee.cesnet.cz/en/Schema/LB/Attributes:user + <> God +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 2 jobs: + jobid = https://localhost:7846/pokus1, owner = (null) + http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus + value = Done + origin = 0, (null) + time = Thu Jan 1 01:00:00 1970 + http://egee.cesnet.cz/en/Schema/LB/Attributes:user + value = CertSubj + origin = 0, (null) + time = Thu Jan 1 01:00:00 1970 + jobid = https://localhost:7846/pokus2, owner = (null) + http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus + value = Ready + origin = 0, (null) + time = Thu Jan 1 01:00:00 1970 + http://egee.cesnet.cz/en/Schema/LB/Attributes:user + value = CertSubj + origin = 0, (null) + time = Thu Jan 1 01:00:00 1970 +https://localhost:7846/pokus1http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatusDone1970-01-01T00:00:00ZSYSTEMhttp://egee.cesnet.cz/en/Schema/LB/Attributes:userCertSubj1970-01-01T00:00:00ZSYSTEMhttp://localhost:8901https://localhost:7846/pokus2http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatusReady1970-01-01T00:00:00ZSYSTEMhttp://egee.cesnet.cz/en/Schema/LB/Attributes:userCertSubj1970-01-01T00:00:00ZSYSTEMhttp://localhost:8901 \ No newline at end of file diff --git a/org.glite.jp.index/examples/query-tests/dump1.sql b/org.glite.jp.index/examples/query-tests/dump1.sql new file mode 100644 index 0000000..c0a5708 --- /dev/null +++ b/org.glite.jp.index/examples/query-tests/dump1.sql @@ -0,0 +1,593 @@ +-- MySQL dump 10.8 +-- +-- Host: localhost Database: jpis1test +-- ------------------------------------------------------ +-- Server version 4.1.7-max-log + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; + +-- +-- Current Database: `jpis1test` +-- + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `jpis1test`; + +USE `jpis1test`; + +-- +-- Table structure for table `acls` +-- + +DROP TABLE IF EXISTS `acls`; +CREATE TABLE `acls` ( + `aclid` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `value` mediumblob NOT NULL, + `refcnt` int(11) NOT NULL default '0', + PRIMARY KEY (`aclid`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `acls` +-- + + +/*!40000 ALTER TABLE `acls` DISABLE KEYS */; +LOCK TABLES `acls` WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE `acls` ENABLE KEYS */; + +-- +-- Table structure for table `attr_1005bc536e987ca1e027a5b8f84c9a67` +-- + +DROP TABLE IF EXISTS `attr_1005bc536e987ca1e027a5b8f84c9a67`; +CREATE TABLE `attr_1005bc536e987ca1e027a5b8f84c9a67` ( + `jobid` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `value` varchar(255) character set latin1 collate latin1_bin NOT NULL default '', + `full_value` mediumblob NOT NULL, + `origin` int(11) NOT NULL default '0', + KEY `jobid` (`jobid`), + KEY `value` (`value`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `attr_1005bc536e987ca1e027a5b8f84c9a67` +-- + + +/*!40000 ALTER TABLE `attr_1005bc536e987ca1e027a5b8f84c9a67` DISABLE KEYS */; +LOCK TABLES `attr_1005bc536e987ca1e027a5b8f84c9a67` WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE `attr_1005bc536e987ca1e027a5b8f84c9a67` ENABLE KEYS */; + +-- +-- Table structure for table `attr_12aaad5454b6e3e44cb4f4a432336af4` +-- + +DROP TABLE IF EXISTS `attr_12aaad5454b6e3e44cb4f4a432336af4`; +CREATE TABLE `attr_12aaad5454b6e3e44cb4f4a432336af4` ( + `jobid` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `value` varchar(255) character set latin1 collate latin1_bin NOT NULL default '', + `full_value` mediumblob NOT NULL, + `origin` int(11) NOT NULL default '0', + KEY `jobid` (`jobid`), + KEY `value` (`value`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `attr_12aaad5454b6e3e44cb4f4a432336af4` +-- + + +/*!40000 ALTER TABLE `attr_12aaad5454b6e3e44cb4f4a432336af4` DISABLE KEYS */; +LOCK TABLES `attr_12aaad5454b6e3e44cb4f4a432336af4` WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE `attr_12aaad5454b6e3e44cb4f4a432336af4` ENABLE KEYS */; + +-- +-- Table structure for table `attr_29d3ef83b39b8cf690e8113df316835a` +-- + +DROP TABLE IF EXISTS `attr_29d3ef83b39b8cf690e8113df316835a`; +CREATE TABLE `attr_29d3ef83b39b8cf690e8113df316835a` ( + `jobid` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `value` varchar(255) character set latin1 collate latin1_bin NOT NULL default '', + `full_value` mediumblob NOT NULL, + `origin` int(11) NOT NULL default '0', + KEY `jobid` (`jobid`), + KEY `value` (`value`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `attr_29d3ef83b39b8cf690e8113df316835a` +-- + + +/*!40000 ALTER TABLE `attr_29d3ef83b39b8cf690e8113df316835a` DISABLE KEYS */; +LOCK TABLES `attr_29d3ef83b39b8cf690e8113df316835a` WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE `attr_29d3ef83b39b8cf690e8113df316835a` ENABLE KEYS */; + +-- +-- Table structure for table `attr_5023d8d4cc249460dd947a878153027f` +-- + +DROP TABLE IF EXISTS `attr_5023d8d4cc249460dd947a878153027f`; +CREATE TABLE `attr_5023d8d4cc249460dd947a878153027f` ( + `jobid` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `value` varchar(255) character set latin1 collate latin1_bin NOT NULL default '', + `full_value` mediumblob NOT NULL, + `origin` int(11) NOT NULL default '0', + KEY `jobid` (`jobid`), + KEY `value` (`value`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `attr_5023d8d4cc249460dd947a878153027f` +-- + + +/*!40000 ALTER TABLE `attr_5023d8d4cc249460dd947a878153027f` DISABLE KEYS */; +LOCK TABLES `attr_5023d8d4cc249460dd947a878153027f` WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE `attr_5023d8d4cc249460dd947a878153027f` ENABLE KEYS */; + +-- +-- Table structure for table `attr_52942b8c70bab8491ab5d3b9713d79f5` +-- + +DROP TABLE IF EXISTS `attr_52942b8c70bab8491ab5d3b9713d79f5`; +CREATE TABLE `attr_52942b8c70bab8491ab5d3b9713d79f5` ( + `jobid` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `value` varchar(255) character set latin1 collate latin1_bin NOT NULL default '', + `full_value` mediumblob NOT NULL, + `origin` int(11) NOT NULL default '0', + KEY `jobid` (`jobid`), + KEY `value` (`value`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `attr_52942b8c70bab8491ab5d3b9713d79f5` +-- + + +/*!40000 ALTER TABLE `attr_52942b8c70bab8491ab5d3b9713d79f5` DISABLE KEYS */; +LOCK TABLES `attr_52942b8c70bab8491ab5d3b9713d79f5` WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE `attr_52942b8c70bab8491ab5d3b9713d79f5` ENABLE KEYS */; + +-- +-- Table structure for table `attr_6bc44144bf813a2ad7d67cb2adbdaf42` +-- + +DROP TABLE IF EXISTS `attr_6bc44144bf813a2ad7d67cb2adbdaf42`; +CREATE TABLE `attr_6bc44144bf813a2ad7d67cb2adbdaf42` ( + `jobid` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `value` varchar(255) character set latin1 collate latin1_bin NOT NULL default '', + `full_value` mediumblob NOT NULL, + `origin` int(11) NOT NULL default '0', + KEY `jobid` (`jobid`), + KEY `value` (`value`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `attr_6bc44144bf813a2ad7d67cb2adbdaf42` +-- + + +/*!40000 ALTER TABLE `attr_6bc44144bf813a2ad7d67cb2adbdaf42` DISABLE KEYS */; +LOCK TABLES `attr_6bc44144bf813a2ad7d67cb2adbdaf42` WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE `attr_6bc44144bf813a2ad7d67cb2adbdaf42` ENABLE KEYS */; + +-- +-- Table structure for table `attr_760a84e0ff89fa3f4e96ec82adfd92f1` +-- + +DROP TABLE IF EXISTS `attr_760a84e0ff89fa3f4e96ec82adfd92f1`; +CREATE TABLE `attr_760a84e0ff89fa3f4e96ec82adfd92f1` ( + `jobid` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `value` varchar(255) character set latin1 collate latin1_bin NOT NULL default '', + `full_value` mediumblob NOT NULL, + `origin` int(11) NOT NULL default '0', + KEY `jobid` (`jobid`), + KEY `value` (`value`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `attr_760a84e0ff89fa3f4e96ec82adfd92f1` +-- + + +/*!40000 ALTER TABLE `attr_760a84e0ff89fa3f4e96ec82adfd92f1` DISABLE KEYS */; +LOCK TABLES `attr_760a84e0ff89fa3f4e96ec82adfd92f1` WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE `attr_760a84e0ff89fa3f4e96ec82adfd92f1` ENABLE KEYS */; + +-- +-- Table structure for table `attr_7c3be9defcbcf9f0e7890600d9c204ac` +-- + +DROP TABLE IF EXISTS `attr_7c3be9defcbcf9f0e7890600d9c204ac`; +CREATE TABLE `attr_7c3be9defcbcf9f0e7890600d9c204ac` ( + `jobid` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `value` varchar(255) character set latin1 collate latin1_bin NOT NULL default '', + `full_value` mediumblob NOT NULL, + `origin` int(11) NOT NULL default '0', + KEY `jobid` (`jobid`), + KEY `value` (`value`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `attr_7c3be9defcbcf9f0e7890600d9c204ac` +-- + + +/*!40000 ALTER TABLE `attr_7c3be9defcbcf9f0e7890600d9c204ac` DISABLE KEYS */; +LOCK TABLES `attr_7c3be9defcbcf9f0e7890600d9c204ac` WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE `attr_7c3be9defcbcf9f0e7890600d9c204ac` ENABLE KEYS */; + +-- +-- Table structure for table `attr_862e3dd7c5da90c9a659a32a41f63af8` +-- + +DROP TABLE IF EXISTS `attr_862e3dd7c5da90c9a659a32a41f63af8`; +CREATE TABLE `attr_862e3dd7c5da90c9a659a32a41f63af8` ( + `jobid` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `value` varchar(255) character set latin1 collate latin1_bin NOT NULL default '', + `full_value` mediumblob NOT NULL, + `origin` int(11) NOT NULL default '0', + KEY `jobid` (`jobid`), + KEY `value` (`value`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `attr_862e3dd7c5da90c9a659a32a41f63af8` +-- + + +/*!40000 ALTER TABLE `attr_862e3dd7c5da90c9a659a32a41f63af8` DISABLE KEYS */; +LOCK TABLES `attr_862e3dd7c5da90c9a659a32a41f63af8` WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE `attr_862e3dd7c5da90c9a659a32a41f63af8` ENABLE KEYS */; + +-- +-- Table structure for table `attr_982d06bdc65d3a4240b36a060a09886e` +-- + +DROP TABLE IF EXISTS `attr_982d06bdc65d3a4240b36a060a09886e`; +CREATE TABLE `attr_982d06bdc65d3a4240b36a060a09886e` ( + `jobid` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `value` varchar(255) character set latin1 collate latin1_bin NOT NULL default '', + `full_value` mediumblob NOT NULL, + `origin` int(11) NOT NULL default '0', + KEY `jobid` (`jobid`), + KEY `value` (`value`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `attr_982d06bdc65d3a4240b36a060a09886e` +-- + + +/*!40000 ALTER TABLE `attr_982d06bdc65d3a4240b36a060a09886e` DISABLE KEYS */; +LOCK TABLES `attr_982d06bdc65d3a4240b36a060a09886e` WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE `attr_982d06bdc65d3a4240b36a060a09886e` ENABLE KEYS */; + +-- +-- Table structure for table `attr_9892f81a8175c09bd00afcb152f510ad` +-- + +DROP TABLE IF EXISTS `attr_9892f81a8175c09bd00afcb152f510ad`; +CREATE TABLE `attr_9892f81a8175c09bd00afcb152f510ad` ( + `jobid` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `value` varchar(255) character set latin1 collate latin1_bin NOT NULL default '', + `full_value` mediumblob NOT NULL, + `origin` int(11) NOT NULL default '0', + KEY `jobid` (`jobid`), + KEY `value` (`value`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `attr_9892f81a8175c09bd00afcb152f510ad` +-- + + +/*!40000 ALTER TABLE `attr_9892f81a8175c09bd00afcb152f510ad` DISABLE KEYS */; +LOCK TABLES `attr_9892f81a8175c09bd00afcb152f510ad` WRITE; +INSERT INTO `attr_9892f81a8175c09bd00afcb152f510ad` VALUES ('593e62a063231f8c623b74406b3e12b0','S:CertSubj','S:CertSubj',1),('9276789a0093ad44457655ef03ade36a','S:CertSubj','S:CertSubj',2); +UNLOCK TABLES; +/*!40000 ALTER TABLE `attr_9892f81a8175c09bd00afcb152f510ad` ENABLE KEYS */; + +-- +-- Table structure for table `attr_9a812abe1262a90858b7be792f198596` +-- + +DROP TABLE IF EXISTS `attr_9a812abe1262a90858b7be792f198596`; +CREATE TABLE `attr_9a812abe1262a90858b7be792f198596` ( + `jobid` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `value` varchar(255) character set latin1 collate latin1_bin NOT NULL default '', + `full_value` mediumblob NOT NULL, + `origin` int(11) NOT NULL default '0', + KEY `jobid` (`jobid`), + KEY `value` (`value`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `attr_9a812abe1262a90858b7be792f198596` +-- + + +/*!40000 ALTER TABLE `attr_9a812abe1262a90858b7be792f198596` DISABLE KEYS */; +LOCK TABLES `attr_9a812abe1262a90858b7be792f198596` WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE `attr_9a812abe1262a90858b7be792f198596` ENABLE KEYS */; + +-- +-- Table structure for table `attr_a1e9e0a1b7943cc041fefb5da65868f9` +-- + +DROP TABLE IF EXISTS `attr_a1e9e0a1b7943cc041fefb5da65868f9`; +CREATE TABLE `attr_a1e9e0a1b7943cc041fefb5da65868f9` ( + `jobid` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `value` varchar(255) character set latin1 collate latin1_bin NOT NULL default '', + `full_value` mediumblob NOT NULL, + `origin` int(11) NOT NULL default '0', + KEY `jobid` (`jobid`), + KEY `value` (`value`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `attr_a1e9e0a1b7943cc041fefb5da65868f9` +-- + + +/*!40000 ALTER TABLE `attr_a1e9e0a1b7943cc041fefb5da65868f9` DISABLE KEYS */; +LOCK TABLES `attr_a1e9e0a1b7943cc041fefb5da65868f9` WRITE; +INSERT INTO `attr_a1e9e0a1b7943cc041fefb5da65868f9` VALUES ('593e62a063231f8c623b74406b3e12b0','S:Done','S:Done',1),('9276789a0093ad44457655ef03ade36a','S:Ready','S:Ready',1); +UNLOCK TABLES; +/*!40000 ALTER TABLE `attr_a1e9e0a1b7943cc041fefb5da65868f9` ENABLE KEYS */; + +-- +-- Table structure for table `attr_a9c522a79597e1bfd2bd687d42d557b7` +-- + +DROP TABLE IF EXISTS `attr_a9c522a79597e1bfd2bd687d42d557b7`; +CREATE TABLE `attr_a9c522a79597e1bfd2bd687d42d557b7` ( + `jobid` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `value` varchar(255) character set latin1 collate latin1_bin NOT NULL default '', + `full_value` mediumblob NOT NULL, + `origin` int(11) NOT NULL default '0', + KEY `jobid` (`jobid`), + KEY `value` (`value`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `attr_a9c522a79597e1bfd2bd687d42d557b7` +-- + + +/*!40000 ALTER TABLE `attr_a9c522a79597e1bfd2bd687d42d557b7` DISABLE KEYS */; +LOCK TABLES `attr_a9c522a79597e1bfd2bd687d42d557b7` WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE `attr_a9c522a79597e1bfd2bd687d42d557b7` ENABLE KEYS */; + +-- +-- Table structure for table `attr_c47f78255056386d2b3da6d506d1f244` +-- + +DROP TABLE IF EXISTS `attr_c47f78255056386d2b3da6d506d1f244`; +CREATE TABLE `attr_c47f78255056386d2b3da6d506d1f244` ( + `jobid` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `value` varchar(255) character set latin1 collate latin1_bin NOT NULL default '', + `full_value` mediumblob NOT NULL, + `origin` int(11) NOT NULL default '0', + KEY `jobid` (`jobid`), + KEY `value` (`value`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `attr_c47f78255056386d2b3da6d506d1f244` +-- + + +/*!40000 ALTER TABLE `attr_c47f78255056386d2b3da6d506d1f244` DISABLE KEYS */; +LOCK TABLES `attr_c47f78255056386d2b3da6d506d1f244` WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE `attr_c47f78255056386d2b3da6d506d1f244` ENABLE KEYS */; + +-- +-- Table structure for table `attr_d193237d94c17244ebba4ce049759371` +-- + +DROP TABLE IF EXISTS `attr_d193237d94c17244ebba4ce049759371`; +CREATE TABLE `attr_d193237d94c17244ebba4ce049759371` ( + `jobid` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `value` varchar(255) character set latin1 collate latin1_bin NOT NULL default '', + `full_value` mediumblob NOT NULL, + `origin` int(11) NOT NULL default '0', + KEY `jobid` (`jobid`), + KEY `value` (`value`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `attr_d193237d94c17244ebba4ce049759371` +-- + + +/*!40000 ALTER TABLE `attr_d193237d94c17244ebba4ce049759371` DISABLE KEYS */; +LOCK TABLES `attr_d193237d94c17244ebba4ce049759371` WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE `attr_d193237d94c17244ebba4ce049759371` ENABLE KEYS */; + +-- +-- Table structure for table `attr_e019a506c890326966714893ac3e8cf5` +-- + +DROP TABLE IF EXISTS `attr_e019a506c890326966714893ac3e8cf5`; +CREATE TABLE `attr_e019a506c890326966714893ac3e8cf5` ( + `jobid` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `value` varchar(255) character set latin1 collate latin1_bin NOT NULL default '', + `full_value` mediumblob NOT NULL, + `origin` int(11) NOT NULL default '0', + KEY `jobid` (`jobid`), + KEY `value` (`value`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `attr_e019a506c890326966714893ac3e8cf5` +-- + + +/*!40000 ALTER TABLE `attr_e019a506c890326966714893ac3e8cf5` DISABLE KEYS */; +LOCK TABLES `attr_e019a506c890326966714893ac3e8cf5` WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE `attr_e019a506c890326966714893ac3e8cf5` ENABLE KEYS */; + +-- +-- Table structure for table `attr_e26a86a86bfc6799461d999860e57d81` +-- + +DROP TABLE IF EXISTS `attr_e26a86a86bfc6799461d999860e57d81`; +CREATE TABLE `attr_e26a86a86bfc6799461d999860e57d81` ( + `jobid` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `value` varchar(255) character set latin1 collate latin1_bin NOT NULL default '', + `full_value` mediumblob NOT NULL, + `origin` int(11) NOT NULL default '0', + KEY `jobid` (`jobid`), + KEY `value` (`value`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `attr_e26a86a86bfc6799461d999860e57d81` +-- + + +/*!40000 ALTER TABLE `attr_e26a86a86bfc6799461d999860e57d81` DISABLE KEYS */; +LOCK TABLES `attr_e26a86a86bfc6799461d999860e57d81` WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE `attr_e26a86a86bfc6799461d999860e57d81` ENABLE KEYS */; + +-- +-- Table structure for table `attrs` +-- + +DROP TABLE IF EXISTS `attrs`; +CREATE TABLE `attrs` ( + `attrid` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `name` varchar(255) character set latin1 collate latin1_bin NOT NULL default '', + `indexed` int(11) NOT NULL default '0', + `type` varchar(32) character set latin1 collate latin1_bin default NULL, + PRIMARY KEY (`attrid`), + KEY `attrid` (`attrid`), + KEY `name` (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `attrs` +-- + + +/*!40000 ALTER TABLE `attrs` DISABLE KEYS */; +LOCK TABLES `attrs` WRITE; +INSERT INTO `attrs` VALUES ('52942b8c70bab8491ab5d3b9713d79f5','http://egee.cesnet.cz/en/Schema/JP/System:owner',1,'mediumblob'),('6bc44144bf813a2ad7d67cb2adbdaf42','http://egee.cesnet.cz/en/Schema/JP/System:jobId',1,'mediumblob'),('862e3dd7c5da90c9a659a32a41f63af8','http://egee.cesnet.cz/en/Schema/JP/System:regtime',0,'mediumblob'),('9892f81a8175c09bd00afcb152f510ad','http://egee.cesnet.cz/en/Schema/LB/Attributes:user',1,'mediumblob'),('e019a506c890326966714893ac3e8cf5','http://egee.cesnet.cz/en/Schema/LB/Attributes:aTag',0,'mediumblob'),('d193237d94c17244ebba4ce049759371','http://egee.cesnet.cz/en/Schema/LB/Attributes:eNodes',0,'mediumblob'),('5023d8d4cc249460dd947a878153027f','http://egee.cesnet.cz/en/Schema/LB/Attributes:RB',1,'mediumblob'),('c47f78255056386d2b3da6d506d1f244','http://egee.cesnet.cz/en/Schema/LB/Attributes:CE',1,'mediumblob'),('29d3ef83b39b8cf690e8113df316835a','http://egee.cesnet.cz/en/Schema/LB/Attributes:UIHost',1,'mediumblob'),('a9c522a79597e1bfd2bd687d42d557b7','http://egee.cesnet.cz/en/Schema/LB/Attributes:CPUTime',0,'mediumblob'),('12aaad5454b6e3e44cb4f4a432336af4','http://egee.cesnet.cz/en/Schema/LB/Attributes:NProc',0,'mediumblob'),('a1e9e0a1b7943cc041fefb5da65868f9','http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus',1,'mediumblob'),('760a84e0ff89fa3f4e96ec82adfd92f1','http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatusDate',0,'mediumblob'),('9a812abe1262a90858b7be792f198596','http://egee.cesnet.cz/en/Schema/LB/Attributes:retryCount',0,'mediumblob'),('e26a86a86bfc6799461d999860e57d81','http://egee.cesnet.cz/en/Schema/LB/Attributes:jobType',0,'mediumblob'),('1005bc536e987ca1e027a5b8f84c9a67','http://egee.cesnet.cz/en/Schema/LB/Attributes:nsubjobs',0,'mediumblob'),('7c3be9defcbcf9f0e7890600d9c204ac','http://egee.cesnet.cz/en/Schema/LB/Attributes:lastStatusHistory',0,'mediumblob'),('982d06bdc65d3a4240b36a060a09886e','http://egee.cesnet.cz/en/Schema/LB/Attributes:fullStatusHistory',0,'mediumblob'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `attrs` ENABLE KEYS */; + +-- +-- Table structure for table `feeds` +-- + +DROP TABLE IF EXISTS `feeds`; +CREATE TABLE `feeds` ( + `uniqueid` int(11) NOT NULL auto_increment, + `feedid` varchar(32) character set latin1 collate latin1_bin default NULL, + `state` int(11) NOT NULL default '0', + `locked` int(11) NOT NULL default '0', + `source` varchar(255) NOT NULL default '', + `expires` datetime default NULL, + `condition` mediumblob, + PRIMARY KEY (`uniqueid`), + UNIQUE KEY `feedid` (`feedid`), + KEY `uniqueid` (`uniqueid`), + KEY `feedid_2` (`feedid`), + KEY `state` (`state`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `feeds` +-- + + +/*!40000 ALTER TABLE `feeds` DISABLE KEYS */; +LOCK TABLES `feeds` WRITE; +INSERT INTO `feeds` VALUES (93,'12345',8,0,'http://localhost:8901','2005-10-14 10:48:27','COND2'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `feeds` ENABLE KEYS */; + +-- +-- Table structure for table `jobs` +-- + +DROP TABLE IF EXISTS `jobs`; +CREATE TABLE `jobs` ( + `jobid` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `dg_jobid` varchar(255) character set latin1 collate latin1_bin NOT NULL default '', + `ownerid` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `aclid` varchar(32) character set latin1 collate latin1_bin default NULL, + `ps` varchar(255) NOT NULL default '', + PRIMARY KEY (`jobid`), + UNIQUE KEY `dg_jobid` (`dg_jobid`), + KEY `jobid` (`jobid`), + KEY `dg_jobid_2` (`dg_jobid`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `jobs` +-- + + +/*!40000 ALTER TABLE `jobs` DISABLE KEYS */; +LOCK TABLES `jobs` WRITE; +INSERT INTO `jobs` VALUES ('593e62a063231f8c623b74406b3e12b0','https://localhost:7846/pokus1','5864429d57da18e4ecf9ea366c6b2c9c',NULL,'http://localhost:8901'),('9276789a0093ad44457655ef03ade36a','https://localhost:7846/pokus2','9996d295b9e10ce182983b258b280779',NULL,'http://localhost:8901'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `jobs` ENABLE KEYS */; + +-- +-- Table structure for table `users` +-- + +DROP TABLE IF EXISTS `users`; +CREATE TABLE `users` ( + `userid` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `cert_subj` varchar(255) character set latin1 collate latin1_bin NOT NULL default '', + PRIMARY KEY (`userid`), + UNIQUE KEY `cert_subj` (`cert_subj`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `users` +-- + + +/*!40000 ALTER TABLE `users` DISABLE KEYS */; +LOCK TABLES `users` WRITE; +INSERT INTO `users` VALUES ('5864429d57da18e4ecf9ea366c6b2c9c','/O=CESNET/O=Masaryk University/CN=Milos Mulac'),('9996d295b9e10ce182983b258b280779','OwnerName'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `users` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; + diff --git a/org.glite.jp.index/examples/query-tests/run-test.sh b/org.glite.jp.index/examples/query-tests/run-test.sh new file mode 100755 index 0000000..e8fda6d --- /dev/null +++ b/org.glite.jp.index/examples/query-tests/run-test.sh @@ -0,0 +1,218 @@ +#! /bin/bash + +# +# test script for the index server +# +# requires running mysql +# + +usage() { +cat <&1| \ + grep timeleft| sed 's/^.* //'` + if [ "$timeleft" = "0:00:00" -o -z "$timeleft" ]; then + echo "No valid proxy cert found nor "\ + "GLITE_HOST_KEY/GLITE_HOST_KEY specified!"\ + " Aborting." + exit 1 + fi + else + echo "Can't check proxy cert (grid-proxy-info not found). If you do not have valid proxy certificate, set GLITE_HOST_KEY/GLITE_HOST_KEY - otherwise tests will fail!" + fi + fi + + # handle the configuration + ARGS="-u ${GLITE_JPIS_TEST_ROOT_USER:-root}" + [ -z "$GLITE_JPIS_TEST_ROOT_PASSWORD" ] || ARGS="-p ${GLITE_JPIS_TEST_ROOT_PASSWORD} $ARGS" + GLITE_JPIS_TEST_PORT=${GLITE_JPIS_TEST_PORT:-"10000"} + GLITE_JPIS_TEST_PIDFILE=${GLITE_JPIS_TEST_PIDFILE:-"/tmp/glite-jp-indexd.pid"} + GLITE_JPIS_TEST_LOGFILE=${GLITE_JPIS_TEST_LOGFILE:-"/tmp/glite-jp-indexd.log"} + + if [ -z "$GLITE_JPIS_TEST_DB" ]; then + GLITE_JPIS_TEST_DB="jpis/@localhost:jpis1test" + need_new_db=1; + fi + DB_USER=`echo $GLITE_JPIS_TEST_DB| sed 's!/.*$!!'` + DB_HOST=`echo $GLITE_JPIS_TEST_DB| sed 's!^.*@!!' | sed 's!:.*!!'` + DB_NAME=`echo $GLITE_JPIS_TEST_DB| sed 's!^.*:!!'` + + GLITE_JPIS_DEBUG=0 +} + +create_db() { + # create database when needed + if [ "x$need_new_db" = "x1" ]; then + mysqladmin -f $ARGS drop $DB_NAME > /dev/null 2>&1 + mysqladmin -f $ARGS create $DB_NAME && \ + mysql $ARGS -e 'GRANT ALL on $DB_NAME.* to jpis@localhost' && \ + mysql -u $DB_USER $DB_NAME < $GLITE_LOCATION/etc/glite-jp-index-dbsetup.sql || exit 1 + db_created="1" + fi +} + +import_db() { + # import database + cat $1 | sed "s/jpis1test/$DB_NAME/" | mysql -u $DB_USER -h $DB_HOST + if [ x"$?" != x"0" ]; then + echo "FAILED to import database." + kill_is; + drop_db; + exit 1 + fi +} + +drop_db() { + # drop databaze when created + [ -z "$db_created" ] || mysqladmin -f $ARGS drop $DB_NAME >/dev/null + +} + +run_is() { + # run index server + X509_USER_KEY=${X509_USER_KEY} X509_USER_CERT=${X509_USER_CERT} \ + $GLITE_LOCATION/bin/glite-jp-indexd -m $GLITE_JPIS_TEST_DB -p $GLITE_JPIS_TEST_PORT \ + -i ${GLITE_JPIS_TEST_PIDFILE} -o ${GLITE_JPIS_TEST_LOGFILE} $1\ + 2>/dev/null + + + if [ x"$?" != x"0" ]; then + echo FAILED + drop_db; + exit 1 + fi + if [ ! -s "${GLITE_JPIS_TEST_PIDFILE}" ]; then + echo "Can't startup index server." + drop_db; + exit 1 + fi + + # wait for index server + ret=1 + i=0 + while [ x"$ret" != x"0" -a $i -lt 20 ]; do + LC_ALL=C netstat -tap 2>/dev/null | grep "\<$GLITE_JPIS_TEST_PORT\>" > /dev/null + ret=$? + i=$(($i+1)) + LC_ALL=C sleep 0.1 + done +} + +kill_is() { + # kill the index server + kill `cat ${GLITE_JPIS_TEST_PIDFILE}`; + sleep 1; + kill -9 `cat ${GLITE_JPIS_TEST_PIDFILE}` 2>/dev/null +} + +run_test_query() { + X509_USER_KEY=${X509_USER_KEY} X509_USER_CERT=${X509_USER_CERT} \ + $GLITE_LOCATION/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" -a "$?" -eq "0" ] ; then + echo "OK." + rm /tmp/result + else + echo "FAILED!" + echo + echo "Expected result:" + cat $2 + echo "Obtained result (in /tmp/result):" + cat /tmp/result + echo + drop_db; + kill_is; + exit 1 + fi +} + +run_test_feed() { + # run the example + numok=`X509_USER_KEY=${X509_USER_KEY} X509_USER_CERT=${X509_USER_CERT}\ + GLITE_JPIS_DB=$GLITE_JPIS_TEST_DB \ + GLITE_JPIS_PORT=$GLITE_JPIS_TEST_PORT \ + $GLITE_LOCATION/examples/glite-jpis-test 2>/dev/null| grep "OK" | wc -l` + if [ "$numok" -eq "2" ]; then + echo OK. + else + echo FAILED! + fi +} + + +########################################################################## +# + +if [ "$1" ]; then usage; exit 1; fi +init; + +echo + +echo -n "Simple query test.... " +create_db; +run_is "-n"; +import_db $GLITE_LOCATION/examples/dump1.sql; +run_test_query $GLITE_LOCATION/examples/simple_query.in $GLITE_LOCATION/examples/simple_query.out; +drop_db; +kill_is; + +echo -n "Complex query test... " +create_db; +run_is "-n"; +import_db $GLITE_LOCATION/examples/dump1.sql; +run_test_query $GLITE_LOCATION/examples/complex_query.in $GLITE_LOCATION/examples/complex_query.out; +drop_db; +kill_is; + +echo -n "Feed & query test.... " +create_db; +run_is; +run_test_feed; +drop_db; +kill_is; + +echo -n "Authz test........... " +create_db; +run_is; +import_db $GLITE_LOCATION/examples/dump1.sql; +run_test_query $GLITE_LOCATION/examples/simple_query.in $GLITE_LOCATION/examples/authz.out; +drop_db; +kill_is; + + diff --git a/org.glite.jp.index/examples/query-tests/simple_query.in b/org.glite.jp.index/examples/query-tests/simple_query.in new file mode 100644 index 0000000..0b1fe2d --- /dev/null +++ b/org.glite.jp.index/examples/query-tests/simple_query.in @@ -0,0 +1,19 @@ + + + + + http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus + + EQUAL + + Ready + + + + + 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 + + diff --git a/org.glite.jp.index/examples/query-tests/simple_query.out b/org.glite.jp.index/examples/query-tests/simple_query.out new file mode 100644 index 0000000..f63adf2 --- /dev/null +++ b/org.glite.jp.index/examples/query-tests/simple_query.out @@ -0,0 +1,23 @@ +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 1 jobs: + jobid = https://localhost:7846/pokus2, owner = (null) + http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatus + value = Ready + origin = 0, (null) + time = Thu Jan 1 01:00:00 1970 + http://egee.cesnet.cz/en/Schema/LB/Attributes:user + value = CertSubj + origin = 0, (null) + time = Thu Jan 1 01:00:00 1970 +https://localhost:7846/pokus2http://egee.cesnet.cz/en/Schema/LB/Attributes:finalStatusReady1970-01-01T00:00:00ZSYSTEMhttp://egee.cesnet.cz/en/Schema/LB/Attributes:userCertSubj1970-01-01T00:00:00ZSYSTEMhttp://localhost:8901 \ No newline at end of file -- 1.8.2.3