~patrick-crews/dbqp/dbqp_out_of_source

« back to all changes in this revision

Viewing changes to percona_tests/randgen_basic/query_cache_strip_comments_test.py

Merge stewart's work on bug856404 query_cache_strip_comments

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/env python
 
2
# -*- mode: python; indent-tabs-mode: nil; -*-
 
3
# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
 
4
#
 
5
# Copyright (C) 2011 Patrick Crews
 
6
#
 
7
#
 
8
# This program is free software; you can redistribute it and/or modify
 
9
# it under the terms of the GNU General Public License as published by
 
10
# the Free Software Foundation; either version 2 of the License, or
 
11
# (at your option) any later version.
 
12
#
 
13
# This program is distributed in the hope that it will be useful,
 
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
# GNU General Public License for more details.
 
17
#
 
18
# You should have received a copy of the GNU General Public License
 
19
# along with this program; if not, write to the Free Software
 
20
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
21
 
 
22
import unittest
 
23
import subprocess
 
24
import os
 
25
 
 
26
from lib.util.randgen_methods import execute_randgen
 
27
 
 
28
server_requirements = [["--query-cache-size=10M --query-cache-strip-comments"]]
 
29
servers = []
 
30
server_manager = None
 
31
test_executor = None
 
32
 
 
33
class InnoDBDictSizeTest(unittest.TestCase):
 
34
 
 
35
    #def setUp(self):
 
36
    #    """ If we need to do anything pre-test, we do it here.
 
37
    #        Any code here is executed before any test method we
 
38
    #        may execute
 
39
    #
 
40
    #    """
 
41
 
 
42
    #    return
 
43
 
 
44
 
 
45
    def test_OptimizerSubquery1(self):
 
46
        test_cmd = "./gentest.pl --gendata=conf/percona/query_cache_strip_comments.zz --grammar=conf/percona/query_cache_strip_comments.yy --queries=1000 --threads=2"
 
47
        retcode, output = execute_randgen(test_cmd, test_executor, servers)
 
48
        self.assertTrue(retcode==0, output)
 
49
 
 
50
    def tearDown(self):
 
51
            server_manager.reset_servers(test_executor.name)
 
52
 
 
53
 
 
54
def run_test(output_file):
 
55
    suite = unittest.TestLoader().loadTestsFromTestCase(InnoDBDictSizeTest)
 
56
    return unittest.TextTestRunner(stream=output_file, verbosity=2).run(suite)
 
57