From 04a3228b50575a8b9d85b5729ead8e22c6fcc524 Mon Sep 17 00:00:00 2001 From: kishoramballi Date: Mon, 30 Jun 2008 13:13:06 +0000 Subject: [PATCH] test script corresponding to the cases in Wiki pages for the module --- test/cache/Gateway/test005.ksh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 test/cache/Gateway/test005.ksh diff --git a/test/cache/Gateway/test005.ksh b/test/cache/Gateway/test005.ksh new file mode 100755 index 00000000..0c9fcac3 --- /dev/null +++ b/test/cache/Gateway/test005.ksh @@ -0,0 +1,35 @@ +#!/bin/sh + +# 5. Cached table there in csql, but complex query (avg on some field). It should get the correct value from mysql. + +#Run this test only under csql/test or on this directory. +#Otherwise, it may fail +CSQL_CONF=${PWD}/cache/Gateway/csql.conf +input=${PWD}/cache/Gateway/mysqlinputtest1.sql +REL_PATH=. +if [ -s "$input" -a -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/cache/Gateway +fi +export CSQL_CONFIG_FILE=$REL_PATH/csql.conf + +isql myodbc3 < $REL_PATH/mysqlinputtest5.sql > /dev/null 2>&1 + +# edit /tmp/csql/csqltable.conf +rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db +touch /tmp/csql/csqltable.conf /tmp/csql/csql.db +for (( a=1; a<2; a++ )) +do + echo "1:t$a" +done >> /tmp/csql/csqltable.conf +$CSQL_INSTALL_ROOT/bin/csqlserver -c >/dev/null 2>&1 & +pid=$! +sleep 5 +$CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/selectstar.sql +$CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/complex.sql +isql myodbc3 < $REL_PATH/dropall.sql > /dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db +touch /tmp/csql/csqltable.conf /tmp/csql/csql.db +kill -9 $pid +ipcrm -M 1199 -M 2277 +exit 0; -- 2.11.4.GIT