From ae72d3a1599949b684d78a6a7983f6ee6add6c59 Mon Sep 17 00:00:00 2001 From: kishoramballi Date: Mon, 30 Jun 2008 14:06:21 +0000 Subject: [PATCH] test script corresponding to the cases in Wiki pages for the module --- test/cache/Gateway/test008.ksh | 38 ++++++++++++++++++++++++++++++++++++++ test/cache/Gateway/test009.ksh | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100755 test/cache/Gateway/test008.ksh create mode 100755 test/cache/Gateway/test009.ksh diff --git a/test/cache/Gateway/test008.ksh b/test/cache/Gateway/test008.ksh new file mode 100755 index 00000000..46805378 --- /dev/null +++ b/test/cache/Gateway/test008.ksh @@ -0,0 +1,38 @@ +#!/bin/sh + +# 8.Cached table there in csql, but join with another cached table in csql. 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 +isql myodbc3 < $REL_PATH/mysqlinputtest8.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<3; 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/join.sql + +isql myodbc3 < $REL_PATH/dropall.sql > /dev/null 2>&1 +kill -9 $pid +ipcrm -M 1199 -M 2277 +rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db +touch /tmp/csql/csqltable.conf /tmp/csql/csql.db +exit 0; diff --git a/test/cache/Gateway/test009.ksh b/test/cache/Gateway/test009.ksh new file mode 100755 index 00000000..6c63ee68 --- /dev/null +++ b/test/cache/Gateway/test009.ksh @@ -0,0 +1,38 @@ +#!/bin/sh + +# 9.Cached table there in csql, but join with another noncached table in MySQL. 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 +isql myodbc3 < $REL_PATH/mysqlinputtest8.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/join.sql + +isql myodbc3 < $REL_PATH/dropall.sql > /dev/null 2>&1 +kill -9 $pid +ipcrm -M 1199 -M 2277 +rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db +touch /tmp/csql/csqltable.conf /tmp/csql/csql.db +exit 0; -- 2.11.4.GIT