~drizzle-trunk/drizzle/jenkins-Drizzle-Builder-73

« back to all changes in this revision

Viewing changes to tests/qp_tests/sysbench/sysbench_readwrite_test.py

  • Committer: Continuous Integration
  • Date: 2012-08-22 16:46:57 UTC
  • mfrom: (2582.1.1 qp-sysbench-gsoc)
  • Revision ID: ci@drizzle.org-20120822164657-kscwyfppucshsl7v
added:
  tests/lib/util/database_connect.py
  tests/lib/util/drizzleslap_methods.py
  tests/lib/util/mailing_report.py
  tests/lib/util/sysbenchTestCase.py
  tests/qp_tests/drizzleslap/
  tests/qp_tests/drizzleslap/drizzleslap_test.py
  tests/qp_tests/sysbench/sysbench_readwrite_test.py
  tests/std_data/sysbench_db.sql
modified:
  docs/testing/kewpie.rst
  docs/testing/sysbench.rst
  tests/lib/modes/native/native_test_execution.py
  tests/lib/opts/test_run_options.py
  tests/lib/server_mgmt/drizzled.py
  tests/lib/server_mgmt/server.py
  tests/lib/sys_mgmt/system_management.py
  tests/lib/util/crashme_methods.py
  tests/lib/util/mysql_methods.py
  tests/lib/util/sysbench_methods.py
  tests/qp_tests/crashme/crashme_test.py
  tests/qp_tests/sqlbench/sqlbench_test.py
  tests/qp_tests/sysbench/sysbench_readonly_test.py
pending merge tips: (use -v to see all merge revisions)
  M.Sharan Kumar 2012-08-21 [merge] This branch consists of the work done in connection with GSoC.

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
# Copyright (C) 2012 M.Sharan Kumar
 
7
#
 
8
#
 
9
# This program is free software; you can redistribute it and/or modify
 
10
# it under the terms of the GNU General Public License as published by
 
11
# the Free Software Foundation; either version 2 of the License, or
 
12
# (at your option) any later version.
 
13
#
 
14
# This program is distributed in the hope that it will be useful,
 
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
# GNU General Public License for more details.
 
18
#
 
19
# You should have received a copy of the GNU General Public License
 
20
# along with this program; if not, write to the Free Software
 
21
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
22
 
 
23
import re
 
24
import time
 
25
import socket
 
26
import subprocess
 
27
import datetime
 
28
from copy import deepcopy
 
29
 
 
30
from lib.util.sysbench_methods import prepare_sysbench
 
31
from lib.util.sysbench_methods import execute_sysbench
 
32
from lib.util.sysbench_methods import process_sysbench_output
 
33
from lib.util.sysbench_methods import sysbench_db_analysis
 
34
from lib.util.sysbench_methods import getSysbenchReport
 
35
from lib.util.sysbenchTestCase import sysbenchTestCase
 
36
from lib.util.database_connect import results_db_connect
 
37
from lib.util.mailing_report   import sendMail
 
38
 
 
39
# TODO:  make server_options vary depending on the type of server being used here
 
40
# drizzle options
 
41
server_requirements = [['innodb.buffer-pool-size=256M innodb.log-file-size=64M innodb.log-buffer-size=8M innodb.thread-concurrency=0 innodb.additional-mem-pool-size=16M table-open-cache=4096 table-definition-cache=4096 mysql-protocol.max-connections=2048']]
 
42
 
 
43
# mysql options
 
44
#server_requirements = [['innodb_buffer_pool_size=256M innodb_log_file_size=64M innodb_log_buffer_size=8M innodb_thread_concurrency=0 innodb_additional_mem_pool_size=16M table_open_cache=4096 table_definition_cache=4096 max_connections=2048']]
 
45
 
 
46
servers = []
 
47
server_manager = None
 
48
test_executor = None
 
49
 
 
50
class basicTest(sysbenchTestCase):
 
51
 
 
52
    def test_sysbench_readonly(self):
 
53
 
 
54
        # defining the test command
 
55
        master_server = servers[0]
 
56
        self.config_name = 'innodb_1000K_readonly'
 
57
        test_cmd = [ "sysbench"
 
58
                   , "--max-time=240"
 
59
                   , "--max-requests=0"
 
60
                   , "--test=oltp"
 
61
                   , "--db-ps-mode=disable"
 
62
                   , "--%s-table-engine=innodb" %master_server.type
 
63
                   , "--oltp-read-only=off"
 
64
                   , "--oltp-table-size=1000000"
 
65
                   , "--%s-user=root" %master_server.type
 
66
                   , "--%s-db=test" %master_server.type
 
67
                   , "--%s-port=%d" %(master_server.type, master_server.master_port)
 
68
                   , "--%s-host=localhost" %master_server.type
 
69
                   , "--db-driver=%s" %master_server.type
 
70
                   ] 
 
71
 
 
72
        if master_server.type == 'drizzle':
 
73
            test_cmd.append("--drizzle-mysql=on")
 
74
        if master_server.type == 'mysql':
 
75
            test_cmd.append("--mysql-socket=%s" %master_server.socket_file)
 
76
 
 
77
        # preparing sysbench_readonly test
 
78
        self.prepareSysbench(test_cmd,test_executor,servers)
 
79
 
 
80
        # start the test!
 
81
        # this method takes care of *running* the test and *saving* the test results
 
82
        self.executeSysbench()
 
83
 
 
84
        # reporting the test result
 
85
        # this method handles *dsn_string* and *mail_tgt*
 
86
        self.reportTestData(dsn_string,mail_tgt)
 
87
 
 
88
    def tearDown(self):
 
89
            server_manager.reset_servers(test_executor.name)