Beispiel #1
0
    def test_run_all_sqlbench(self):
        test_cmd = "$SQLBENCH_DIR/run-all-tests --server=drizzle --dir=$DRIZZLE_TEST_WORKDIR --log --connect-options=port=$MASTER_MYPORT --create-options=ENGINE=innodb --user=root"

        test_status, retcode, output = execute_sqlbench(test_cmd, test_executor, servers)
        self.assertEqual(retcode, 0, msg = output)
        self.assertEqual(test_status, 'pass', msg = output)

        # sending test report via mail
        if mail_tgt:
            kewpieSendMail(test_executor,mail_tgt,test_status)
Beispiel #2
0
    def test_run_all_sqlbench(self):
        test_cmd = "$SQLBENCH_DIR/run-all-tests --server=drizzle --dir=$DRIZZLE_TEST_WORKDIR --log --connect-options=port=$MASTER_MYPORT --create-options=ENGINE=innodb --user=root"

        test_status, retcode, output = execute_sqlbench(
            test_cmd, test_executor, servers)
        self.assertEqual(retcode, 0, msg=output)
        self.assertEqual(test_status, 'pass', msg=output)

        # sending test report via mail
        if mail_tgt:
            kewpieSendMail(test_executor, mail_tgt, test_status)
Beispiel #3
0
    def test_runCrashme(self):
        master_server = servers[0]
        system_manager = test_executor.system_manager
        test_cmd = [ "%s/crash-me " %(os.path.join(system_manager.testdir, 'test_tools/sql-bench'))
                   , "--server=drizzled "
                   , "--host=127.0.0.1 "
                   , "--force "
                   , "--dir=%s " %system_manager.workdir
                   , "--connect-options=port=%s " %(master_server.master_port)
                   , "--verbose "
                   , "--debug "
                   , "--user=root "
                   , "--batch-mode"
                   ]
        test_cmd = " ".join(test_cmd)
        test_status, retcode, output = execute_crashme(test_cmd, test_executor, master_server)
        self.assertEqual(retcode, 0, msg = output)
        self.assertEqual(test_status, 'pass', msg = output)
        print "output:%s" % test_status
        crashme_report="BENCHMARK EXECUTED: crashme\nTEST RESULT:%s"%test_status
        print crashme_report

        if mail_tgt:
            kewpieSendMail(test_executor,mail_tgt,test_status)
Beispiel #4
0
    def test_drizzleslap(self):
        self.logging = test_executor.logging
        master_server = servers[0]
        
        # test group
        test_groups = ['guid','guid-scale',
                      'key','key-scale',
                      'mixed','mixed-commit','mixed-commit-scale','mixed-scale',
                      'scan','scan-scale',
                      'update','update-commit','update-commit-scale','update-scale',
                      'write','write-commit','write-commit-scale','write-scale']

        # test options specific to each test group
        test_options = {'guid':" --auto-generate-sql-guid-primary --auto-generate-sql-load-type=write --number-of-queries=100000",
                        'guid-scale':" --auto-generate-sql-guid-primary --auto-generate-sql-load-type=write --auto-generate-sql-execute-number=1000",
                        'key':"--auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=key --number-of-queries=100000",
                        'key-scale':"--auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=key --auto-generate-sql-execute-number=1000",
                        'mixed':" --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=mixed --number-of-queries=100000",
                        'mixed-commit':" --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=mixed --number-of-queries=100000 --commit=8",
                        'mixed-commit-scale':" --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=mixed --auto-generate-sql-execute-number=1000 --commit=8",
                        'mixed-scale':" --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=mixed --auto-generate-sql-execute-number=1000",
                        'scan':" --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=read --number-of-queries=100000",
                        'scan-scale':" --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=read --auto-generate-sql-execute-number=1000",
                        'update':" --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=update --number-of-queries=100000 --auto-generate-sql-write-number=50000",
                        'update-commit':"  --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=update --number-of-queries=100000 --auto-generate-sql-write-number=50000 --commit=8 ",
                        'update-commit-scale':" --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=update --auto-generate-sql-execute-number=1000  --auto-generate-sql-write-number=50000 --commit=8 ",
                        'update-scale':" --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=update --auto-generate-sql-execute-number=1000 --auto-generate-sql-write-number=50000",
                        'write':"--auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --number-of-queries=100000",
                        'write-commit':" --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --number-of-queries=100000 --commit=8",
                        'write-commit-scale':"--auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --auto-generate-sql-execute-number=1000 --commit=8 ",
                        'write-scale':" --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --auto-generate-sql-execute-number=1000" 
                       } 

        # our base test command
        test_cmd = [ "drizzleslap_tests"
                   , "--%s-table-engine=innodb" %master_server.type
                   , "--%s-user=root" %master_server.type
                   , "--%s-db=test" %master_server.type
                   , "--%s-port=%d" %(master_server.type, master_server.master_port)
                   , "--%s-host=localhost" %master_server.type
                   , "--db-driver=%s" %master_server.type
                   ]

        if master_server.type == 'drizzle':
            test_cmd.append("--drizzle-mysql=on")
        if master_server.type == 'mysql':
            test_cmd.append("--mysql-socket=%s" %master_server.socket_file)
       
        # We sleep for a minute to wait
        time.sleep(10) 
        # how many times to run drizzleslap at each concurrency
        iterations = 10
        
        # setting concurreny for drizzleslap. This concurrency is fixed
        concurrencies = [50]


        # we setup once.  This is a readwrite test and we don't
        # alter the test bed once it is created
        exec_cmd = " ".join(test_cmd)
        retcode, output = prepare_drizzleslap(test_executor, exec_cmd)
        err_msg = ("drizzleslap 'prepare' phase failed.\n"
                   "retcode:  %d"
                   "output:  %s" %(retcode,output))
        self.assertEqual(retcode, 0, msg = err_msg) 

        # start the test!
        for concurrency in concurrencies:
            
            for group in test_groups:
                exec_cmd = " ".join(test_cmd)
                exec_cmd = exec_cmd.join(test_options[group])
                exec_cmd += "--num-threads=%d" %concurrency

                for test_iteration in range(iterations): 

                    retcode, output = execute_drizzleslap(test_executor, exec_cmd)
                    self.assertEqual(retcode, 0, msg = output)
                    parsed_output = process_drizzleslap_output(output)
                    self.logging.info(parsed_output)

                    #gathering the data from the output
# TODO
                    regexes={
                      'run_id':re.compile()
                    , 'engine_name':re.compile()
                    , 'test_name':re.compile()
                    , 'queries_average':re.compile()
                    , 'queries_min':re.compile()
                    , 'queries_max':re.compile()
                    , 'total_time':re.compile()
                    , 'stddev':re.compile()
                    , 'iterations':re.compile()
                    , 'concurrency':re.compile()
                    , 'concurrency2':re.compile()
                    , 'queries_per_client':re.compile()
                    }
            
                    run={}
                    for line in output.split("\n"):
                        for key in regexes:
                            result=regexes[key].match(line)
                            if result:
                                run[key]=float(result.group(1))
          

                    # fetching test results from results_db database
                    sql_select="SELECT * FROM drizzleslap_run_iterations WHERE concurrency=%d AND iteration=%d" % (concurrency,test_iteration)
                    self.logging.info("dsn_string:%s" % dsn_string)
                    fetch=results_db_connect(dsn_string,"select",sql_select)
                    fetch['concurrency']=concurrency
                    fetch['iteration']=test_iteration

                    # deleting record with current concurrency and iteration
                    if fetch['concurrency']==concurrency and fetch['iteration']==test_iteration:
                        sql_delete="DELETE FROM drizzleslap_run_iterations WHERE concurrency=%d AND iteration=%d" % (concurrency,test_iteration)
                        results_db_connect(dsn_string,"delete",sql_delete)
            
                    # updating the results_db database with test results
                    # it for historical comparison over the life of the code...
                    sql_insert="""INSERT INTO  drizzleslap_run_iterations VALUES (%d,'%s','%s',%0.3f,%0.3f,%0.3f,%0.3f,%0.3f,%d,%d,%d,%d )""" % ( 
                                                                           run['run_id'],
                                                                           run['engine_name'],
                                                                           run['test_name'],
                                                                           float(run['queries_avg']),
                                                                           float(run['queries_min']),
                                                                           float(run['queries_max']),
                                                                           float(run['total_time']),
                                                                           float(run['stddev']),
                                                                           int(run['iterations']),
                                                                           int(run['concurrency']),
                                                                           int(run['concurrency2']),
                                                                           int(run['queries_per_client']) )
            
                    results_db_connect(dsn_string,"insert",sql_insert)

#TODO get drizzleslap test result ( should modify this and add util method too )
                #getting test result as report for sysbench
                sys_report=getSysbenchReport(run,fetch)
           
                #mailing sysbench report
                if mail_tgt:
                  kewpieSendMail(test_executor,mail_tgt,sys_report)
Beispiel #5
0
    def test_drizzleslap(self):
        self.logging = test_executor.logging
        master_server = servers[0]

        # test group
        test_groups = [
            'guid', 'guid-scale', 'key', 'key-scale', 'mixed', 'mixed-commit',
            'mixed-commit-scale', 'mixed-scale', 'scan', 'scan-scale',
            'update', 'update-commit', 'update-commit-scale', 'update-scale',
            'write', 'write-commit', 'write-commit-scale', 'write-scale'
        ]

        # test options specific to each test group
        test_options = {
            'guid':
            " --auto-generate-sql-guid-primary --auto-generate-sql-load-type=write --number-of-queries=100000",
            'guid-scale':
            " --auto-generate-sql-guid-primary --auto-generate-sql-load-type=write --auto-generate-sql-execute-number=1000",
            'key':
            "--auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=key --number-of-queries=100000",
            'key-scale':
            "--auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=key --auto-generate-sql-execute-number=1000",
            'mixed':
            " --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=mixed --number-of-queries=100000",
            'mixed-commit':
            " --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=mixed --number-of-queries=100000 --commit=8",
            'mixed-commit-scale':
            " --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=mixed --auto-generate-sql-execute-number=1000 --commit=8",
            'mixed-scale':
            " --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=mixed --auto-generate-sql-execute-number=1000",
            'scan':
            " --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=read --number-of-queries=100000",
            'scan-scale':
            " --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=read --auto-generate-sql-execute-number=1000",
            'update':
            " --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=update --number-of-queries=100000 --auto-generate-sql-write-number=50000",
            'update-commit':
            "  --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=update --number-of-queries=100000 --auto-generate-sql-write-number=50000 --commit=8 ",
            'update-commit-scale':
            " --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=update --auto-generate-sql-execute-number=1000  --auto-generate-sql-write-number=50000 --commit=8 ",
            'update-scale':
            " --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=update --auto-generate-sql-execute-number=1000 --auto-generate-sql-write-number=50000",
            'write':
            "--auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --number-of-queries=100000",
            'write-commit':
            " --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --number-of-queries=100000 --commit=8",
            'write-commit-scale':
            "--auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --auto-generate-sql-execute-number=1000 --commit=8 ",
            'write-scale':
            " --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --auto-generate-sql-execute-number=1000"
        }

        # our base test command
        test_cmd = [
            "drizzleslap_tests",
            "--%s-table-engine=innodb" % master_server.type,
            "--%s-user=root" % master_server.type,
            "--%s-db=test" % master_server.type,
            "--%s-port=%d" % (master_server.type, master_server.master_port),
            "--%s-host=localhost" % master_server.type,
            "--db-driver=%s" % master_server.type
        ]

        if master_server.type == 'drizzle':
            test_cmd.append("--drizzle-mysql=on")
        if master_server.type == 'mysql':
            test_cmd.append("--mysql-socket=%s" % master_server.socket_file)

        # We sleep for a minute to wait
        time.sleep(10)
        # how many times to run drizzleslap at each concurrency
        iterations = 10

        # setting concurreny for drizzleslap. This concurrency is fixed
        concurrencies = [50]

        # we setup once.  This is a readwrite test and we don't
        # alter the test bed once it is created
        exec_cmd = " ".join(test_cmd)
        retcode, output = prepare_drizzleslap(test_executor, exec_cmd)
        err_msg = ("drizzleslap 'prepare' phase failed.\n"
                   "retcode:  %d"
                   "output:  %s" % (retcode, output))
        self.assertEqual(retcode, 0, msg=err_msg)

        # start the test!
        for concurrency in concurrencies:

            for group in test_groups:
                exec_cmd = " ".join(test_cmd)
                exec_cmd = exec_cmd.join(test_options[group])
                exec_cmd += "--num-threads=%d" % concurrency

                for test_iteration in range(iterations):

                    retcode, output = execute_drizzleslap(
                        test_executor, exec_cmd)
                    self.assertEqual(retcode, 0, msg=output)
                    parsed_output = process_drizzleslap_output(output)
                    self.logging.info(parsed_output)

                    #gathering the data from the output
                    # TODO
                    regexes = {
                        'run_id': re.compile(),
                        'engine_name': re.compile(),
                        'test_name': re.compile(),
                        'queries_average': re.compile(),
                        'queries_min': re.compile(),
                        'queries_max': re.compile(),
                        'total_time': re.compile(),
                        'stddev': re.compile(),
                        'iterations': re.compile(),
                        'concurrency': re.compile(),
                        'concurrency2': re.compile(),
                        'queries_per_client': re.compile()
                    }

                    run = {}
                    for line in output.split("\n"):
                        for key in regexes:
                            result = regexes[key].match(line)
                            if result:
                                run[key] = float(result.group(1))

                    # fetching test results from results_db database
                    sql_select = "SELECT * FROM drizzleslap_run_iterations WHERE concurrency=%d AND iteration=%d" % (
                        concurrency, test_iteration)
                    self.logging.info("dsn_string:%s" % dsn_string)
                    fetch = results_db_connect(dsn_string, "select",
                                               sql_select)
                    fetch['concurrency'] = concurrency
                    fetch['iteration'] = test_iteration

                    # deleting record with current concurrency and iteration
                    if fetch['concurrency'] == concurrency and fetch[
                            'iteration'] == test_iteration:
                        sql_delete = "DELETE FROM drizzleslap_run_iterations WHERE concurrency=%d AND iteration=%d" % (
                            concurrency, test_iteration)
                        results_db_connect(dsn_string, "delete", sql_delete)

                    # updating the results_db database with test results
                    # it for historical comparison over the life of the code...
                    sql_insert = """INSERT INTO  drizzleslap_run_iterations VALUES (%d,'%s','%s',%0.3f,%0.3f,%0.3f,%0.3f,%0.3f,%d,%d,%d,%d )""" % (
                        run['run_id'], run['engine_name'], run['test_name'],
                        float(run['queries_avg']), float(run['queries_min']),
                        float(run['queries_max']), float(run['total_time']),
                        float(run['stddev']), int(run['iterations']),
                        int(run['concurrency']), int(run['concurrency2']),
                        int(run['queries_per_client']))

                    results_db_connect(dsn_string, "insert", sql_insert)

#TODO get drizzleslap test result ( should modify this and add util method too )
#getting test result as report for sysbench
                sys_report = getSysbenchReport(run, fetch)

                #mailing sysbench report
                if mail_tgt:
                    kewpieSendMail(test_executor, mail_tgt, sys_report)