Add test of white/black_memqcache_table_list to regress #006
authorYugo Nagata <nagata@sraoss.co.jp>
Thu, 21 Jan 2016 02:16:28 +0000 (11:16 +0900)
committerYugo Nagata <nagata@sraoss.co.jp>
Thu, 21 Jan 2016 02:17:55 +0000 (11:17 +0900)
test/regression/tests/006.memqcache/test.sh

index 34984b80e1f4042ad6013a553cc98f0abf9dd505..7609abbef30beab6058d8abc9a677c2a7234f31c 100755 (executable)
@@ -20,6 +20,8 @@ do
        echo "done."
 
        echo "memory_cache_enabled = on" >> etc/pgpool.conf
+       echo "white_memqcache_table_list = 'white_v'" >> etc/pgpool.conf
+       echo "black_memqcache_table_list = 'black_t'" >> etc/pgpool.conf
 
        source ./bashrc.ports
 
@@ -36,8 +38,25 @@ do
 
        psql test <<EOF
 CREATE TABLE t1 (i int);
+CREATE TABLE black_t (i int);
+CREATE VIEW normal_v AS SELECT * FROM t1;
+CREATE VIEW white_v AS SELECT * FROM t1;
+
+SELECT * FROM t1;
+SELECT * FROM t1;
+SELECT * FROM black_t;
+SELECT * FROM black_t;
+SELECT * FROM normal_v;
+SELECT * FROM normal_v;
+SELECT * FROM white_v;
+SELECT * FROM white_v;
 EOF
 
+       grep "fetched from cache" log/pgpool.log | grep t1 > /dev/null || exit 1
+       grep "fetched from cache" log/pgpool.log | grep black_t > /dev/null && exit 1
+       grep "fetched from cache" log/pgpool.log | grep normal_v > /dev/null && exit 1
+       grep "fetched from cache" log/pgpool.log | grep white_v > /dev/null || exit 1
+
        java jdbctest > result.txt 2>&1
        cmp ../expected.txt result.txt
        if [ $? != 0 ];then