Merge lp:~patrick-crews/drizzle/qp-cleanup into lp:drizzle
- qp-cleanup
- Merge into 7.2
Proposed by
Patrick Crews
Status: | Merged |
---|---|
Approved by: | Brian Aker |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2563 |
Proposed branch: | lp:~patrick-crews/drizzle/qp-cleanup |
Merge into: | lp:drizzle |
Diff against target: |
144460 lines (+334/-140749) 626 files modified
.bzrignore (+2/-5) tests/crashme_tests/main/crashme.cnf (+0/-8) tests/dbqp.py (+0/-102) tests/include.am (+26/-62) tests/kewpie.py (+2/-2) tests/kewpie/.bzrignore (+0/-5) tests/kewpie/lib/modes/sysbench/sysbench_test_execution.py (+0/-162) tests/kewpie/lib/modes/sysbench/sysbench_test_management.py (+0/-159) tests/kewpie/sysbench_tests/readonly/concurrency_1024.cnf (+0/-8) tests/kewpie/sysbench_tests/readonly/concurrency_128.cnf (+0/-8) tests/kewpie/sysbench_tests/readonly/concurrency_16.cnf (+0/-8) tests/kewpie/sysbench_tests/readonly/concurrency_256.cnf (+0/-8) tests/kewpie/sysbench_tests/readonly/concurrency_32.cnf (+0/-8) tests/kewpie/sysbench_tests/readonly/concurrency_512.cnf (+0/-8) tests/kewpie/sysbench_tests/readonly/concurrency_64.cnf (+0/-8) tests/kewpie/sysbench_tests/readwrite/concurrency_1024.cnf (+0/-8) tests/kewpie/sysbench_tests/readwrite/concurrency_128.cnf (+0/-8) tests/kewpie/sysbench_tests/readwrite/concurrency_16.cnf (+0/-8) tests/kewpie/sysbench_tests/readwrite/concurrency_256.cnf (+0/-8) tests/kewpie/sysbench_tests/readwrite/concurrency_32.cnf (+0/-8) tests/kewpie/sysbench_tests/readwrite/concurrency_512.cnf (+0/-8) tests/kewpie/sysbench_tests/readwrite/concurrency_64.cnf (+0/-8) tests/lib/dbqp_modes/crashme/crashme_test_execution.py (+0/-140) tests/lib/dbqp_modes/crashme/crashme_test_management.py (+0/-189) tests/lib/dbqp_modes/dtr/dtr_test_execution.py (+0/-139) tests/lib/dbqp_modes/dtr/dtr_test_management.py (+0/-495) tests/lib/dbqp_modes/randgen/randgen_test_execution.py (+0/-104) tests/lib/dbqp_modes/randgen/randgen_test_management.py (+0/-146) tests/lib/dbqp_modes/sqlbench/sqlbench_test_execution.py (+0/-115) tests/lib/dbqp_modes/sqlbench/sqlbench_test_management.py (+0/-189) tests/lib/dbqp_modes/sysbench/sysbench_test_execution.py (+0/-162) tests/lib/dbqp_modes/sysbench/sysbench_test_management.py (+0/-159) tests/lib/dbqp_modes/test_mode.py (+0/-68) tests/lib/dbqp_opts/test_run_options.py (+0/-507) tests/lib/modes/native/native_test_management.py (+1/-5) tests/lib/opts/defaults.py (+61/-3) tests/lib/opts/test_run_options.py (+8/-8) tests/lib/server_mgmt/drizzled.py (+0/-227) tests/lib/server_mgmt/mysqld.py (+0/-233) tests/lib/server_mgmt/server.py (+0/-159) tests/lib/server_mgmt/server_management.py (+0/-584) tests/lib/sys_mgmt/codeTree.py (+0/-357) tests/lib/sys_mgmt/code_management.py (+0/-98) tests/lib/sys_mgmt/environment_management.py (+0/-99) tests/lib/sys_mgmt/logging_management.py (+0/-128) tests/lib/sys_mgmt/port_management.py (+0/-193) tests/lib/sys_mgmt/system_management.py (+0/-506) tests/lib/sys_mgmt/time_management.py (+0/-118) tests/lib/test_mgmt/execution_management.py (+0/-141) tests/lib/test_mgmt/test_execution.py (+0/-283) tests/lib/test_mgmt/test_management.py (+0/-300) tests/lib/util/sysbench_methods.py (+149/-0) tests/qp_tests/sysbench/sysbench_readonly_test.py (+85/-0) tests/randgen/Contributors (+0/-22) tests/randgen/LICENSE (+0/-339) tests/randgen/README (+0/-28) tests/randgen/backtrace-all.gdb (+0/-19) tests/randgen/backtrace.gdb (+0/-21) tests/randgen/bench/WL5004_sql.yy (+0/-1656) tests/randgen/bench/benchmark.pl (+0/-75) tests/randgen/bench/falcon_data_types.zz (+0/-34) tests/randgen/bughunt_template.cfg (+0/-207) tests/randgen/combinations.pl (+0/-202) tests/randgen/conf/backup/backup_interop.yy (+0/-92) tests/randgen/conf/backup/backup_obj.yy (+0/-132) tests/randgen/conf/backup/backup_simple.yy (+0/-50) tests/randgen/conf/backup/invariant.yy (+0/-279) tests/randgen/conf/backup/invariant.zz (+0/-56) tests/randgen/conf/dbt3/dbt3-dml.yy (+0/-475) tests/randgen/conf/dbt3/dbt3-joins.yy (+0/-465) tests/randgen/conf/dbt3/dbt3-ranges.yy (+0/-219) tests/randgen/conf/dbt3/dbt3-s0.0001.dump (+0/-41) tests/randgen/conf/dbt3/dbt3-s0.001.dump (+0/-310) tests/randgen/conf/drizzle/bug680669.yy (+0/-246) tests/randgen/conf/drizzle/collations_drizzle.yy (+0/-49) tests/randgen/conf/drizzle/combinations_drizzle.zz (+0/-34) tests/randgen/conf/drizzle/data_dict_concurrent_drizzle.yy (+0/-114) tests/randgen/conf/drizzle/drizzle.yy (+0/-34) tests/randgen/conf/drizzle/drizzle.zz (+0/-44) tests/randgen/conf/drizzle/drizzledump.yy (+0/-167) tests/randgen/conf/drizzle/drizzledump_migrate.yy (+0/-204) tests/randgen/conf/drizzle/drizzledump_migrate.zz (+0/-51) tests/randgen/conf/drizzle/limit_compare_drizzle.yy (+0/-111) tests/randgen/conf/drizzle/many_indexes_drizzle.yy (+0/-55) tests/randgen/conf/drizzle/many_indexes_drizzle.zz (+0/-32) tests/randgen/conf/drizzle/optimizer_subquery_data_dictionary_drizzle.yy (+0/-867) tests/randgen/conf/drizzle/optimizer_subquery_drizzle.yy (+0/-802) tests/randgen/conf/drizzle/outer_join_data_dictionary_drizzle.yy (+0/-337) tests/randgen/conf/drizzle/outer_join_drizzle.yy (+0/-273) tests/randgen/conf/drizzle/outer_join_drizzle.zz (+0/-33) tests/randgen/conf/drizzle/outer_join_portable_drizzle.yy (+0/-335) tests/randgen/conf/drizzle/proclist_drizzle.yy (+0/-119) tests/randgen/conf/drizzle/proclist_subquery_drizzle.yy (+0/-794) tests/randgen/conf/drizzle/range_access_drizzle.yy (+0/-390) tests/randgen/conf/drizzle/range_access_drizzle.zz (+0/-34) tests/randgen/conf/drizzle/subquery_drizzle.yy (+0/-220) tests/randgen/conf/drizzle/subquery_materialization_drizzle.yy (+0/-169) tests/randgen/conf/drizzle/subquery_semijoin_drizzle.yy (+0/-165) tests/randgen/conf/drizzle/subquery_semijoin_nested_drizzle.yy (+0/-208) tests/randgen/conf/drizzle/translog_concurrent1.yy (+0/-227) tests/randgen/conf/drizzle/translog_concurrent2.yy (+0/-221) tests/randgen/conf/drizzle/translog_concurrent3.yy (+0/-242) tests/randgen/conf/drizzle/translog_drizzle.zz (+0/-44) tests/randgen/conf/drizzle/translog_ordering.yy (+0/-25) tests/randgen/conf/drizzle/translog_ordering.zz (+0/-44) tests/randgen/conf/drizzle/varchar_drizzle.zz (+0/-32) tests/randgen/conf/dyncol/dyncol_dml.yy (+0/-118) tests/randgen/conf/dyncol/dyncol_dml.zz (+0/-16) tests/randgen/conf/engines/blobs.yy (+0/-35) tests/randgen/conf/engines/engine_stress.yy (+0/-134) tests/randgen/conf/engines/engine_stress.zz (+0/-30) tests/randgen/conf/engines/falcon/falcon_backlog.yy (+0/-40) tests/randgen/conf/engines/falcon/falcon_backlog.zz (+0/-34) tests/randgen/conf/engines/falcon/falcon_blobs.yy (+0/-37) tests/randgen/conf/engines/falcon/falcon_blobs.zz (+0/-28) tests/randgen/conf/engines/falcon/falcon_chill_thaw.yy (+0/-48) tests/randgen/conf/engines/falcon/falcon_chill_thaw.zz (+0/-30) tests/randgen/conf/engines/falcon/falcon_data_types.yy (+0/-56) tests/randgen/conf/engines/falcon/falcon_data_types.zz (+0/-34) tests/randgen/conf/engines/falcon/falcon_data_types_no_year_time.yy (+0/-60) tests/randgen/conf/engines/falcon/falcon_data_types_no_year_time.zz (+0/-36) tests/randgen/conf/engines/falcon/falcon_ddl.yy (+0/-114) tests/randgen/conf/engines/falcon/falcon_limit.yy (+0/-95) tests/randgen/conf/engines/falcon/falcon_nolimit.yy (+0/-64) tests/randgen/conf/engines/falcon/falcon_nolimit_int.yy (+0/-63) tests/randgen/conf/engines/falcon/falcon_online_alter.yy (+0/-57) tests/randgen/conf/engines/falcon/falcon_pagesize.yy (+0/-60) tests/randgen/conf/engines/falcon/falcon_pagesize2K.zz (+0/-34) tests/randgen/conf/engines/falcon/falcon_pagesize32K.zz (+0/-34) tests/randgen/conf/engines/falcon/falcon_recovery.yy (+0/-187) tests/randgen/conf/engines/falcon/falcon_recovery.zz (+0/-31) tests/randgen/conf/engines/falcon/falcon_replication.yy (+0/-64) tests/randgen/conf/engines/falcon/falcon_replication.zz (+0/-37) tests/randgen/conf/engines/falcon/falcon_select_autocommit.yy (+0/-19) tests/randgen/conf/engines/falcon/falcon_simple.cc (+0/-74) tests/randgen/conf/engines/falcon/falcon_varchar.cc (+0/-76) tests/randgen/conf/engines/falcon/limit_compare.yy (+0/-75) tests/randgen/conf/engines/handler.yy (+0/-85) tests/randgen/conf/engines/handler.zz (+0/-15) tests/randgen/conf/engines/heap/heap_ddl_multi.yy (+0/-169) tests/randgen/conf/engines/heap/heap_dml_single.init (+0/-23) tests/randgen/conf/engines/heap/heap_dml_single.yy (+0/-102) tests/randgen/conf/engines/innodb/innodb_simple.cc (+0/-71) tests/randgen/conf/engines/many_indexes.yy (+0/-64) tests/randgen/conf/engines/many_indexes.zz (+0/-35) tests/randgen/conf/engines/maria/maria.zz (+0/-33) tests/randgen/conf/engines/maria/maria_bulk_insert.yy (+0/-35) tests/randgen/conf/engines/maria/maria_dml_alter.yy (+0/-73) tests/randgen/conf/engines/maria/maria_mostly_selects.yy (+0/-70) tests/randgen/conf/engines/maria/maria_recovery.cc (+0/-80) tests/randgen/conf/engines/maria/maria_stress.yy (+0/-65) tests/randgen/conf/engines/tiny_inserts.yy (+0/-24) tests/randgen/conf/engines/tiny_inserts.zz (+0/-26) tests/randgen/conf/engines/varchar.yy (+0/-52) tests/randgen/conf/engines/varchar.zz (+0/-36) tests/randgen/conf/examples/example.ff (+0/-22) tests/randgen/conf/examples/example.yy (+0/-31) tests/randgen/conf/examples/example.zz (+0/-37) tests/randgen/conf/examples/flightstats.yy (+0/-270) tests/randgen/conf/hivol/hivol_fbase_small.yy (+0/-209) tests/randgen/conf/hivol/hivol_film.yy (+0/-450) tests/randgen/conf/i18n/collations.yy (+0/-39) tests/randgen/conf/optimizer/archive/subquery_materialization.yy (+0/-171) tests/randgen/conf/optimizer/archive/subquery_semijoin.yy (+0/-167) tests/randgen/conf/optimizer/archive/subquery_semijoin_nested.yy (+0/-219) tests/randgen/conf/optimizer/dsmrr-cpk-compare.cc (+0/-52) tests/randgen/conf/optimizer/dsmrr-cpk-single.cc (+0/-66) tests/randgen/conf/optimizer/dsmrr-cpk.ff (+0/-8) tests/randgen/conf/optimizer/intersect.ff (+0/-3) tests/randgen/conf/optimizer/join_buffer.ff (+0/-3) tests/randgen/conf/optimizer/mrr-single.cc (+0/-56) tests/randgen/conf/optimizer/mrr.ff (+0/-3) tests/randgen/conf/optimizer/optimizer_access_exp.yy (+0/-411) tests/randgen/conf/optimizer/optimizer_no_subquery.yy (+0/-450) tests/randgen/conf/optimizer/optimizer_no_subquery_portable.yy (+0/-421) tests/randgen/conf/optimizer/optimizer_subquery.yy (+0/-806) tests/randgen/conf/optimizer/optimizer_subquery_no_outer_join.yy (+0/-800) tests/randgen/conf/optimizer/optimizer_subquery_portable.yy (+0/-770) tests/randgen/conf/optimizer/outer_join.yy (+0/-277) tests/randgen/conf/optimizer/outer_join.zz (+0/-34) tests/randgen/conf/optimizer/outer_join_portable.yy (+0/-340) tests/randgen/conf/optimizer/range_access.ff (+0/-3) tests/randgen/conf/optimizer/range_access.yy (+0/-396) tests/randgen/conf/optimizer/range_access.zz (+0/-34) tests/randgen/conf/optimizer/range_access2.yy (+0/-146) tests/randgen/conf/optimizer/range_access2.zz (+0/-15) tests/randgen/conf/optimizer/sort_union-index_merge.ff (+0/-7) tests/randgen/conf/optimizer/virtual_columns.yy (+0/-394) tests/randgen/conf/oqgraph/oqgraph.init (+0/-2) tests/randgen/conf/oqgraph/oqgraph.yy (+0/-83) tests/randgen/conf/oqgraph/osm2oqg.pl (+0/-30) tests/randgen/conf/osm/LICENCE (+0/-63) tests/randgen/conf/osm/andorra.sql (+0/-158) tests/randgen/conf/osm/osm-schema.sql (+0/-30) tests/randgen/conf/partitioning/partition_pruning.yy (+0/-378) tests/randgen/conf/partitioning/partition_pruning.zz (+0/-210) tests/randgen/conf/partitioning/partitions-ddl.yy (+0/-219) tests/randgen/conf/partitioning/partitions-wl4571.yy (+0/-201) tests/randgen/conf/partitioning/partitions_procedures_triggers.yy (+0/-101) tests/randgen/conf/replication/WL5092_data.zz (+0/-93) tests/randgen/conf/replication/WL5092_sql_1.yy (+0/-107) tests/randgen/conf/replication/WL5092_sql_2.yy (+0/-1215) tests/randgen/conf/replication/replication-5.1.zz (+0/-38) tests/randgen/conf/replication/replication-6.0.zz (+0/-38) tests/randgen/conf/replication/replication-ddl_data.zz (+0/-93) tests/randgen/conf/replication/replication-ddl_sql.yy (+0/-1117) tests/randgen/conf/replication/replication-dml_data.zz (+0/-75) tests/randgen/conf/replication/replication-dml_sql.yy (+0/-619) tests/randgen/conf/replication/replication.yy (+0/-150) tests/randgen/conf/replication/replication_innodb_myisam.zz (+0/-43) tests/randgen/conf/replication/replication_simple.yy (+0/-35) tests/randgen/conf/replication/replication_single_engine.zz (+0/-37) tests/randgen/conf/replication/replication_single_engine_pk.zz (+0/-37) tests/randgen/conf/replication/rpl_transactions.yy (+0/-136) tests/randgen/conf/replication/rpl_transactions.zz (+0/-33) tests/randgen/conf/replication/rpl_transactions_nopk.zz (+0/-33) tests/randgen/conf/runtime/WL5004_data.zz (+0/-50) tests/randgen/conf/runtime/WL5004_sql.yy (+0/-1728) tests/randgen/conf/runtime/WL5004_sql_custom.yy (+0/-1734) tests/randgen/conf/runtime/connect_kill_data.zz (+0/-49) tests/randgen/conf/runtime/connect_kill_sql.yy (+0/-1409) tests/randgen/conf/runtime/create_drop.yy (+0/-49) tests/randgen/conf/runtime/information_schema.yy (+0/-319) tests/randgen/conf/runtime/metadata_locking.cc (+0/-86) tests/randgen/conf/runtime/metadata_stability.yy (+0/-192) tests/randgen/conf/runtime/metadata_stability.zz (+0/-38) tests/randgen/conf/runtime/performance_schema.yy (+0/-358) tests/randgen/conf/runtime/signal_resignal.yy (+0/-286) tests/randgen/conf/temporal/temporal_functions.yy (+0/-262) tests/randgen/conf/temporal/temporal_functions.zz (+0/-35) tests/randgen/conf/temporal/temporal_ranges.yy (+0/-123) tests/randgen/conf/temporal/temporal_ranges.zz (+0/-20) tests/randgen/conf/temporal/temporal_replication.yy (+0/-270) tests/randgen/conf/transactions/combinations.yy (+0/-67) tests/randgen/conf/transactions/combinations.zz (+0/-35) tests/randgen/conf/transactions/repeatable_read.yy (+0/-44) tests/randgen/conf/transactions/transaction_durability.yy (+0/-56) tests/randgen/conf/transactions/transactions-flat.yy (+0/-163) tests/randgen/conf/transactions/transactions.yy (+0/-141) tests/randgen/conf/transactions/transactions.zz (+0/-30) tests/randgen/dict/english.txt (+0/-100) tests/randgen/dict/states.txt (+0/-50) tests/randgen/gendata-old.pl (+0/-70) tests/randgen/gendata.pl (+0/-89) tests/randgen/gengrammar.pl (+0/-70) tests/randgen/gensql.pl (+0/-118) tests/randgen/gentest.pl (+0/-223) tests/randgen/init/all_off.sql (+0/-24) tests/randgen/init/mrr_no_opt.sql (+0/-19) tests/randgen/init/mrr_opt.sql (+0/-19) tests/randgen/init/no_materialization.sql (+0/-18) tests/randgen/init/no_mrr.opt (+0/-1) tests/randgen/init/no_mrr_no_opt.sql (+0/-22) tests/randgen/init/no_mrr_opt.sql (+0/-22) tests/randgen/init/no_semijoin.sql (+0/-18) tests/randgen/init/no_subquery.sql (+0/-18) tests/randgen/lib/DBServer/DBServer.pm (+0/-173) tests/randgen/lib/DBServer/MySQL/MySQLd.pm (+0/-604) tests/randgen/lib/DBServer/MySQL/ReplMySQLd.pm (+0/-220) tests/randgen/lib/GenTest.pm (+0/-186) tests/randgen/lib/GenTest/App/GenTest.pm (+0/-581) tests/randgen/lib/GenTest/App/Gendata.pm (+0/-590) tests/randgen/lib/GenTest/App/GendataSimple.pm (+0/-290) tests/randgen/lib/GenTest/BzrInfo.pm (+0/-188) tests/randgen/lib/GenTest/Comparator.pm (+0/-97) tests/randgen/lib/GenTest/Constants.pm (+0/-174) tests/randgen/lib/GenTest/ErrorFilter.pm (+0/-57) tests/randgen/lib/GenTest/Executor.pm (+0/-395) tests/randgen/lib/GenTest/Executor/Drizzle.pm (+0/-588) tests/randgen/lib/GenTest/Executor/Dummy.pm (+0/-115) tests/randgen/lib/GenTest/Executor/JavaDB.pm (+0/-318) tests/randgen/lib/GenTest/Executor/MySQL.pm (+0/-837) tests/randgen/lib/GenTest/Executor/MySQLPrepared.pm (+0/-49) tests/randgen/lib/GenTest/Executor/Postgres.pm (+0/-274) tests/randgen/lib/GenTest/Filter/Regexp.pm (+0/-100) tests/randgen/lib/GenTest/Generator.pm (+0/-114) tests/randgen/lib/GenTest/Generator/FromGrammar.pm (+0/-350) tests/randgen/lib/GenTest/Grammar.pm (+0/-381) tests/randgen/lib/GenTest/Grammar/Rule.pm (+0/-66) tests/randgen/lib/GenTest/IPC/Channel.pm (+0/-143) tests/randgen/lib/GenTest/IPC/Process.pm (+0/-133) tests/randgen/lib/GenTest/Incident.pm (+0/-122) tests/randgen/lib/GenTest/Mixer.pm (+0/-205) tests/randgen/lib/GenTest/Properties.pm (+0/-353) tests/randgen/lib/GenTest/Random.pm (+0/-529) tests/randgen/lib/GenTest/Reporter.pm (+0/-196) tests/randgen/lib/GenTest/Reporter/AriaDoubleRecovery.pm (+0/-166) tests/randgen/lib/GenTest/Reporter/Backtrace.pm (+0/-113) tests/randgen/lib/GenTest/Reporter/BackupAndRestore.pm (+0/-73) tests/randgen/lib/GenTest/Reporter/BackupAndRestoreInvariant.pm (+0/-230) tests/randgen/lib/GenTest/Reporter/BackupInterop.pm (+0/-137) tests/randgen/lib/GenTest/Reporter/CloneSlave.pm (+0/-254) tests/randgen/lib/GenTest/Reporter/CloneSlaveXtrabackup.pm (+0/-273) tests/randgen/lib/GenTest/Reporter/DatabaseConsistency.pm (+0/-182) tests/randgen/lib/GenTest/Reporter/Deadlock.pm (+0/-250) tests/randgen/lib/GenTest/Reporter/DrizzleInnoTrxLog.pm (+0/-175) tests/randgen/lib/GenTest/Reporter/DrizzleInnoTrxLogCrashRecovery.pm (+0/-270) tests/randgen/lib/GenTest/Reporter/DrizzleRecovery.pm (+0/-341) tests/randgen/lib/GenTest/Reporter/DrizzleRecoveryConsistency.pm (+0/-145) tests/randgen/lib/GenTest/Reporter/DrizzleSlavePlugin.pm (+0/-173) tests/randgen/lib/GenTest/Reporter/DrizzleSlavePluginCrashRecover.pm (+0/-265) tests/randgen/lib/GenTest/Reporter/DrizzleTransactionLog.pm (+0/-172) tests/randgen/lib/GenTest/Reporter/ErrorLog.pm (+0/-58) tests/randgen/lib/GenTest/Reporter/ErrorLogAlarm.pm (+0/-94) tests/randgen/lib/GenTest/Reporter/LockTableKiller.pm (+0/-70) tests/randgen/lib/GenTest/Reporter/MemoryUsage.pm (+0/-54) tests/randgen/lib/GenTest/Reporter/MySQLClient.pm (+0/-41) tests/randgen/lib/GenTest/Reporter/QueryTimeout.pm (+0/-87) tests/randgen/lib/GenTest/Reporter/Recovery.pm (+0/-397) tests/randgen/lib/GenTest/Reporter/RecoveryConsistency.pm (+0/-131) tests/randgen/lib/GenTest/Reporter/ReplicationAnalyzeTable.pm (+0/-56) tests/randgen/lib/GenTest/Reporter/ReplicationConnectionKiller.pm (+0/-79) tests/randgen/lib/GenTest/Reporter/ReplicationConsistency.pm (+0/-112) tests/randgen/lib/GenTest/Reporter/ReplicationLogFlusher.pm (+0/-44) tests/randgen/lib/GenTest/Reporter/ReplicationSemiSync.pm (+0/-237) tests/randgen/lib/GenTest/Reporter/ReplicationThreadRestarter.pm (+0/-68) tests/randgen/lib/GenTest/Reporter/Shutdown.pm (+0/-83) tests/randgen/lib/GenTest/Reporter/ValgrindXMLErrors.pm (+0/-63) tests/randgen/lib/GenTest/Reporter/WinPackage.pm (+0/-51) tests/randgen/lib/GenTest/ReporterManager.pm (+0/-90) tests/randgen/lib/GenTest/Result.pm (+0/-142) tests/randgen/lib/GenTest/SimPipe/DBObject.pm (+0/-209) tests/randgen/lib/GenTest/SimPipe/Oracle.pm (+0/-49) tests/randgen/lib/GenTest/SimPipe/Oracle/Crash.pm (+0/-80) tests/randgen/lib/GenTest/SimPipe/Oracle/FullScan.pm (+0/-114) tests/randgen/lib/GenTest/SimPipe/Oracle/TwiceSporadic.pm (+0/-83) tests/randgen/lib/GenTest/SimPipe/Testcase.pm (+0/-320) tests/randgen/lib/GenTest/Simplifier/Grammar.pm (+0/-164) tests/randgen/lib/GenTest/Simplifier/Mysqltest.pm (+0/-246) tests/randgen/lib/GenTest/Simplifier/SQL.pm (+0/-186) tests/randgen/lib/GenTest/Simplifier/Tables.pm (+0/-123) tests/randgen/lib/GenTest/Simplifier/Test.pm (+0/-257) tests/randgen/lib/GenTest/Stack/Stack.pm (+0/-83) tests/randgen/lib/GenTest/Stack/StackFrame.pm (+0/-42) tests/randgen/lib/GenTest/Statement.pm (+0/-20) tests/randgen/lib/GenTest/Transform.pm (+0/-380) tests/randgen/lib/GenTest/Transform/ConvertLiteralsToSubqueries.pm (+0/-92) tests/randgen/lib/GenTest/Transform/ConvertSubqueriesToViews.pm (+0/-70) tests/randgen/lib/GenTest/Transform/Count.pm (+0/-65) tests/randgen/lib/GenTest/Transform/DisableChosenPlan.pm (+0/-117) tests/randgen/lib/GenTest/Transform/DisableIndexes.pm (+0/-47) tests/randgen/lib/GenTest/Transform/DisableJoinCache.pm (+0/-92) tests/randgen/lib/GenTest/Transform/Distinct.pm (+0/-47) tests/randgen/lib/GenTest/Transform/DrizzleExecuteString.pm (+0/-40) tests/randgen/lib/GenTest/Transform/DrizzleExecuteVariable.pm (+0/-41) tests/randgen/lib/GenTest/Transform/Dummy.pm (+0/-33) tests/randgen/lib/GenTest/Transform/ExecuteAsFunctionTwice.pm (+0/-57) tests/randgen/lib/GenTest/Transform/ExecuteAsInsertSelect.pm (+0/-55) tests/randgen/lib/GenTest/Transform/ExecuteAsPreparedTwice.pm (+0/-45) tests/randgen/lib/GenTest/Transform/ExecuteAsSPTwice.pm (+0/-44) tests/randgen/lib/GenTest/Transform/ExecuteAsSelectItem.pm (+0/-44) tests/randgen/lib/GenTest/Transform/ExecuteAsTrigger.pm (+0/-43) tests/randgen/lib/GenTest/Transform/ExecuteAsUnion.pm (+0/-44) tests/randgen/lib/GenTest/Transform/ExecuteAsUpdateDelete.pm (+0/-81) tests/randgen/lib/GenTest/Transform/ExecuteAsView.pm (+0/-50) tests/randgen/lib/GenTest/Transform/ExecuteAsWhereSubquery.pm (+0/-55) tests/randgen/lib/GenTest/Transform/FromSubquery.pm (+0/-38) tests/randgen/lib/GenTest/Transform/Having.pm (+0/-46) tests/randgen/lib/GenTest/Transform/InlineSubqueries.pm (+0/-79) tests/randgen/lib/GenTest/Transform/InlineVirtualColumns.pm (+0/-61) tests/randgen/lib/GenTest/Transform/LimitDecrease.pm (+0/-49) tests/randgen/lib/GenTest/Transform/LimitIncrease.pm (+0/-42) tests/randgen/lib/GenTest/Transform/OrderBy.pm (+0/-71) tests/randgen/lib/GenTest/Transform/RemoveIndexHints.pm (+0/-24) tests/randgen/lib/GenTest/Transform/SelectOption.pm (+0/-47) tests/randgen/lib/GenTest/Transform/StraightJoin.pm (+0/-50) tests/randgen/lib/GenTest/Translator.pm (+0/-40) tests/randgen/lib/GenTest/Translator/MysqlDML2ANSI.pm (+0/-171) tests/randgen/lib/GenTest/Translator/MysqlDML2javadb.pm (+0/-41) tests/randgen/lib/GenTest/Translator/MysqlDML2pgsql.pm (+0/-40) tests/randgen/lib/GenTest/Translator/Mysqldump2ANSI.pm (+0/-162) tests/randgen/lib/GenTest/Translator/Mysqldump2javadb.pm (+0/-33) tests/randgen/lib/GenTest/Translator/Mysqldump2pgsql.pm (+0/-40) tests/randgen/lib/GenTest/Validator.pm (+0/-54) tests/randgen/lib/GenTest/Validator/AbortOnSyntaxError.pm (+0/-42) tests/randgen/lib/GenTest/Validator/DML.pm (+0/-83) tests/randgen/lib/GenTest/Validator/DatabaseComparator.pm (+0/-67) tests/randgen/lib/GenTest/Validator/DatabaseConsistency.pm (+0/-71) tests/randgen/lib/GenTest/Validator/DrizzleErrorLogScan.pm (+0/-60) tests/randgen/lib/GenTest/Validator/DrizzleTransformer.pm (+0/-104) tests/randgen/lib/GenTest/Validator/Drizzledump.pm (+0/-149) tests/randgen/lib/GenTest/Validator/DrizzledumpMigrate.pm (+0/-145) tests/randgen/lib/GenTest/Validator/ErrorMessageCorruption.pm (+0/-51) tests/randgen/lib/GenTest/Validator/ExecutionTimeComparator.pm (+0/-601) tests/randgen/lib/GenTest/Validator/ExplainMatch.pm (+0/-63) tests/randgen/lib/GenTest/Validator/ExplicitRollback.pm (+0/-56) tests/randgen/lib/GenTest/Validator/Falcon.pm (+0/-81) tests/randgen/lib/GenTest/Validator/FalconErrors.pm (+0/-77) tests/randgen/lib/GenTest/Validator/Invariant.pm (+0/-133) tests/randgen/lib/GenTest/Validator/Limit.pm (+0/-67) tests/randgen/lib/GenTest/Validator/MarkErrorLog.pm (+0/-63) tests/randgen/lib/GenTest/Validator/OptimizerTraceParser.pm (+0/-199) tests/randgen/lib/GenTest/Validator/OrderBy.pm (+0/-66) tests/randgen/lib/GenTest/Validator/QueryProperties.pm (+0/-157) tests/randgen/lib/GenTest/Validator/RepeatableRead.pm (+0/-82) tests/randgen/lib/GenTest/Validator/ReplicationSlaveStatus.pm (+0/-76) tests/randgen/lib/GenTest/Validator/ReplicationWaitForSlave.pm (+0/-69) tests/randgen/lib/GenTest/Validator/ResultsetComparator.pm (+0/-80) tests/randgen/lib/GenTest/Validator/ResultsetComparator3.pm (+0/-144) tests/randgen/lib/GenTest/Validator/ResultsetComparator3Simplify.pm (+0/-222) tests/randgen/lib/GenTest/Validator/ResultsetComparatorSimplify.pm (+0/-172) tests/randgen/lib/GenTest/Validator/ResultsetCorruption.pm (+0/-53) tests/randgen/lib/GenTest/Validator/SelectStability.pm (+0/-56) tests/randgen/lib/GenTest/Validator/Transformer.pm (+0/-272) tests/randgen/lib/GenTest/Validator/Transformer2.pm (+0/-179) tests/randgen/lib/GenTest/XML/BuildInfo.pm (+0/-221) tests/randgen/lib/GenTest/XML/Environment.pm (+0/-403) tests/randgen/lib/GenTest/XML/Report.pm (+0/-120) tests/randgen/lib/GenTest/XML/Test.pm (+0/-135) tests/randgen/lib/GenTest/XML/Transporter.pm (+0/-196) tests/randgen/pb2combinations.pl (+0/-272) tests/randgen/pb2gentest-new.pl (+0/-1196) tests/randgen/pb2gentest.pl (+0/-1195) tests/randgen/pb2runtest.pl (+0/-448) tests/randgen/runall-new.pl (+0/-505) tests/randgen/runall.pl (+0/-476) tests/randgen/server.pl (+0/-310) tests/randgen/simpipe-crash.pl (+0/-44) tests/randgen/simpipe.pl (+0/-36) tests/randgen/simplify-grammar_template.cfg (+0/-163) tests/randgen/simplify-mysqltest_template-huge.cfg (+0/-85) tests/randgen/simplify-mysqltest_template.cfg (+0/-165) tests/randgen/t/constant.t (+0/-26) tests/randgen/t/gensql.t (+0/-33) tests/randgen/t/gensql.yy (+0/-20) tests/randgen/t/gentest.t (+0/-26) tests/randgen/t/grammar-doubledefine.t.disabled (+0/-42) tests/randgen/t/grammar-doubledefine.yy (+0/-22) tests/randgen/t/grammar.t (+0/-113) tests/randgen/t/prng.t (+0/-32) tests/randgen/t/simplify-empty.t (+0/-61) tests/randgen/t/simplify-empty.yy (+0/-36) tests/randgen/t/simplify-grammar.t (+0/-72) tests/randgen/t/simplify-grammar.yy (+0/-62) tests/randgen/t/test.bat (+0/-23) tests/randgen/translateMysql.pl (+0/-80) tests/randgen/unit/DBDVersion.pm (+0/-56) tests/randgen/unit/ExecutorTest.pm (+0/-63) tests/randgen/unit/FromGrammarTest.pm (+0/-60) tests/randgen/unit/GendataTest.pm (+0/-85) tests/randgen/unit/GendataTest.zz (+0/-37) tests/randgen/unit/GrammarTest.pm (+0/-114) tests/randgen/unit/IPC.pm (+0/-97) tests/randgen/unit/IPC_P1.pm (+0/-53) tests/randgen/unit/Metadata.pm (+0/-71) tests/randgen/unit/ParseAllGrammars.pm (+0/-70) tests/randgen/unit/README (+0/-11) tests/randgen/unit/RQGRunner.pm (+0/-290) tests/randgen/unit/RandomTest.pm (+0/-46) tests/randgen/unit/Suite.pm (+0/-39) tests/randgen/unit/TestMySQLServer.pm (+0/-166) tests/randgen/unit/TestReplServer.pm (+0/-141) tests/randgen/unit/TestScripts.pm (+0/-112) tests/randgen/unit/testGrammar.yy (+0/-23) tests/randgen/unit/testStack.yy (+0/-38) tests/randgen/unit/unit.pl (+0/-44) tests/randgen/util/bughunt.pl (+0/-275) tests/randgen/util/dump-test.pl (+0/-65) tests/randgen/util/mask-grammar.pl (+0/-70) tests/randgen/util/simplify-crash.pl (+0/-127) tests/randgen/util/simplify-grammar.pl (+0/-253) tests/randgen/util/simplify-mysqltest.pl (+0/-277) tests/randgen/util/simplify-query-performance.pl (+0/-121) tests/randgen/util/simplify-query.pl (+0/-109) tests/randgen/util/simplify-sporadic.pl (+0/-59) tests/randgen_tests/innodb_trx_log/multi_thread1.cnf (+0/-8) tests/randgen_tests/innodb_trx_log/multi_thread1_crash_recover.cnf (+0/-8) tests/randgen_tests/innodb_trx_log/multi_thread1_mix.cnf (+0/-8) tests/randgen_tests/innodb_trx_log/multi_thread2.cnf (+0/-8) tests/randgen_tests/innodb_trx_log/multi_thread2_mix.cnf (+0/-8) tests/randgen_tests/innodb_trx_log/multi_thread3.cnf (+0/-8) tests/randgen_tests/innodb_trx_log/multi_thread3_mix.cnf (+0/-8) tests/randgen_tests/innodb_trx_log/single_thread3.cnf (+0/-8) tests/randgen_tests/innodb_trx_log/trx_ordering.cnf (+0/-8) tests/randgen_tests/main/basic.cnf (+0/-8) tests/randgen_tests/main/blob.cnf (+0/-8) tests/randgen_tests/main/collations.cnf (+0/-8) tests/randgen_tests/main/combinations.cnf (+0/-8) tests/randgen_tests/main/create_drop.cnf (+0/-8) tests/randgen_tests/main/database_consistency_after_recovery.disabled (+0/-8) tests/randgen_tests/main/database_integrity_after_recovery.cnf (+0/-8) tests/randgen_tests/main/drizzledump_restore.cnf (+0/-8) tests/randgen_tests/main/drizzledump_restore_rand.cnf (+0/-8) tests/randgen_tests/main/limit_compare.cnf (+0/-8) tests/randgen_tests/main/many_indexes.cnf (+0/-8) tests/randgen_tests/main/optimizer_subquery.cnf (+0/-8) tests/randgen_tests/main/orderby_validator.disabled (+0/-8) tests/randgen_tests/main/outer_join.cnf (+0/-8) tests/randgen_tests/main/outer_join_portable.cnf (+0/-8) tests/randgen_tests/main/repeatable_read.cnf (+0/-8) tests/randgen_tests/main/select_stability_validator.cnf (+0/-8) tests/randgen_tests/main/subquery.cnf (+0/-8) tests/randgen_tests/main/subquery_semijoin.cnf (+0/-8) tests/randgen_tests/main/subquery_semijoin_nested.cnf (+0/-8) tests/randgen_tests/main/varchar.cnf (+0/-8) tests/randgen_tests/slave_plugin/multi_thread1.cnf (+0/-8) tests/randgen_tests/slave_plugin/multi_thread1_crash_recover.cnf (+0/-8) tests/randgen_tests/slave_plugin/multi_thread1_mix.cnf (+0/-8) tests/randgen_tests/slave_plugin/multi_thread2.cnf (+0/-8) tests/randgen_tests/slave_plugin/multi_thread2_mix.cnf (+0/-8) tests/randgen_tests/slave_plugin/multi_thread3.cnf (+0/-8) tests/randgen_tests/slave_plugin/multi_thread3_mix.cnf (+0/-8) tests/randgen_tests/slave_plugin/single_thread3.cnf (+0/-8) tests/randgen_tests/slave_plugin/trx_ordering.cnf (+0/-8) tests/randgen_tests/trx_log/multi_thread1.cnf (+0/-8) tests/randgen_tests/trx_log/multi_thread1_mix.cnf (+0/-8) tests/randgen_tests/trx_log/multi_thread2.cnf (+0/-8) tests/randgen_tests/trx_log/multi_thread2_mix.cnf (+0/-8) tests/randgen_tests/trx_log/multi_thread3.cnf (+0/-8) tests/randgen_tests/trx_log/multi_thread3_mix.cnf (+0/-8) tests/randgen_tests/trx_log/single_thread3.cnf (+0/-8) tests/randgen_tests/trx_log/trx_ordering.cnf (+0/-8) tests/sql-bench/COPYING (+0/-352) tests/sql-bench/Comments/Access.crash-me (+0/-40) tests/sql-bench/Comments/Adabas.crash-me (+0/-36) tests/sql-bench/Comments/Empress.crash-me (+0/-102) tests/sql-bench/Comments/FrontBase.benchmark (+0/-59) tests/sql-bench/Comments/Informix.crash-me (+0/-26) tests/sql-bench/Comments/interbase (+0/-18) tests/sql-bench/Comments/mysql.benchmark (+0/-39) tests/sql-bench/Comments/postgres.benchmark (+0/-107) tests/sql-bench/Comments/postgres.crash-me (+0/-30) tests/sql-bench/Data/ATIS/aircraft.txt (+0/-135) tests/sql-bench/Data/ATIS/airline.txt (+0/-314) tests/sql-bench/Data/ATIS/airport.txt (+0/-9) tests/sql-bench/Data/ATIS/airport_service.txt (+0/-14) tests/sql-bench/Data/ATIS/city.txt (+0/-11) tests/sql-bench/Data/ATIS/class_of_service.txt (+0/-27) tests/sql-bench/Data/ATIS/code_description.txt (+0/-15) tests/sql-bench/Data/ATIS/compound_class.txt (+0/-149) tests/sql-bench/Data/ATIS/connect_leg.txt (+0/-351) tests/sql-bench/Data/ATIS/date_day.txt (+0/-1826) tests/sql-bench/Data/ATIS/day_name.txt (+0/-7) tests/sql-bench/Data/ATIS/dual_carrier.txt (+0/-114) tests/sql-bench/Data/ATIS/fare.txt (+0/-534) tests/sql-bench/Data/ATIS/fconnection.txt (+0/-164) tests/sql-bench/Data/ATIS/flight.txt (+0/-579) tests/sql-bench/Data/ATIS/flight_class.txt (+0/-2895) tests/sql-bench/Data/ATIS/flight_day.txt (+0/-448) tests/sql-bench/Data/ATIS/flight_fare.txt (+0/-2998) tests/sql-bench/Data/ATIS/food_service.txt (+0/-121) tests/sql-bench/Data/ATIS/ground_service.txt (+0/-33) tests/sql-bench/Data/ATIS/month_name.txt (+0/-12) tests/sql-bench/Data/ATIS/restrict_carrier.txt (+0/-612) tests/sql-bench/Data/ATIS/restrict_class.txt (+0/-4) tests/sql-bench/Data/ATIS/restriction.txt (+0/-65) tests/sql-bench/Data/ATIS/state.txt (+0/-63) tests/sql-bench/Data/ATIS/stop.txt (+0/-69) tests/sql-bench/Data/ATIS/stop1.txt (+0/-69) tests/sql-bench/Data/ATIS/time_interval.txt (+0/-12) tests/sql-bench/Data/ATIS/time_zone.txt (+0/-9) tests/sql-bench/Data/ATIS/transport.txt (+0/-4) tests/sql-bench/Data/Wisconsin/onek.data (+0/-1000) tests/sql-bench/Data/Wisconsin/tenk.data (+0/-10000) tests/sql-bench/Makefile.am (+0/-86) tests/sql-bench/README (+0/-109) tests/sql-bench/TODO (+0/-21) tests/sql-bench/as3ap (+0/-637) tests/sql-bench/bench-count-distinct (+0/-259) tests/sql-bench/bench-init.pl (+0/-644) tests/sql-bench/compare-results (+0/-619) tests/sql-bench/copy-db (+0/-372) tests/sql-bench/crash-me (+0/-5057) tests/sql-bench/example (+0/-19) tests/sql-bench/example.bat (+0/-7) tests/sql-bench/graph-compare-results (+0/-660) tests/sql-bench/innotest1 (+0/-142) tests/sql-bench/innotest1a (+0/-108) tests/sql-bench/innotest1b (+0/-101) tests/sql-bench/innotest2 (+0/-150) tests/sql-bench/innotest2a (+0/-94) tests/sql-bench/innotest2b (+0/-104) tests/sql-bench/limits/Adabas.cfg (+0/-429) tests/sql-bench/limits/Informix.cfg (+0/-420) tests/sql-bench/limits/access.cfg (+0/-501) tests/sql-bench/limits/access_odbc.cfg (+0/-448) tests/sql-bench/limits/db2.cfg (+0/-522) tests/sql-bench/limits/empress.cfg (+0/-364) tests/sql-bench/limits/frontbase.cfg (+0/-516) tests/sql-bench/limits/interbase-dialect1.cfg (+0/-514) tests/sql-bench/limits/interbase-dialect3.cfg (+0/-514) tests/sql-bench/limits/interbase-superserver.cfg (+0/-514) tests/sql-bench/limits/interbase.cfg (+0/-472) tests/sql-bench/limits/mimer.cfg (+0/-491) tests/sql-bench/limits/ms-sql.cfg (+0/-523) tests/sql-bench/limits/ms-sql65.cfg (+0/-418) tests/sql-bench/limits/msql.cfg (+0/-227) tests/sql-bench/limits/mysql-3.22.cfg (+0/-452) tests/sql-bench/limits/mysql-3.23.cfg (+0/-523) tests/sql-bench/limits/mysql-4.0.cfg (+0/-7290) tests/sql-bench/limits/mysql-4.1.cfg (+0/-7056) tests/sql-bench/limits/mysql.cfg (+0/-1119) tests/sql-bench/limits/oracle.cfg (+0/-505) tests/sql-bench/limits/pg.cfg (+0/-523) tests/sql-bench/limits/solid-nt4.cfg (+0/-422) tests/sql-bench/limits/solid.cfg (+0/-422) tests/sql-bench/limits/sybase.cfg (+0/-422) tests/sql-bench/myisam.cnf (+0/-3) tests/sql-bench/pwd.bat (+0/-2) tests/sql-bench/run-all-tests (+0/-312) tests/sql-bench/server-cfg (+0/-3919) tests/sql-bench/test-ATIS (+0/-566) tests/sql-bench/test-alter-table (+0/-234) tests/sql-bench/test-big-tables (+0/-173) tests/sql-bench/test-connect (+0/-333) tests/sql-bench/test-create (+0/-270) tests/sql-bench/test-insert (+0/-1801) tests/sql-bench/test-select (+0/-455) tests/sql-bench/test-transactions (+0/-298) tests/sql-bench/test-wisconsin (+0/-374) tests/sql-bench/uname.bat (+0/-2) tests/sqlbench_tests/main/all_sqlbench_tests.cnf (+0/-8) tests/sysbench_tests/readonly/concurrency_1024.cnf (+0/-8) tests/sysbench_tests/readonly/concurrency_128.cnf (+0/-8) tests/sysbench_tests/readonly/concurrency_16.cnf (+0/-8) tests/sysbench_tests/readonly/concurrency_256.cnf (+0/-8) tests/sysbench_tests/readonly/concurrency_32.cnf (+0/-8) tests/sysbench_tests/readonly/concurrency_512.cnf (+0/-8) tests/sysbench_tests/readonly/concurrency_64.cnf (+0/-8) tests/sysbench_tests/readwrite/concurrency_1024.cnf (+0/-8) tests/sysbench_tests/readwrite/concurrency_128.cnf (+0/-8) tests/sysbench_tests/readwrite/concurrency_16.cnf (+0/-8) tests/sysbench_tests/readwrite/concurrency_256.cnf (+0/-8) tests/sysbench_tests/readwrite/concurrency_32.cnf (+0/-8) tests/sysbench_tests/readwrite/concurrency_512.cnf (+0/-8) tests/sysbench_tests/readwrite/concurrency_64.cnf (+0/-8) |
To merge this branch: | bzr merge lp:~patrick-crews/drizzle/qp-cleanup |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Drizzle Trunk | Pending | ||
Review via email: mp+107840@code.launchpad.net |
Commit message
Description of the change
We have removed the remnants of the dbqp code and moved kewpie code to a more permanent location (taking over old dbqp spots). Includes removal of redundant copies of test tools and suites as well.
To post a comment you must log in.
- 2560. By Patrick Crews
-
Move to make sysbench test execution occur via unittest modules rather than the clunky manager/executor model. Created initial test case + migrated methods from 'modes' dir to utils/sysbench_
methods. py - 2561. By Patrick Crews
-
Minor cleanup of redundant entry in tests/include.am
Revision history for this message
Brian Aker (brianaker) wrote : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file '.bzrignore' |
2 | --- .bzrignore 2012-05-02 10:27:13 +0000 |
3 | +++ .bzrignore 2012-05-31 12:35:24 +0000 |
4 | @@ -336,12 +336,9 @@ |
5 | tests/Makefile.in |
6 | tests/dtr |
7 | tests/dtr@ |
8 | -tests/dbqp |
9 | -tests/dbqp_data/uuid |
10 | -tests/dbqp_work |
11 | +tests/kewpie |
12 | +tests/qp_data/uuid |
13 | tests/install_test_db |
14 | -tests/kewpie/qp_data/uuid |
15 | -tests/kewpie/workdir |
16 | tests/mtr |
17 | tests/mtr@ |
18 | tests/resolve_stack_dump |
19 | |
20 | === removed directory 'tests/crashme_tests' |
21 | === removed directory 'tests/crashme_tests/main' |
22 | === removed file 'tests/crashme_tests/main/crashme.cnf' |
23 | --- tests/crashme_tests/main/crashme.cnf 2011-06-08 03:02:27 +0000 |
24 | +++ tests/crashme_tests/main/crashme.cnf 1970-01-01 00:00:00 +0000 |
25 | @@ -1,8 +0,0 @@ |
26 | -[test_info] |
27 | -comment = Run all sql-bench tests! |
28 | - |
29 | -[test_command] |
30 | -command = $DRIZZLE_TEST_DIR/sql-bench/crash-me --server=drizzled --force --dir=$DRIZZLE_TEST_WORKDIR --connect-options=port=$MASTER_MYPORT --verbose --debug --user=root |
31 | - |
32 | -[test_servers] |
33 | -servers = [[]] |
34 | |
35 | === removed file 'tests/dbqp.py' |
36 | --- tests/dbqp.py 2011-06-16 21:55:55 +0000 |
37 | +++ tests/dbqp.py 1970-01-01 00:00:00 +0000 |
38 | @@ -1,102 +0,0 @@ |
39 | -#! /usr/bin/env python |
40 | -# -*- mode: python; indent-tabs-mode: nil; -*- |
41 | -# vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
42 | -# |
43 | -# Copyright (C) 2010 Patrick Crews |
44 | -# |
45 | -# This program is free software; you can redistribute it and/or modify |
46 | -# it under the terms of the GNU General Public License as published by |
47 | -# the Free Software Foundation; either version 2 of the License, or |
48 | -# (at your option) any later version. |
49 | -# |
50 | -# This program is distributed in the hope that it will be useful, |
51 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
52 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
53 | -# GNU General Public License for more details. |
54 | -# |
55 | -# You should have received a copy of the GNU General Public License |
56 | -# along with this program; if not, write to the Free Software |
57 | -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
58 | - |
59 | - |
60 | -""" dbqp.py |
61 | - |
62 | -DataBase Quality Platform - system for executing various |
63 | -testing systems and the helper code |
64 | - |
65 | -Designed to be a modular test-runner. Different testing tools |
66 | -and databases may be plugged into the system via hacking the |
67 | -appropriate modules |
68 | - |
69 | -Currently geared towards Drizzle / will expand to MySQL |
70 | -""" |
71 | - |
72 | -# imports |
73 | -import os |
74 | -import sys |
75 | - |
76 | -import lib.dbqp_opts.test_run_options as test_run_options |
77 | -from lib.dbqp_modes.test_mode import handle_mode |
78 | -from lib.server_mgmt.server_management import serverManager |
79 | -from lib.sys_mgmt.system_management import systemManager |
80 | -from lib.test_mgmt.execution_management import executionManager |
81 | - |
82 | -# functions |
83 | - |
84 | - |
85 | -# main |
86 | -variables = test_run_options.variables |
87 | -system_manager = None |
88 | -server_manager = None |
89 | -test_manager = None |
90 | -test_executor = None |
91 | -execution_manager = None |
92 | - |
93 | -try: |
94 | - # We do this nested try to accomodate red hat |
95 | - # running python 2.4...seriously? 2.4? |
96 | - try: |
97 | - # Some system-level work is constant regardless |
98 | - # of the test to be run |
99 | - system_manager = systemManager(variables) |
100 | - |
101 | - # Create our server_manager |
102 | - server_manager = serverManager(system_manager, variables) |
103 | - |
104 | - # Get our mode-specific test_manager and test_executor |
105 | - (test_manager,test_executor) = handle_mode(variables, system_manager) |
106 | - |
107 | - # Gather our tests for execution |
108 | - test_manager.gather_tests() |
109 | - |
110 | - # Initialize test execution manager |
111 | - execution_manager = executionManager(server_manager, system_manager |
112 | - , test_manager, test_executor |
113 | - , variables) |
114 | - |
115 | - # Execute our tests! |
116 | - execution_manager.execute_tests() |
117 | - |
118 | - except Exception, e: |
119 | - print Exception, e |
120 | - |
121 | - except KeyboardInterrupt: |
122 | - print "\n\nDetected <Ctrl>+c, shutting down and cleaning up..." |
123 | - |
124 | -finally: |
125 | -# TODO - make a more robust cleanup |
126 | -# At the moment, runaway servers are our biggest concern |
127 | - if server_manager and not variables['startandexit']: |
128 | - if variables['gdb']: |
129 | - server_manager.cleanup_all_servers() |
130 | - else: |
131 | - server_manager.cleanup() |
132 | - if not variables['startandexit']: |
133 | - if test_manager: |
134 | - fail_count = test_manager.has_failing_tests() |
135 | - sys.exit(test_manager.has_failing_tests()) |
136 | - else: |
137 | - # return 1 as we likely have a problem if we don't have a |
138 | - # test_manager |
139 | - sys.exit(1) |
140 | - |
141 | |
142 | === removed directory 'tests/dbqp_data' |
143 | === modified file 'tests/include.am' |
144 | --- tests/include.am 2012-03-05 14:28:36 +0000 |
145 | +++ tests/include.am 2012-05-31 12:35:24 +0000 |
146 | @@ -20,7 +20,7 @@ |
147 | benchdir_root= $(prefix) |
148 | testdir = $(benchdir_root)/mysql-test |
149 | EXTRA_SCRIPTS = tests/valgrind.supp $(PRESCRIPTS) |
150 | -GENSCRIPTS = tests/dtr tests/mtr tests/test-run tests/dbqp |
151 | +GENSCRIPTS = tests/dtr tests/mtr tests/test-run tests/qp |
152 | PRESCRIPTS = tests/test-run.pl tests/stress-test.pl |
153 | PLUGIN_TESTS = $(pandora_plugin_test_list) |
154 | NORMAL_TESTS = main,bool_type,cast,ddl_transactions,execute,flush_tables,identifiers,jp,mysql_compatibility,regression,tamil,time_type,unsigned_integer_type,uuid_type,microtime_type,$(PLUGIN_TESTS) |
155 | @@ -48,66 +48,41 @@ |
156 | --testdir=${top_srcdir}/tests \ |
157 | --dtr-build-thread=$$$$ |
158 | |
159 | -TEST_RUN_DBQP= $(PYTHON) $(top_srcdir)/tests/dbqp.py \ |
160 | - --top-srcdir=${top_srcdir} \ |
161 | - --top-builddir=${top_builddir} \ |
162 | - --reorder \ |
163 | - --basedir=${top_srcdir} \ |
164 | - --testdir=${top_srcdir}/tests \ |
165 | - --workdir=${top_srcdir}/tests/workdir |
166 | - |
167 | -TEST_RUN_DBQP_MODE= $(PYTHON) $(top_srcdir)/tests/dbqp.py \ |
168 | - --top-srcdir=${top_srcdir} \ |
169 | - --top-builddir=${top_builddir} \ |
170 | - --basedir=${top_srcdir} \ |
171 | - --testdir=${top_srcdir}/tests \ |
172 | - --workdir=${top_srcdir}/tests/workdir |
173 | - |
174 | -TEST_RUN_QP= $(PYTHON) $(top_srcdir)/tests/kewpie/kewpie.py \ |
175 | +TEST_RUN_QP= $(PYTHON) $(top_srcdir)/tests/kewpie.py \ |
176 | --top-srcdir=${top_srcdir} \ |
177 | --top-builddir=${top_builddir} \ |
178 | --reorder \ |
179 | --basedir=${top_srcdir} \ |
180 | --testdir=${top_srcdir}/tests \ |
181 | - --workdir=${top_srcdir}/tests/kewpie/workdir |
182 | + --workdir=${top_srcdir}/tests/workdir |
183 | |
184 | -TEST_RUN_QP_MODE= $(PYTHON) $(top_srcdir)/tests/kewpie/kewpie.py \ |
185 | +TEST_RUN_QP_MODE= $(PYTHON) $(top_srcdir)/tests/kewpie.py \ |
186 | --top-srcdir=${top_srcdir} \ |
187 | --top-builddir=${top_builddir} \ |
188 | --basedir=${top_srcdir} \ |
189 | - --testdir=${top_srcdir}/tests/kewpie \ |
190 | - --workdir=${top_srcdir}/tests/kewpie/workdir |
191 | + --testdir=${top_srcdir}/tests \ |
192 | + --workdir=${top_srcdir}/tests/workdir |
193 | |
194 | |
195 | EXTRA_DIST += \ |
196 | $(EXTRA_SCRIPTS) \ |
197 | - ${srcdir}/tests/kewpie/kewpie.py \ |
198 | - ${srcdir}/tests/kewpie/qp_data \ |
199 | - ${srcdir}/tests/kewpie/drizzle_tests/crashme/*.py \ |
200 | - ${srcdir}/tests/kewpie/drizzle_tests/randgen_basic/*.py \ |
201 | - ${srcdir}/tests/kewpie/drizzle_tests/randgen_innoTrxLog/*.py \ |
202 | - ${srcdir}/tests/kewpie/drizzle_tests/randgen_slavePlugin/*.py \ |
203 | - ${srcdir}/tests/kewpie/drizzle_tests/sqlbench/*.py \ |
204 | - ${srcdir}/tests/kewpie/lib/modes/dtr/*py \ |
205 | - ${srcdir}/tests/kewpie/lib/modes/native/*py \ |
206 | - ${srcdir}/tests/kewpie/lib/modes/sysbench/*py \ |
207 | - ${srcdir}/tests/kewpie/lib/opts/*.py \ |
208 | - ${srcdir}/tests/kewpie/lib/server_mgmt/*py \ |
209 | - ${srcdir}/tests/kewpie/lib/sys_mgmt/*py \ |
210 | - ${srcdir}/tests/kewpie/lib/test_mgmt/*py \ |
211 | - ${srcdir}/tests/kewpie/lib/util/*py \ |
212 | - ${srcdir}/tests/kewpie/lib/*.py \ |
213 | - ${srcdir}/tests/kewpie/randgen \ |
214 | - ${srcdir}/tests/kewpie/sql-bench \ |
215 | - ${srcdir}/tests/kewpie/sysbench_tests \ |
216 | - ${srcdir}/tests/crashme_tests \ |
217 | - ${srcdir}/tests/dbqp.py \ |
218 | - ${srcdir}/tests/dbqp_data \ |
219 | - ${srcdir}/tests/randgen \ |
220 | - ${srcdir}/tests/randgen_tests \ |
221 | - ${srcdir}/tests/sql-bench \ |
222 | - ${srcdir}/tests/sqlbench_tests \ |
223 | - ${srcdir}/tests/sysbench_tests \ |
224 | + ${srcdir}/tests/kewpie.py \ |
225 | + ${srcdir}/tests/qp_data \ |
226 | + ${srcdir}/tests/qp_tests/crashme/*.py \ |
227 | + ${srcdir}/tests/qp_tests/randgen_basic/*.py \ |
228 | + ${srcdir}/tests/qp_tests/randgen_innoTrxLog/*.py \ |
229 | + ${srcdir}/tests/qp_tests/randgen_slavePlugin/*.py \ |
230 | + ${srcdir}/tests/qp_tests/sqlbench/*.py \ |
231 | + ${srcdir}/tests/lib/modes/dtr/*py \ |
232 | + ${srcdir}/tests/lib/modes/native/*py \ |
233 | + ${srcdir}/tests/lib/opts/*.py \ |
234 | + ${srcdir}/tests/lib/server_mgmt/*py \ |
235 | + ${srcdir}/tests/lib/sys_mgmt/*py \ |
236 | + ${srcdir}/tests/lib/test_mgmt/*py \ |
237 | + ${srcdir}/tests/lib/util/*py \ |
238 | + ${srcdir}/tests/lib/*.py \ |
239 | + ${srcdir}/tests/test_tools/randgen \ |
240 | + ${srcdir}/tests/test_tools/sql-bench \ |
241 | ${srcdir}/tests/README.stress \ |
242 | ${srcdir}/tests/suite \ |
243 | ${srcdir}/tests/t \ |
244 | @@ -119,17 +94,7 @@ |
245 | ${srcdir}/tests/r/pbxt/*result \ |
246 | ${srcdir}/tests/std_data \ |
247 | ${srcdir}/tests/lib/*.pl \ |
248 | - ${srcdir}/tests/lib/*.py \ |
249 | - ${srcdir}/tests/lib/dbqp_modes/crashme/*.py \ |
250 | - ${srcdir}/tests/lib/dbqp_modes/dtr/*.py \ |
251 | - ${srcdir}/tests/lib/dbqp_modes/randgen/*.py \ |
252 | - ${srcdir}/tests/lib/dbqp_modes/sqlbench/*py \ |
253 | - ${srcdir}/tests/lib/dbqp_modes/sysbench/*py \ |
254 | - ${srcdir}/tests/lib/dbqp_opts/*.py \ |
255 | ${srcdir}/tests/lib/My/*.pm \ |
256 | - ${srcdir}/tests/lib/server_mgmt/*py \ |
257 | - ${srcdir}/tests/lib/sys_mgmt/*py \ |
258 | - ${srcdir}/tests/lib/test_mgmt/*py \ |
259 | tests/strip-valgrind |
260 | |
261 | |
262 | @@ -156,9 +121,9 @@ |
263 | $(RM) -f tests/test-run |
264 | $(LN_S) test-run.pl tests/test-run |
265 | |
266 | -tests/dbqp: tests/var/drizzle |
267 | - $(RM) -f tests/dbqp |
268 | - $(LN_S) dbqp.py tests/dbqp |
269 | +tests/qp: tests/var/drizzle |
270 | + $(RM) -f tests/kewpie |
271 | + $(LN_S) kewpie.py tests/kewpie |
272 | |
273 | |
274 | .PHONY: test |
275 | @@ -166,7 +131,6 @@ |
276 | .PHONY: test-big |
277 | .PHONY: test-crashme |
278 | .PHONY: test-drizzle |
279 | -.PHONY: test-dbqp |
280 | .PHONY: test-qp |
281 | .PHONY: test-plugins |
282 | .PHONY: test-randgen |
283 | |
284 | === removed directory 'tests/kewpie' |
285 | === renamed file 'tests/kewpie/kewpie.py' => 'tests/kewpie.py' |
286 | --- tests/kewpie/kewpie.py 2012-02-09 02:28:38 +0000 |
287 | +++ tests/kewpie.py 2012-05-31 12:35:24 +0000 |
288 | @@ -69,13 +69,13 @@ |
289 | # We base / look for a lot of things based on the location of |
290 | # the kewpie.py file |
291 | qp_rootdir = os.path.dirname(os.path.abspath(sys.argv[0])) |
292 | -#project_name = 'percona-xtradb-cluster' |
293 | -#project_name = 'xtrabackup' |
294 | project_name = None |
295 | defaults = get_defaults(qp_rootdir,project_name) |
296 | defaults = handle_sys_config(sys.argv, defaults) |
297 | + |
298 | variables = test_run_options.parse_qp_options(defaults) |
299 | variables['qp_root'] = qp_rootdir |
300 | + |
301 | system_manager = None |
302 | server_manager = None |
303 | test_manager = None |
304 | |
305 | === removed file 'tests/kewpie/.bzrignore' |
306 | --- tests/kewpie/.bzrignore 2011-12-05 21:23:04 +0000 |
307 | +++ tests/kewpie/.bzrignore 1970-01-01 00:00:00 +0000 |
308 | @@ -1,5 +0,0 @@ |
309 | -dbqp |
310 | -dbqp_data/uuid |
311 | -qp_data/uuid |
312 | -workdir |
313 | -docs/_build/* |
314 | |
315 | === removed directory 'tests/kewpie/lib' |
316 | === removed file 'tests/kewpie/lib/__init__.py' |
317 | === removed directory 'tests/kewpie/lib/modes/sysbench' |
318 | === removed file 'tests/kewpie/lib/modes/sysbench/__init__.py' |
319 | === removed file 'tests/kewpie/lib/modes/sysbench/sysbench_test_execution.py' |
320 | --- tests/kewpie/lib/modes/sysbench/sysbench_test_execution.py 2011-10-05 20:26:34 +0000 |
321 | +++ tests/kewpie/lib/modes/sysbench/sysbench_test_execution.py 1970-01-01 00:00:00 +0000 |
322 | @@ -1,162 +0,0 @@ |
323 | -#! /usr/bin/env python |
324 | -# -*- mode: python; indent-tabs-mode: nil; -*- |
325 | -# vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
326 | -# |
327 | -# Copyright (C) 2010 Patrick Crews |
328 | -# |
329 | -# |
330 | -# This program is free software; you can redistribute it and/or modify |
331 | -# it under the terms of the GNU General Public License as published by |
332 | -# the Free Software Foundation; either version 2 of the License, or |
333 | -# (at your option) any later version. |
334 | -# |
335 | -# This program is distributed in the hope that it will be useful, |
336 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
337 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
338 | -# GNU General Public License for more details. |
339 | -# |
340 | -# You should have received a copy of the GNU General Public License |
341 | -# along with this program; if not, write to the Free Software |
342 | -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
343 | - |
344 | -""" sysbench_test_execution: |
345 | - code related to the execution of sysbench test cases |
346 | - |
347 | - We are provided access to a testManager with |
348 | - sysbench-specific testCases. |
349 | - |
350 | -""" |
351 | - |
352 | -# imports |
353 | -import os |
354 | -import re |
355 | -import sys |
356 | -import subprocess |
357 | -import commands |
358 | - |
359 | -import lib.test_mgmt.test_execution as test_execution |
360 | - |
361 | -class testExecutor(test_execution.testExecutor): |
362 | - """ sysbench-specific testExecutor |
363 | - |
364 | - """ |
365 | - |
366 | - def execute_testCase (self): |
367 | - """ Execute a sysbench testCase |
368 | - |
369 | - """ |
370 | - test_execution.testExecutor.execute_testCase(self) |
371 | - self.status = 0 |
372 | - |
373 | - # prepare the server for sysbench |
374 | - self.prepare_sysbench() |
375 | - |
376 | - # execute sysbench |
377 | - self.execute_sysbench() |
378 | - |
379 | - # analyze results |
380 | - self.current_test_status = self.process_sysbench_output() |
381 | - self.set_server_status(self.current_test_status) |
382 | - self.server_manager.reset_servers(self.name) |
383 | - |
384 | - def prepare_sysbench(self): |
385 | - """ Prepare the server for a sysbench run |
386 | - We use subprocess as we can pass os.environ dicts and whatnot |
387 | - |
388 | - """ |
389 | - |
390 | - sysbench_outfile = os.path.join(self.logdir,'sysbench.out') |
391 | - sysbench_output = open(sysbench_outfile,'w') |
392 | - sysbench_cmd = ' '.join([self.current_testcase.test_command,'prepare']) |
393 | - self.logging.info("Preparing database for sysbench run...") |
394 | - self.logging.debug(sysbench_cmd) |
395 | - sysbench_subproc = subprocess.Popen( sysbench_cmd |
396 | - , shell=True |
397 | - #, cwd=os.getcwd() |
398 | - , env=self.working_environment |
399 | - , stdout = sysbench_output |
400 | - , stderr = subprocess.STDOUT |
401 | - ) |
402 | - sysbench_subproc.wait() |
403 | - retcode = sysbench_subproc.returncode |
404 | - |
405 | - sysbench_output.close() |
406 | - sysbench_file = open(sysbench_outfile,'r') |
407 | - output = ''.join(sysbench_file.readlines()) |
408 | - sysbench_file.close() |
409 | - self.logging.debug("sysbench_retcode: %d" %(retcode)) |
410 | - self.logging.debug(output) |
411 | - if retcode: |
412 | - self.logging.error("sysbench_prepare failed with retcode %d:" %(retcode)) |
413 | - self.logging.error(output) |
414 | - sys.exit(1) |
415 | - |
416 | - |
417 | - |
418 | - |
419 | - def execute_sysbench(self): |
420 | - """ Execute the commandline and return the result. |
421 | - We use subprocess as we can pass os.environ dicts and whatnot |
422 | - |
423 | - """ |
424 | - |
425 | - testcase_name = self.current_testcase.fullname |
426 | - self.time_manager.start(testcase_name,'test') |
427 | - sysbench_outfile = os.path.join(self.logdir,'sysbench.out') |
428 | - sysbench_output = open(sysbench_outfile,'w') |
429 | - sysbench_cmd = ' '.join([self.current_testcase.test_command, 'run']) |
430 | - self.logging.info("Executing sysbench: %s" %(sysbench_cmd)) |
431 | - |
432 | - sysbench_subproc = subprocess.Popen( sysbench_cmd |
433 | - , shell=True |
434 | - #, cwd=self.system_manager.sysbench_path |
435 | - , env=self.working_environment |
436 | - , stdout = sysbench_output |
437 | - , stderr = subprocess.STDOUT |
438 | - ) |
439 | - sysbench_subproc.wait() |
440 | - retcode = sysbench_subproc.returncode |
441 | - execution_time = int(self.time_manager.stop(testcase_name)*1000) # millisec |
442 | - |
443 | - sysbench_output.close() |
444 | - sysbench_file = open(sysbench_outfile,'r') |
445 | - output = ''.join(sysbench_file.readlines()) |
446 | - self.logging.debug(output) |
447 | - sysbench_file.close() |
448 | - |
449 | - self.logging.debug("sysbench_retcode: %d" %(retcode)) |
450 | - self.current_test_retcode = retcode |
451 | - self.current_test_output = output |
452 | - self.current_test_exec_time = execution_time |
453 | - |
454 | - def process_sysbench_output(self): |
455 | - """ sysbench has run, we now check out what we have |
456 | - We also output the data from the run |
457 | - |
458 | - """ |
459 | - # This slice code taken from drizzle-automation's sysbench handling |
460 | - # Slice up the output report into a matrix and insert into the DB. |
461 | - regexes= { |
462 | - 'tps': re.compile(r".*transactions\:\s+\d+\D*(\d+\.\d+).*") |
463 | - , 'deadlocksps': re.compile(r".*deadlocks\:\s+\d+\D*(\d+\.\d+).*") |
464 | - , 'rwreqps': re.compile(r".*read\/write\s+requests\:\s+\d+\D*(\d+\.\d+).*") |
465 | - , 'min_req_lat_ms': re.compile(r".*min\:\s+(\d*\.\d+)ms.*") |
466 | - , 'max_req_lat_ms': re.compile(r".*max\:\s+(\d*\.\d+)ms.*") |
467 | - , 'avg_req_lat_ms': re.compile(r".*avg\:\s+(\d*\.\d+)ms.*") |
468 | - , '95p_req_lat_ms': re.compile(r".*approx.\s+95\s+percentile\:\s+(\d+\.\d+)ms.*") |
469 | - } |
470 | - run= {} |
471 | - for line in self.current_test_output.split("\n"): |
472 | - for key in regexes.keys(): |
473 | - result= regexes[key].match(line) |
474 | - if result: |
475 | - run[key]= float(result.group(1)) # group(0) is entire match... |
476 | - # we set our test output to the regex'd-up data |
477 | - # we also make it a single string, separated by newlines |
478 | - self.current_test_output = str(run)[1:-1].replace(',','\n').replace("'",'') |
479 | - |
480 | - if self.current_test_retcode == 0: |
481 | - return 'pass' |
482 | - else: |
483 | - return 'fail' |
484 | - |
485 | |
486 | === removed file 'tests/kewpie/lib/modes/sysbench/sysbench_test_management.py' |
487 | --- tests/kewpie/lib/modes/sysbench/sysbench_test_management.py 2011-10-05 20:26:34 +0000 |
488 | +++ tests/kewpie/lib/modes/sysbench/sysbench_test_management.py 1970-01-01 00:00:00 +0000 |
489 | @@ -1,159 +0,0 @@ |
490 | -#! /usr/bin/env python |
491 | -# -*- mode: python; indent-tabs-mode: nil; -*- |
492 | -# vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
493 | -# |
494 | -# Copyright (C) 2010 Patrick Crews |
495 | -# |
496 | -## This program is free software; you can redistribute it and/or modify |
497 | -# it under the terms of the GNU General Public License as published by |
498 | -# the Free Software Foundation; either version 2 of the License, or |
499 | -# (at your option) any later version. |
500 | -# |
501 | -# This program is distributed in the hope that it will be useful, |
502 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
503 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
504 | -# GNU General Public License for more details. |
505 | -# |
506 | -# You should have received a copy of the GNU General Public License |
507 | -# along with this program; if not, write to the Free Software |
508 | -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
509 | - |
510 | -""" sysbench_test_management: |
511 | - code related to the gathering / analysis / management of |
512 | - the test cases |
513 | - ie - collecting the list of tests in each suite, then |
514 | - gathering additional, relevant information for sysbench mode |
515 | - |
516 | -""" |
517 | - |
518 | -# imports |
519 | -import os |
520 | -import re |
521 | -import sys |
522 | -from ConfigParser import RawConfigParser |
523 | - |
524 | -import lib.test_mgmt.test_management as test_management |
525 | - |
526 | - |
527 | - |
528 | -class testCase: |
529 | - """Holds info on a single sysbench test |
530 | - |
531 | - """ |
532 | - def __init__( self, system_manager, name=None |
533 | - , fullname = None, server_requirements=[[]] |
534 | - , comment=None, test_command=None, cnf_path=None |
535 | - , debug=False ): |
536 | - self.system_manager = system_manager |
537 | - self.logging = self.system_manager.logging |
538 | - self.skip_keys = ['system_manager','logging'] |
539 | - self.name = name |
540 | - self.fullname = fullname |
541 | - self.suitename = 'sysbench_tests' |
542 | - self.master_sh = None |
543 | - self.comment = comment |
544 | - self.server_requirements = server_requirements |
545 | - self.test_command = test_command |
546 | - self.cnf_path = cnf_path |
547 | - |
548 | - if debug: |
549 | - self.system_manager.logging.debug_class(self) |
550 | - |
551 | - def should_run(self): |
552 | - if self.skip_flag or self.disable: |
553 | - return 0 |
554 | - else: |
555 | - return 1 |
556 | - |
557 | - |
558 | - |
559 | - |
560 | - |
561 | -class testManager(test_management.testManager): |
562 | - """Deals with scanning test directories, gathering test cases, and |
563 | - collecting per-test information (opt files, etc) for use by the |
564 | - test-runner |
565 | - |
566 | - """ |
567 | - |
568 | - def __init__( self, variables, system_manager): |
569 | - super(testManager, self).__init__( variables, system_manager) |
570 | - self.suitepaths = [os.path.join(self.testdir,'sysbench_tests')] |
571 | - if variables['suitelist'] is None: |
572 | - self.suitelist = ['readonly'] |
573 | - else: |
574 | - self.suitelist = variables['suitelist'] |
575 | - |
576 | - def process_suite(self,suite_dir): |
577 | - """Process a test suite. |
578 | - Look for sysbench tests, which are nice clean conf files |
579 | - |
580 | - """ |
581 | - |
582 | - # We know this based on how we organize sysbench test conf files |
583 | - suite_name = os.path.basename(suite_dir) |
584 | - self.system_manager.logging.verbose("Processing suite: %s" %(suite_name)) |
585 | - testlist = [os.path.join(suite_dir,test_file) for test_file in sorted(os.listdir(suite_dir)) if test_file.endswith('.cnf')] |
586 | - |
587 | - # Search for specific test names |
588 | - if self.desired_tests: # We have specific, named tests we want from the suite(s) |
589 | - tests_to_use = [] |
590 | - for test in self.desired_tests: |
591 | - if test.endswith('.cnf'): |
592 | - pass |
593 | - else: |
594 | - test = test+'.cnf' |
595 | - test = os.path.join(suite_dir,test) |
596 | - if test in testlist: |
597 | - tests_to_use.append(test) |
598 | - testlist = tests_to_use |
599 | - for test_case in testlist: |
600 | - self.add_test(self.process_test_file(suite_name, test_case)) |
601 | - |
602 | - |
603 | - def process_test_file(self, suite_name, testfile): |
604 | - """ We convert the info in a testfile into a testCase object """ |
605 | - |
606 | - config_reader = RawConfigParser() |
607 | - config_reader.read(testfile) |
608 | - # test_name = filename - .cnf...simpler |
609 | - test_name = os.path.basename(testfile).replace('.cnf','') |
610 | - test_comment = config_reader.get('test_info','comment') |
611 | - server_requirements = self.process_server_reqs(config_reader.get('test_servers','servers')) |
612 | - test_command = config_reader.get('test_command','command') |
613 | - return testCase( self.system_manager |
614 | - , name = test_name |
615 | - , fullname = "%s.%s" %(suite_name, test_name) |
616 | - , server_requirements = server_requirements |
617 | - , test_command = test_command |
618 | - , cnf_path = testfile |
619 | - , debug = self.debug ) |
620 | - |
621 | - #sys.exit(0) |
622 | - |
623 | - def process_server_reqs(self,data_string): |
624 | - """ We read in the list of lists as a string, so we need to |
625 | - handle this / break it down into proper chunks |
626 | - |
627 | - """ |
628 | - server_reqs = [] |
629 | - # We expect to see a list of lists and throw away the |
630 | - # enclosing brackets |
631 | - option_sets = data_string[1:-1].strip().split(',') |
632 | - for option_set in option_sets: |
633 | - server_reqs.append([option_set[1:-1].strip()]) |
634 | - return server_reqs |
635 | - |
636 | - def record_test_result(self, test_case, test_status, output, exec_time): |
637 | - """ Accept the results of an executed testCase for further |
638 | - processing. |
639 | - |
640 | - """ |
641 | - if test_status not in self.executed_tests: |
642 | - self.executed_tests[test_status] = [test_case] |
643 | - else: |
644 | - self.executed_tests[test_status].append(test_case) |
645 | - # report |
646 | - self.logging.test_report( test_case.fullname, test_status |
647 | - , str(exec_time), output |
648 | - , report_output= True) |
649 | |
650 | === removed directory 'tests/kewpie/sysbench_tests' |
651 | === removed directory 'tests/kewpie/sysbench_tests/readonly' |
652 | === removed file 'tests/kewpie/sysbench_tests/readonly/concurrency_1024.cnf' |
653 | --- tests/kewpie/sysbench_tests/readonly/concurrency_1024.cnf 2011-10-05 20:26:34 +0000 |
654 | +++ tests/kewpie/sysbench_tests/readonly/concurrency_1024.cnf 1970-01-01 00:00:00 +0000 |
655 | @@ -1,8 +0,0 @@ |
656 | -[test_info] |
657 | -comment = 16 threads |
658 | - |
659 | -[test_command] |
660 | -command = sysbench --max-time=240 --max-requests=0 --test=oltp --db-ps-mode=disable --drizzle-table-engine=innodb --oltp-read-only=on --oltp-table-size=1000000 --drizzle-mysql=on --drizzle-user=root --drizzle-db=test --drizzle-port=$MASTER_MYPORT --drizzle-host=localhost --db-driver=drizzle --num-threads=1024 |
661 | - |
662 | -[test_servers] |
663 | -servers = [[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]] |
664 | |
665 | === removed file 'tests/kewpie/sysbench_tests/readonly/concurrency_128.cnf' |
666 | --- tests/kewpie/sysbench_tests/readonly/concurrency_128.cnf 2011-10-05 20:26:34 +0000 |
667 | +++ tests/kewpie/sysbench_tests/readonly/concurrency_128.cnf 1970-01-01 00:00:00 +0000 |
668 | @@ -1,8 +0,0 @@ |
669 | -[test_info] |
670 | -comment = 16 threads |
671 | - |
672 | -[test_command] |
673 | -command = sysbench --max-time=240 --max-requests=0 --test=oltp --db-ps-mode=disable --drizzle-table-engine=innodb --oltp-read-only=on --oltp-table-size=1000000 --drizzle-mysql=on --drizzle-user=root --drizzle-db=test --drizzle-port=$MASTER_MYPORT --drizzle-host=localhost --db-driver=drizzle --num-threads=128 |
674 | - |
675 | -[test_servers] |
676 | -servers = [[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]] |
677 | |
678 | === removed file 'tests/kewpie/sysbench_tests/readonly/concurrency_16.cnf' |
679 | --- tests/kewpie/sysbench_tests/readonly/concurrency_16.cnf 2011-10-05 20:26:34 +0000 |
680 | +++ tests/kewpie/sysbench_tests/readonly/concurrency_16.cnf 1970-01-01 00:00:00 +0000 |
681 | @@ -1,8 +0,0 @@ |
682 | -[test_info] |
683 | -comment = 16 threads |
684 | - |
685 | -[test_command] |
686 | -command = sysbench --max-time=240 --max-requests=0 --test=oltp --db-ps-mode=disable --drizzle-table-engine=innodb --oltp-read-only=on --oltp-table-size=1000000 --drizzle-mysql=on --drizzle-user=root --drizzle-db=test --drizzle-port=$MASTER_MYPORT --drizzle-host=localhost --db-driver=drizzle --num-threads=16 |
687 | - |
688 | -[test_servers] |
689 | -servers = [[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]] |
690 | |
691 | === removed file 'tests/kewpie/sysbench_tests/readonly/concurrency_256.cnf' |
692 | --- tests/kewpie/sysbench_tests/readonly/concurrency_256.cnf 2011-10-05 20:26:34 +0000 |
693 | +++ tests/kewpie/sysbench_tests/readonly/concurrency_256.cnf 1970-01-01 00:00:00 +0000 |
694 | @@ -1,8 +0,0 @@ |
695 | -[test_info] |
696 | -comment = 16 threads |
697 | - |
698 | -[test_command] |
699 | -command = sysbench --max-time=240 --max-requests=0 --test=oltp --db-ps-mode=disable --drizzle-table-engine=innodb --oltp-read-only=on --oltp-table-size=1000000 --drizzle-mysql=on --drizzle-user=root --drizzle-db=test --drizzle-port=$MASTER_MYPORT --drizzle-host=localhost --db-driver=drizzle --num-threads=256 |
700 | - |
701 | -[test_servers] |
702 | -servers = [[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]] |
703 | |
704 | === removed file 'tests/kewpie/sysbench_tests/readonly/concurrency_32.cnf' |
705 | --- tests/kewpie/sysbench_tests/readonly/concurrency_32.cnf 2011-10-05 20:26:34 +0000 |
706 | +++ tests/kewpie/sysbench_tests/readonly/concurrency_32.cnf 1970-01-01 00:00:00 +0000 |
707 | @@ -1,8 +0,0 @@ |
708 | -[test_info] |
709 | -comment = 16 threads |
710 | - |
711 | -[test_command] |
712 | -command = sysbench --max-time=240 --max-requests=0 --test=oltp --db-ps-mode=disable --drizzle-table-engine=innodb --oltp-read-only=on --oltp-table-size=1000000 --drizzle-mysql=on --drizzle-user=root --drizzle-db=test --drizzle-port=$MASTER_MYPORT --drizzle-host=localhost --db-driver=drizzle --num-threads=32 |
713 | - |
714 | -[test_servers] |
715 | -servers = [[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]] |
716 | |
717 | === removed file 'tests/kewpie/sysbench_tests/readonly/concurrency_512.cnf' |
718 | --- tests/kewpie/sysbench_tests/readonly/concurrency_512.cnf 2011-10-05 20:26:34 +0000 |
719 | +++ tests/kewpie/sysbench_tests/readonly/concurrency_512.cnf 1970-01-01 00:00:00 +0000 |
720 | @@ -1,8 +0,0 @@ |
721 | -[test_info] |
722 | -comment = 16 threads |
723 | - |
724 | -[test_command] |
725 | -command = sysbench --max-time=240 --max-requests=0 --test=oltp --db-ps-mode=disable --drizzle-table-engine=innodb --oltp-read-only=on --oltp-table-size=1000000 --drizzle-mysql=on --drizzle-user=root --drizzle-db=test --drizzle-port=$MASTER_MYPORT --drizzle-host=localhost --db-driver=drizzle --num-threads=512 |
726 | - |
727 | -[test_servers] |
728 | -servers = [[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]] |
729 | |
730 | === removed file 'tests/kewpie/sysbench_tests/readonly/concurrency_64.cnf' |
731 | --- tests/kewpie/sysbench_tests/readonly/concurrency_64.cnf 2011-10-05 20:26:34 +0000 |
732 | +++ tests/kewpie/sysbench_tests/readonly/concurrency_64.cnf 1970-01-01 00:00:00 +0000 |
733 | @@ -1,8 +0,0 @@ |
734 | -[test_info] |
735 | -comment = 16 threads |
736 | - |
737 | -[test_command] |
738 | -command = sysbench --max-time=240 --max-requests=0 --test=oltp --db-ps-mode=disable --drizzle-table-engine=innodb --oltp-read-only=on --oltp-table-size=1000000 --drizzle-mysql=on --drizzle-user=root --drizzle-db=test --drizzle-port=$MASTER_MYPORT --drizzle-host=localhost --db-driver=drizzle --num-threads=64 |
739 | - |
740 | -[test_servers] |
741 | -servers = [[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]] |
742 | |
743 | === removed directory 'tests/kewpie/sysbench_tests/readwrite' |
744 | === removed file 'tests/kewpie/sysbench_tests/readwrite/concurrency_1024.cnf' |
745 | --- tests/kewpie/sysbench_tests/readwrite/concurrency_1024.cnf 2011-10-05 20:26:34 +0000 |
746 | +++ tests/kewpie/sysbench_tests/readwrite/concurrency_1024.cnf 1970-01-01 00:00:00 +0000 |
747 | @@ -1,8 +0,0 @@ |
748 | -[test_info] |
749 | -comment = 16 threads |
750 | - |
751 | -[test_command] |
752 | -command = sysbench --max-time=240 --max-requests=0 --test=oltp --db-ps-mode=disable --drizzle-table-engine=innodb --oltp-read-only=off --oltp-table-size=1000000 --drizzle-mysql=on --drizzle-user=root --drizzle-db=test --drizzle-port=$MASTER_MYPORT --drizzle-host=localhost --db-driver=drizzle --num-threads=1024 |
753 | - |
754 | -[test_servers] |
755 | -servers = [[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]] |
756 | |
757 | === removed file 'tests/kewpie/sysbench_tests/readwrite/concurrency_128.cnf' |
758 | --- tests/kewpie/sysbench_tests/readwrite/concurrency_128.cnf 2011-10-05 20:26:34 +0000 |
759 | +++ tests/kewpie/sysbench_tests/readwrite/concurrency_128.cnf 1970-01-01 00:00:00 +0000 |
760 | @@ -1,8 +0,0 @@ |
761 | -[test_info] |
762 | -comment = 16 threads |
763 | - |
764 | -[test_command] |
765 | -command = sysbench --max-time=240 --max-requests=0 --test=oltp --db-ps-mode=disable --drizzle-table-engine=innodb --oltp-read-only=off --oltp-table-size=1000000 --drizzle-mysql=on --drizzle-user=root --drizzle-db=test --drizzle-port=$MASTER_MYPORT --drizzle-host=localhost --db-driver=drizzle --num-threads=128 |
766 | - |
767 | -[test_servers] |
768 | -servers = [[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]] |
769 | |
770 | === removed file 'tests/kewpie/sysbench_tests/readwrite/concurrency_16.cnf' |
771 | --- tests/kewpie/sysbench_tests/readwrite/concurrency_16.cnf 2011-10-05 20:26:34 +0000 |
772 | +++ tests/kewpie/sysbench_tests/readwrite/concurrency_16.cnf 1970-01-01 00:00:00 +0000 |
773 | @@ -1,8 +0,0 @@ |
774 | -[test_info] |
775 | -comment = 16 threads |
776 | - |
777 | -[test_command] |
778 | -command = sysbench --max-time=240 --max-requests=0 --test=oltp --db-ps-mode=disable --drizzle-table-engine=innodb --oltp-read-only=off --oltp-table-size=1000000 --drizzle-mysql=on --drizzle-user=root --drizzle-db=test --drizzle-port=$MASTER_MYPORT --drizzle-host=localhost --db-driver=drizzle --num-threads=16 |
779 | - |
780 | -[test_servers] |
781 | -servers = [[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]] |
782 | |
783 | === removed file 'tests/kewpie/sysbench_tests/readwrite/concurrency_256.cnf' |
784 | --- tests/kewpie/sysbench_tests/readwrite/concurrency_256.cnf 2011-10-05 20:26:34 +0000 |
785 | +++ tests/kewpie/sysbench_tests/readwrite/concurrency_256.cnf 1970-01-01 00:00:00 +0000 |
786 | @@ -1,8 +0,0 @@ |
787 | -[test_info] |
788 | -comment = 16 threads |
789 | - |
790 | -[test_command] |
791 | -command = sysbench --max-time=240 --max-requests=0 --test=oltp --db-ps-mode=disable --drizzle-table-engine=innodb --oltp-read-only=off --oltp-table-size=1000000 --drizzle-mysql=on --drizzle-user=root --drizzle-db=test --drizzle-port=$MASTER_MYPORT --drizzle-host=localhost --db-driver=drizzle --num-threads=256 |
792 | - |
793 | -[test_servers] |
794 | -servers = [[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]] |
795 | |
796 | === removed file 'tests/kewpie/sysbench_tests/readwrite/concurrency_32.cnf' |
797 | --- tests/kewpie/sysbench_tests/readwrite/concurrency_32.cnf 2011-10-05 20:26:34 +0000 |
798 | +++ tests/kewpie/sysbench_tests/readwrite/concurrency_32.cnf 1970-01-01 00:00:00 +0000 |
799 | @@ -1,8 +0,0 @@ |
800 | -[test_info] |
801 | -comment = 16 threads |
802 | - |
803 | -[test_command] |
804 | -command = sysbench --max-time=240 --max-requests=0 --test=oltp --db-ps-mode=disable --drizzle-table-engine=innodb --oltp-read-only=off --oltp-table-size=1000000 --drizzle-mysql=on --drizzle-user=root --drizzle-db=test --drizzle-port=$MASTER_MYPORT --drizzle-host=localhost --db-driver=drizzle --num-threads=32 |
805 | - |
806 | -[test_servers] |
807 | -servers = [[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]] |
808 | |
809 | === removed file 'tests/kewpie/sysbench_tests/readwrite/concurrency_512.cnf' |
810 | --- tests/kewpie/sysbench_tests/readwrite/concurrency_512.cnf 2011-10-05 20:26:34 +0000 |
811 | +++ tests/kewpie/sysbench_tests/readwrite/concurrency_512.cnf 1970-01-01 00:00:00 +0000 |
812 | @@ -1,8 +0,0 @@ |
813 | -[test_info] |
814 | -comment = 16 threads |
815 | - |
816 | -[test_command] |
817 | -command = sysbench --max-time=240 --max-requests=0 --test=oltp --db-ps-mode=disable --drizzle-table-engine=innodb --oltp-read-only=off --oltp-table-size=1000000 --drizzle-mysql=on --drizzle-user=root --drizzle-db=test --drizzle-port=$MASTER_MYPORT --drizzle-host=localhost --db-driver=drizzle --num-threads=512 |
818 | - |
819 | -[test_servers] |
820 | -servers = [[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]] |
821 | |
822 | === removed file 'tests/kewpie/sysbench_tests/readwrite/concurrency_64.cnf' |
823 | --- tests/kewpie/sysbench_tests/readwrite/concurrency_64.cnf 2011-10-05 20:26:34 +0000 |
824 | +++ tests/kewpie/sysbench_tests/readwrite/concurrency_64.cnf 1970-01-01 00:00:00 +0000 |
825 | @@ -1,8 +0,0 @@ |
826 | -[test_info] |
827 | -comment = 16 threads |
828 | - |
829 | -[test_command] |
830 | -command = sysbench --max-time=240 --max-requests=0 --test=oltp --db-ps-mode=disable --drizzle-table-engine=innodb --oltp-read-only=off --oltp-table-size=1000000 --drizzle-mysql=on --drizzle-user=root --drizzle-db=test --drizzle-port=$MASTER_MYPORT --drizzle-host=localhost --db-driver=drizzle --num-threads=64 |
831 | - |
832 | -[test_servers] |
833 | -servers = [[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]] |
834 | |
835 | === removed directory 'tests/lib/dbqp_modes' |
836 | === removed file 'tests/lib/dbqp_modes/__init__.py' |
837 | === removed directory 'tests/lib/dbqp_modes/crashme' |
838 | === removed file 'tests/lib/dbqp_modes/crashme/__init__.py' |
839 | === removed file 'tests/lib/dbqp_modes/crashme/crashme_test_execution.py' |
840 | --- tests/lib/dbqp_modes/crashme/crashme_test_execution.py 2011-06-28 21:07:43 +0000 |
841 | +++ tests/lib/dbqp_modes/crashme/crashme_test_execution.py 1970-01-01 00:00:00 +0000 |
842 | @@ -1,140 +0,0 @@ |
843 | -#! /usr/bin/env python |
844 | -# -*- mode: python; indent-tabs-mode: nil; -*- |
845 | -# vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
846 | -# |
847 | -# Copyright (C) 2011 Patrick Crews |
848 | -# |
849 | -# |
850 | -# This program is free software; you can redistribute it and/or modify |
851 | -# it under the terms of the GNU General Public License as published by |
852 | -# the Free Software Foundation; either version 2 of the License, or |
853 | -# (at your option) any later version. |
854 | -# |
855 | -# This program is distributed in the hope that it will be useful, |
856 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
857 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
858 | -# GNU General Public License for more details. |
859 | -# |
860 | -# You should have received a copy of the GNU General Public License |
861 | -# along with this program; if not, write to the Free Software |
862 | -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
863 | - |
864 | -""" crashme_test_execution: |
865 | - code related to the execution of crashme test cases |
866 | - |
867 | - We are provided access to a testManager with |
868 | - crashme-specific testCases. |
869 | - |
870 | -""" |
871 | - |
872 | -# imports |
873 | -import os |
874 | -import re |
875 | -import sys |
876 | -import subprocess |
877 | -import commands |
878 | - |
879 | -import lib.test_mgmt.test_execution as test_execution |
880 | - |
881 | -class testExecutor(test_execution.testExecutor): |
882 | - """ crashme-specific executor """ |
883 | - |
884 | - def execute_testCase (self): |
885 | - """ Execute a crashme testCase |
886 | - |
887 | - """ |
888 | - test_execution.testExecutor.execute_testCase(self) |
889 | - self.status = 0 |
890 | - |
891 | - self.prepare_config() |
892 | - |
893 | - # execute crashme |
894 | - self.execute_crashme() |
895 | - |
896 | - # analyze results |
897 | - self.current_test_status = self.process_crashme_output() |
898 | - self.set_server_status(self.current_test_status) |
899 | - self.server_manager.reset_servers(self.name) |
900 | - |
901 | - def prepare_config(self): |
902 | - """ Create the config file crash-me needs to execute """ |
903 | - |
904 | - output_filename= "%s/drizzle.cfg" % (self.system_manager.workdir) |
905 | - |
906 | - # remove the existing configuration file to start fresh |
907 | - if os.path.exists(output_filename): |
908 | - logging.info("Removing %s" % output_filename) |
909 | - os.remove(output_filename) |
910 | - |
911 | - output_file= open(output_filename,"w") |
912 | - # don't support '+' for concatenation |
913 | - output_file.writelines("func_extra_concat_as_+=no\n") |
914 | - # new boost libraries are causing us to put these limits in, needs investigation |
915 | - output_file.writelines("max_text_size=1048576\n") |
916 | - output_file.writelines("where_string_size=1048576\n") |
917 | - output_file.writelines("select_string_size=1048576\n") |
918 | - output_file.flush() |
919 | - output_file.close() |
920 | - |
921 | - def execute_crashme(self): |
922 | - """ Execute the commandline and return the result. |
923 | - We use subprocess as we can pass os.environ dicts and whatnot |
924 | - |
925 | - """ |
926 | - |
927 | - output_filename= "%s/drizzle.cfg" % (self.system_manager.workdir) |
928 | - testcase_name = self.current_testcase.fullname |
929 | - self.time_manager.start(testcase_name,'test') |
930 | - crashme_outfile = os.path.join(self.logdir,'crashme.out') |
931 | - crashme_output = open(crashme_outfile,'w') |
932 | - crashme_cmd = self.current_testcase.test_command + " --config-file=%s" %(output_filename) |
933 | - self.logging.info("Executing crash-me: %s" %(crashme_cmd)) |
934 | - |
935 | - crashme_subproc = subprocess.Popen( crashme_cmd |
936 | - , shell=True |
937 | - , cwd=os.path.join(self.system_manager.testdir, 'sql-bench') |
938 | - , env=self.working_environment |
939 | - , stdout = crashme_output |
940 | - , stderr = subprocess.STDOUT |
941 | - ) |
942 | - crashme_subproc.wait() |
943 | - retcode = crashme_subproc.returncode |
944 | - execution_time = int(self.time_manager.stop(testcase_name)*1000) # millisec |
945 | - |
946 | - crashme_output.close() |
947 | - crashme_file = open(crashme_outfile,'r') |
948 | - output = ''.join(crashme_file.readlines()) |
949 | - self.logging.debug(output) |
950 | - crashme_file.close() |
951 | - |
952 | - self.logging.debug("crashme_retcode: %d" %(retcode)) |
953 | - self.current_test_retcode = retcode |
954 | - self.current_test_output = output |
955 | - self.current_test_exec_time = execution_time |
956 | - |
957 | - def process_crashme_output(self): |
958 | - if self.current_test_retcode == 0: |
959 | - infile_name = self.current_test_output.split('\n')[3].split(':')[1].strip() |
960 | - inf= open(infile_name, "r") |
961 | - inlines= inf.readlines() |
962 | - error_flag= False |
963 | - in_error_section = False |
964 | - # crash-me is quite chatty and we don't normally want to sift |
965 | - # through ALL of that stuff. We do allow seeing it via --verbose |
966 | - if not self.verbose: |
967 | - self.current_test_output = '' |
968 | - for inline in inlines: |
969 | - if in_error_section and not inline.strip().startswith('#'): |
970 | - in_error_section = False |
971 | - if '=error' in inline: |
972 | - error_flag= True |
973 | - in_error_section= True |
974 | - if in_error_section: |
975 | - self.current_test_output += inline |
976 | - inf.close() |
977 | - if not error_flag: |
978 | - return 'pass' |
979 | - |
980 | - return 'fail' |
981 | - |
982 | - |
983 | |
984 | === removed file 'tests/lib/dbqp_modes/crashme/crashme_test_management.py' |
985 | --- tests/lib/dbqp_modes/crashme/crashme_test_management.py 2011-06-28 21:07:43 +0000 |
986 | +++ tests/lib/dbqp_modes/crashme/crashme_test_management.py 1970-01-01 00:00:00 +0000 |
987 | @@ -1,189 +0,0 @@ |
988 | -#! /usr/bin/env python |
989 | -# -*- mode: python; indent-tabs-mode: nil; -*- |
990 | -# vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
991 | -# |
992 | -# Copyright (C) 2011 Patrick Crews |
993 | -# |
994 | -## This program is free software; you can redistribute it and/or modify |
995 | -# it under the terms of the GNU General Public License as published by |
996 | -# the Free Software Foundation; either version 2 of the License, or |
997 | -# (at your option) any later version. |
998 | -# |
999 | -# This program is distributed in the hope that it will be useful, |
1000 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1001 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1002 | -# GNU General Public License for more details. |
1003 | -# |
1004 | -# You should have received a copy of the GNU General Public License |
1005 | -# along with this program; if not, write to the Free Software |
1006 | -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
1007 | - |
1008 | -""" crashme_test_management: |
1009 | - code related to the gathering / analysis / management of |
1010 | - the test cases |
1011 | - ie - collecting the list of tests in each suite, then |
1012 | - gathering additional, relevant information for crashme mode |
1013 | - |
1014 | -""" |
1015 | - |
1016 | -# imports |
1017 | -import os |
1018 | -import re |
1019 | -import sys |
1020 | -from ConfigParser import RawConfigParser |
1021 | - |
1022 | -import lib.test_mgmt.test_management as test_management |
1023 | - |
1024 | - |
1025 | - |
1026 | -class testCase: |
1027 | - """Holds info on a single crashme test |
1028 | - |
1029 | - """ |
1030 | - def __init__( self, system_manager, name=None |
1031 | - , fullname = None, server_requirements=[[]] |
1032 | - , comment=None, test_command=None, cnf_path=None |
1033 | - , suitename = 'crashme_tests' |
1034 | - , debug=False ): |
1035 | - self.system_manager = system_manager |
1036 | - self.logging = self.system_manager.logging |
1037 | - self.skip_keys = ['system_manager','logging'] |
1038 | - self.name = name |
1039 | - self.fullname = fullname |
1040 | - self.suitename = suitename |
1041 | - self.master_sh = None |
1042 | - self.comment = comment |
1043 | - self.server_requirements = server_requirements |
1044 | - self.test_command = test_command |
1045 | - self.cnf_path = cnf_path |
1046 | - |
1047 | - if debug: |
1048 | - self.system_manager.logging.debug_class(self) |
1049 | - |
1050 | - def should_run(self): |
1051 | - if self.skip_flag or self.disable: |
1052 | - return 0 |
1053 | - else: |
1054 | - return 1 |
1055 | - |
1056 | - |
1057 | - |
1058 | - |
1059 | - |
1060 | -class testManager(test_management.testManager): |
1061 | - """Deals with scanning test directories, gathering test cases, and |
1062 | - collecting per-test information (opt files, etc) for use by the |
1063 | - test-runner |
1064 | - |
1065 | - """ |
1066 | - |
1067 | - def __init__( self, variables, system_manager): |
1068 | - super(testManager, self).__init__( variables, system_manager) |
1069 | - self.suitepaths = [os.path.join(self.testdir,'crashme_tests')] |
1070 | - if variables['suitelist'] is None: |
1071 | - self.suitelist = ['main'] |
1072 | - else: |
1073 | - self.suitelist = variables['suitelist'] |
1074 | - |
1075 | - def process_suite(self,suite_dir): |
1076 | - """Process a test suite. |
1077 | - Look for crashme tests, which are nice clean conf files |
1078 | - |
1079 | - """ |
1080 | - |
1081 | - # We know this based on how we organize crashme test conf files |
1082 | - suite_name = os.path.basename(suite_dir) |
1083 | - self.system_manager.logging.verbose("Processing suite: %s" %(suite_name)) |
1084 | - testlist = [os.path.join(suite_dir,test_file) for test_file in sorted(os.listdir(suite_dir)) if test_file.endswith('.cnf')] |
1085 | - |
1086 | - # Search for specific test names |
1087 | - if self.desired_tests: # We have specific, named tests we want from the suite(s) |
1088 | - tests_to_use = [] |
1089 | - for test in self.desired_tests: |
1090 | - if test.endswith('.cnf'): |
1091 | - pass |
1092 | - else: |
1093 | - test = test+'.cnf' |
1094 | - test = os.path.join(suite_dir,test) |
1095 | - if test in testlist: |
1096 | - tests_to_use.append(test) |
1097 | - testlist = tests_to_use |
1098 | - for test_case in testlist: |
1099 | - self.add_test(self.process_test_file(suite_name, test_case)) |
1100 | - |
1101 | - |
1102 | - def process_test_file(self, suite_name, testfile): |
1103 | - """ We convert the info in a testfile into a testCase object """ |
1104 | - |
1105 | - config_reader = RawConfigParser() |
1106 | - config_reader.read(testfile) |
1107 | - # test_name = filename - .cnf...simpler |
1108 | - test_name = os.path.basename(testfile).replace('.cnf','') |
1109 | - test_comment = config_reader.get('test_info','comment') |
1110 | - server_requirements = self.process_server_reqs(config_reader.get('test_servers','servers')) |
1111 | - test_command = config_reader.get('test_command','command') |
1112 | - return testCase( self.system_manager |
1113 | - , name = test_name |
1114 | - , fullname = "%s.%s" %(suite_name, test_name) |
1115 | - , server_requirements = server_requirements |
1116 | - , test_command = test_command |
1117 | - , cnf_path = testfile |
1118 | - , debug = self.debug ) |
1119 | - |
1120 | - #sys.exit(0) |
1121 | - |
1122 | - def process_server_reqs(self,data_string): |
1123 | - """ We read in the list of lists as a string, so we need to |
1124 | - handle this / break it down into proper chunks |
1125 | - |
1126 | - """ |
1127 | - server_reqs = [] |
1128 | - # We expect to see a list of lists and throw away the |
1129 | - # enclosing brackets |
1130 | - option_sets = data_string[1:-1].strip().split(',') |
1131 | - for option_set in option_sets: |
1132 | - server_reqs.append([option_set[1:-1].strip()]) |
1133 | - return server_reqs |
1134 | - |
1135 | - def record_test_result(self, test_case, test_status, output, exec_time): |
1136 | - """ Accept the results of an executed testCase for further |
1137 | - processing. |
1138 | - |
1139 | - """ |
1140 | - if test_status not in self.executed_tests: |
1141 | - self.executed_tests[test_status] = [test_case] |
1142 | - else: |
1143 | - self.executed_tests[test_status].append(test_case) |
1144 | - # report |
1145 | - self.logging.test_report( test_case.fullname, test_status |
1146 | - , str(exec_time), output |
1147 | - , report_output= True) |
1148 | - |
1149 | -class crashmeTestManager(testManager): |
1150 | - """Deals with scanning test directories, gathering test cases, and |
1151 | - collecting per-test information (opt files, etc) for use by the |
1152 | - test-runner |
1153 | - |
1154 | - """ |
1155 | - |
1156 | - def __init__( self, variables, system_manager): |
1157 | - super(testManager, self).__init__( variables, system_manager) |
1158 | - self.suitepaths = [os.path.join(self.testdir,'crashme_tests')] |
1159 | - if variables['suitelist'] is None: |
1160 | - self.suitelist = ['main'] |
1161 | - else: |
1162 | - self.suitelist = variables['suitelist'] |
1163 | - |
1164 | - def record_test_result(self, test_case, test_status, output, exec_time): |
1165 | - """ Accept the results of an executed testCase for further |
1166 | - processing. |
1167 | - |
1168 | - """ |
1169 | - if test_status not in self.executed_tests: |
1170 | - self.executed_tests[test_status] = [test_case] |
1171 | - else: |
1172 | - self.executed_tests[test_status].append(test_case) |
1173 | - # report |
1174 | - self.logging.test_report( test_case.fullname, test_status |
1175 | - , str(exec_time), output |
1176 | - , report_output= True) |
1177 | |
1178 | === removed directory 'tests/lib/dbqp_modes/dtr' |
1179 | === removed file 'tests/lib/dbqp_modes/dtr/__init__.py' |
1180 | === removed file 'tests/lib/dbqp_modes/dtr/dtr_test_execution.py' |
1181 | --- tests/lib/dbqp_modes/dtr/dtr_test_execution.py 2011-08-15 16:19:31 +0000 |
1182 | +++ tests/lib/dbqp_modes/dtr/dtr_test_execution.py 1970-01-01 00:00:00 +0000 |
1183 | @@ -1,139 +0,0 @@ |
1184 | -#! /usr/bin/env python |
1185 | -# -*- mode: python; indent-tabs-mode: nil; -*- |
1186 | -# vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
1187 | -# |
1188 | -# Copyright (C) 2010 Patrick Crews |
1189 | -# |
1190 | -# |
1191 | -# This program is free software; you can redistribute it and/or modify |
1192 | -# it under the terms of the GNU General Public License as published by |
1193 | -# the Free Software Foundation; either version 2 of the License, or |
1194 | -# (at your option) any later version. |
1195 | -# |
1196 | -# This program is distributed in the hope that it will be useful, |
1197 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1198 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1199 | -# GNU General Public License for more details. |
1200 | -# |
1201 | -# You should have received a copy of the GNU General Public License |
1202 | -# along with this program; if not, write to the Free Software |
1203 | -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
1204 | - |
1205 | -""" dtr_test_execution: |
1206 | - code related to the execution of dtr test cases |
1207 | - |
1208 | - We are provided access to a testManager with |
1209 | - dtr-specific testCases. We contact teh executionManager |
1210 | - to produce the system and server configurations we need |
1211 | - to execute a test. |
1212 | - |
1213 | -""" |
1214 | - |
1215 | -# imports |
1216 | -import os |
1217 | -import sys |
1218 | -import subprocess |
1219 | -import commands |
1220 | - |
1221 | -import lib.test_mgmt.test_execution as test_execution |
1222 | - |
1223 | -class testExecutor(test_execution.testExecutor): |
1224 | - """ dtr-specific testExecutor |
1225 | - We currently execute by sending test-case |
1226 | - data to client/drizzletest...for now |
1227 | - |
1228 | - """ |
1229 | - |
1230 | - def execute_testCase (self): |
1231 | - """ Execute a dtr testCase via calls to drizzletest (boo) |
1232 | - Eventually, we will replace drizzletest with pythonic |
1233 | - goodness, but we have these classes stored here for the moment |
1234 | - |
1235 | - """ |
1236 | - test_execution.testExecutor.execute_testCase(self) |
1237 | - self.status = 0 |
1238 | - |
1239 | - # generate command line |
1240 | - drizzletest_cmd = self.generate_drizzletest_call() |
1241 | - |
1242 | - # call drizzletest |
1243 | - self.execute_drizzletest(drizzletest_cmd) |
1244 | - |
1245 | - # analyze results |
1246 | - self.current_test_status = self.process_drizzletest_output() |
1247 | - self.set_server_status(self.current_test_status) |
1248 | - |
1249 | - |
1250 | - def generate_drizzletest_call(self): |
1251 | - """ Produce the command line we use to call drizzletest |
1252 | - We have a healthy number of values, so we put this in a |
1253 | - nice function |
1254 | - |
1255 | - """ |
1256 | - |
1257 | - drizzletest_arguments = [ '--no-defaults' |
1258 | - , '--silent' |
1259 | - , '--tmpdir=%s' %(self.master_server.tmpdir) |
1260 | - , '--logdir=%s' %(self.master_server.logdir) |
1261 | - , '--port=%d' %(self.master_server.master_port) |
1262 | - , '--database=test' |
1263 | - , '--user=root' |
1264 | - , '--password=' |
1265 | - #, '--testdir=%s' %(self.test_manager.testdir) |
1266 | - , '--test-file=%s' %(self.current_testcase.testpath) |
1267 | - , '--tail-lines=20' |
1268 | - , '--timer-file=%s' %(self.master_server.timer_file) |
1269 | - , '--result-file=%s' %(self.current_testcase.resultpath) |
1270 | - ] |
1271 | - if self.record_flag: |
1272 | - # We want to record a new result |
1273 | - drizzletest_arguments.append('--record') |
1274 | - drizzletest_cmd = "%s %s %s" %( self.cmd_prefix |
1275 | - , self.master_server.code_tree.drizzletest |
1276 | - , " ".join(drizzletest_arguments)) |
1277 | - return drizzletest_cmd |
1278 | - |
1279 | - def execute_drizzletest(self, drizzletest_cmd): |
1280 | - """ Execute the commandline and return the result. |
1281 | - We use subprocess as we can pass os.environ dicts and whatnot |
1282 | - |
1283 | - """ |
1284 | - testcase_name = self.current_testcase.fullname |
1285 | - self.time_manager.start(testcase_name,'test') |
1286 | - #retcode, output = self.system_manager.execute_cmd( drizzletest_cmd |
1287 | - # , must_pass = 0 ) |
1288 | - drizzletest_outfile = os.path.join(self.logdir,'drizzletest.out') |
1289 | - drizzletest_output = open(drizzletest_outfile,'w') |
1290 | - drizzletest_subproc = subprocess.Popen( drizzletest_cmd |
1291 | - , shell=True |
1292 | - , cwd=self.system_manager.testdir |
1293 | - , env=self.working_environment |
1294 | - , stdout = drizzletest_output |
1295 | - , stderr = subprocess.STDOUT |
1296 | - ) |
1297 | - drizzletest_subproc.wait() |
1298 | - retcode = drizzletest_subproc.returncode |
1299 | - execution_time = int(self.time_manager.stop(testcase_name)*1000) # millisec |
1300 | - |
1301 | - drizzletest_output.close() |
1302 | - drizzletest_file = open(drizzletest_outfile,'r') |
1303 | - output = ''.join(drizzletest_file.readlines()) |
1304 | - drizzletest_file.close() |
1305 | - |
1306 | - self.logging.debug("drizzletest_retcode: %d" %(retcode)) |
1307 | - self.current_test_retcode = retcode |
1308 | - self.current_test_output = output |
1309 | - self.current_test_exec_time = execution_time |
1310 | - |
1311 | - def process_drizzletest_output(self): |
1312 | - """ Drizzletest has run, we now check out what we have """ |
1313 | - retcode = self.current_test_retcode |
1314 | - if retcode == 0: |
1315 | - return 'pass' |
1316 | - elif retcode == 62 or retcode == 15872: |
1317 | - return 'skipped' |
1318 | - elif retcode == 63 or retcode == 1: |
1319 | - return 'fail' |
1320 | - else: |
1321 | - return 'fail' |
1322 | - |
1323 | |
1324 | === removed file 'tests/lib/dbqp_modes/dtr/dtr_test_management.py' |
1325 | --- tests/lib/dbqp_modes/dtr/dtr_test_management.py 2011-06-17 21:40:42 +0000 |
1326 | +++ tests/lib/dbqp_modes/dtr/dtr_test_management.py 1970-01-01 00:00:00 +0000 |
1327 | @@ -1,495 +0,0 @@ |
1328 | -#! /usr/bin/env python |
1329 | -# -*- mode: python; indent-tabs-mode: nil; -*- |
1330 | -# vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
1331 | -# |
1332 | -# Copyright (C) 2010 Patrick Crews |
1333 | -# |
1334 | -## This program is free software; you can redistribute it and/or modify |
1335 | -# it under the terms of the GNU General Public License as published by |
1336 | -# the Free Software Foundation; either version 2 of the License, or |
1337 | -# (at your option) any later version. |
1338 | -# |
1339 | -# This program is distributed in the hope that it will be useful, |
1340 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1341 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1342 | -# GNU General Public License for more details. |
1343 | -# |
1344 | -# You should have received a copy of the GNU General Public License |
1345 | -# along with this program; if not, write to the Free Software |
1346 | -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
1347 | - |
1348 | -""" dtr_test_management: |
1349 | - code related to the gathering / analysis / management of |
1350 | - the test cases |
1351 | - ie - collecting the list of tests in each suite, then |
1352 | - gathering additional, relevant information for the test-runner's dtr |
1353 | - mode. (traditional diff-based testing) |
1354 | - |
1355 | -""" |
1356 | - |
1357 | -# imports |
1358 | -import os |
1359 | -import re |
1360 | -import sys |
1361 | -from ConfigParser import RawConfigParser |
1362 | - |
1363 | -import lib.test_mgmt.test_management as test_management |
1364 | - |
1365 | - |
1366 | - |
1367 | -class testCase: |
1368 | - """Holds info on a per .test file basis |
1369 | - Attributes contain information necessary to execute / validate |
1370 | - the test file when it is executed. |
1371 | - |
1372 | - """ |
1373 | - def __init__(self, system_manager, test_case=None, test_name=None, suite_name=None |
1374 | - , suite_path=None, test_server_options=[], test_path=None, result_path=None |
1375 | - , comment=None, master_sh=None, cnf_path=None |
1376 | - , disable=0, innodb_test=1 |
1377 | - , need_debug=0, debug=0): |
1378 | - self.system_manager = system_manager |
1379 | - self.logging = self.system_manager.logging |
1380 | - self.skip_keys = ['system_manager'] |
1381 | - self.testcase = test_case |
1382 | - self.testname = test_name |
1383 | - self.suitename = suite_name |
1384 | - self.suitepath = suite_path |
1385 | - self.fullname = "%s.%s" %(suite_name, test_name) |
1386 | - self.testpath = test_path |
1387 | - self.resultpath = result_path |
1388 | - |
1389 | - self.skip_flag = 0 |
1390 | - self.timezone = "GMT-3" |
1391 | - self.component_id = "drizzled" |
1392 | - self.slave_count = 0 |
1393 | - self.master_count = 1 |
1394 | - self.server_options = test_server_options |
1395 | - # We will populate this in a better fashion later on |
1396 | - # as we allow .cnf files, we need to do a bit of |
1397 | - # messing about to make this work right |
1398 | - if self.server_options == [] or type(self.server_options[0]) is not list: |
1399 | - self.server_requirements=[self.server_options] |
1400 | - else: |
1401 | - self.server_requirements = self.server_options |
1402 | - self.server_options= self.server_options[0][0] |
1403 | - self.comment = comment |
1404 | - self.master_sh = master_sh |
1405 | - self.cnf_path = cnf_path |
1406 | - self.disable = disable |
1407 | - self.innodb_test = innodb_test |
1408 | - self.need_debug = need_debug |
1409 | - |
1410 | - self.system_manager.logging.debug_class(self) |
1411 | - |
1412 | - def should_run(self): |
1413 | - if self.skip_flag or self.disable: |
1414 | - return 0 |
1415 | - else: |
1416 | - return 1 |
1417 | - |
1418 | - |
1419 | - |
1420 | - |
1421 | - |
1422 | -class testManager(test_management.testManager): |
1423 | - """Deals with scanning test directories, gathering test cases, and |
1424 | - collecting per-test information (opt files, etc) for use by the |
1425 | - test-runner |
1426 | - |
1427 | - """ |
1428 | - |
1429 | - def process_suite(self,suite_dir): |
1430 | - """Process a test suite. |
1431 | - This includes searching for tests in test_list and only |
1432 | - working with the named tests (all tests in suite is the default) |
1433 | - Further processing includes reading the disabled.def file |
1434 | - to know which tests to skip, processing the suite.opt file, |
1435 | - and processing the individual test cases for data relevant |
1436 | - to the rest of the test-runner |
1437 | - |
1438 | - """ |
1439 | - |
1440 | - self.system_manager.logging.verbose("Processing suite: %s" %(suite_dir)) |
1441 | - |
1442 | - # Generate our test and result files: |
1443 | - testdir = os.path.join(suite_dir, 't') |
1444 | - resultdir = os.path.join(suite_dir, 'r') |
1445 | - |
1446 | - # Do basic checks to make sure this is worth further work |
1447 | - self.check_suite(suite_dir, testdir, resultdir) |
1448 | - |
1449 | - # Get suite-level options |
1450 | - suite_options = [] |
1451 | - cnf_path, suite_options = self.process_suite_options(suite_dir) |
1452 | - |
1453 | - # Get the 'name' of the suite. This can require some processing |
1454 | - # But the name is useful for reporting and whatnot |
1455 | - suite_name = self.get_suite_name(suite_dir) |
1456 | - |
1457 | - # Get the contents of the testdir and filter it accordingly |
1458 | - # This applies do-test / skip-test filters and any specific |
1459 | - # test case names |
1460 | - testlist = self.testlist_filter(os.listdir(testdir)) |
1461 | - # sort our list if no individual tests were specified |
1462 | - if not self.desired_tests: |
1463 | - testlist.sort() |
1464 | - |
1465 | - # gather deeper information on tests we are interested in |
1466 | - if testlist: |
1467 | - # We have tests we want to process, we gather additional information |
1468 | - # that is useful at the suite level. This includes disabled tests |
1469 | - # Gather disabled test list. |
1470 | - # This is used in process_test_file() |
1471 | - disabled_tests = {} |
1472 | - disabled_tests = self.process_disabled_test_file(testdir) |
1473 | - for test_case in testlist: |
1474 | - self.add_test(self.process_test_file(suite_dir, |
1475 | - suite_name, cnf_path, suite_options |
1476 | - , disabled_tests, testdir |
1477 | - , resultdir, test_case)) |
1478 | - |
1479 | - def process_test_file(self, suite_dir, suite_name, suite_cnf_path, suite_options |
1480 | - , disabled_tests, testdir |
1481 | - , resultdir, test_case): |
1482 | - """ We generate / find / store all the relevant information per-test. |
1483 | - This information will be used when actually executing the test |
1484 | - We store the data in a testCase object |
1485 | - |
1486 | - """ |
1487 | - |
1488 | - test_server_options = suite_options |
1489 | - test_name = test_case.replace('.test','') |
1490 | - self.system_manager.logging.verbose("Processing test: %s.%s" %(suite_name,test_name)) |
1491 | - |
1492 | - |
1493 | - # Fix this , create a testCase with gather_test_data() passed |
1494 | - # as the argument |
1495 | - # Ensure we pass everything we need and use it all |
1496 | - ( test_path |
1497 | - , result_file_name |
1498 | - , result_path |
1499 | - , comment |
1500 | - , master_sh |
1501 | - , cnf_path |
1502 | - , test_server_options |
1503 | - , disable |
1504 | - , innodb_test |
1505 | - , need_debug) = self.gather_test_data(test_case, test_name, |
1506 | - suite_name, test_server_options,testdir, |
1507 | - resultdir, disabled_tests) |
1508 | - if suite_cnf_path and not cnf_path: |
1509 | - cnf_path=suite_cnf_path |
1510 | - test_case = testCase(self.system_manager, test_case, test_name, suite_name, |
1511 | - suite_dir, test_server_options,test_path, result_path, |
1512 | - master_sh=master_sh, cnf_path=cnf_path, debug=self.debug) |
1513 | - return test_case |
1514 | - |
1515 | - |
1516 | -######################################################################## |
1517 | -# utility functions |
1518 | -# |
1519 | -# Stuff that helps us out and simplifies our main functions |
1520 | -# But isn't that important unless you need to dig deep |
1521 | -######################################################################## |
1522 | - |
1523 | - def gather_test_data(self, test_case, test_name, suite_name, |
1524 | - test_server_options, testdir, resultdir, disabled_tests): |
1525 | - """ We gather all of the data needed to produce a testCase for |
1526 | - a given test |
1527 | - |
1528 | - """ |
1529 | - |
1530 | - test_path = os.path.join(testdir,test_case) |
1531 | - result_file_name = test_name+'.result' |
1532 | - result_path = self.find_result_path(resultdir, result_file_name) |
1533 | - comment = None |
1534 | - master_sh_path = test_path.replace('.test','-master.sh') |
1535 | - if os.path.exists(master_sh_path): |
1536 | - master_sh = master_sh_path |
1537 | - else: |
1538 | - master_sh = None |
1539 | - master_opt_path = test_path.replace('.test', '-master.opt') |
1540 | - config_file_path = test_path.replace('.test', '.cnf') |
1541 | - # NOTE: this currently makes suite level server options additive |
1542 | - # to file-level .opt files...not sure if this is the best. |
1543 | - test_server_options = test_server_options + self.process_opt_file( |
1544 | - master_opt_path) |
1545 | - # deal with .cnf files (which supercede master.opt stuff) |
1546 | - cnf_options = [] |
1547 | - cnf_flag, returned_options = self.process_cnf_file(config_file_path) |
1548 | - cnf_options += returned_options |
1549 | - if cnf_flag: # we found a proper file and need to override |
1550 | - found_options = cnf_options |
1551 | - else: |
1552 | - config_file_path = None |
1553 | - (disable, comment) = self.check_if_disabled(disabled_tests, test_name) |
1554 | - innodb_test = 0 |
1555 | - need_debug = 0 |
1556 | - return (test_path, result_file_name, result_path, comment, master_sh, |
1557 | - config_file_path, test_server_options, disable, innodb_test, need_debug) |
1558 | - |
1559 | - def check_suite(self, suite_dir, testdir, resultdir): |
1560 | - """Handle basic checks of the suite: |
1561 | - does the suite exist? |
1562 | - is there a /t dir? |
1563 | - is there a /r dir? |
1564 | - Error and die if not |
1565 | - |
1566 | - """ |
1567 | - # We expect suite to be a path name, no fuzzy searching |
1568 | - if not os.path.exists(suite_dir): |
1569 | - self.system_manager.logging.error("Suite: %s does not exist" %(suite_dir)) |
1570 | - sys.exit(1) |
1571 | - |
1572 | - # Ensure our test and result directories are present |
1573 | - if not os.path.exists(testdir): |
1574 | - self.system_manager.logging.error("Suite: %s does not have a 't' directory (expected location for test files)" %(suite_dir)) |
1575 | - sys.exit(1) |
1576 | - if not os.path.exists(resultdir): |
1577 | - self.system_manager.logging.error("Suite: %s does not have an 'r' directory (expected location for result files)" %(suite_dir)) |
1578 | - sys.exit(1) |
1579 | - |
1580 | - def get_suite_name(self, suite_dir): |
1581 | - """ Get the 'name' of the suite |
1582 | - This can either be the path basename or one directory up, as |
1583 | - in the case of files in the drizzle/plugins directory |
1584 | - |
1585 | - """ |
1586 | - |
1587 | - # We trim any trailing path delimiters as python returns |
1588 | - # '' for basedir if the path ends that way |
1589 | - # BEGIN horrible hack to accomodate bad location of main suite : / |
1590 | - if suite_dir == self.testdir: |
1591 | - return 'main' |
1592 | - # END horrible hack : / |
1593 | - if suite_dir.endswith('/'): |
1594 | - suite_dir=suite_dir[:-1] |
1595 | - suite_dir_root,suite_dir_basename = os.path.split(suite_dir) |
1596 | - if suite_dir_basename == 'tests' or suite_dir_basename == 'drizzle-tests': |
1597 | - suite_name = os.path.basename(suite_dir_root) |
1598 | - else: |
1599 | - suite_name = suite_dir_basename |
1600 | - self.system_manager.logging.debug("Suite_name: %s" %(suite_name)) |
1601 | - return suite_name |
1602 | - |
1603 | - def process_suite_options(self, suite_dir): |
1604 | - """ Process the suite.opt and master.opt files |
1605 | - that reside at the suite-level if they exist. |
1606 | - Return a list of the options found |
1607 | - |
1608 | - We also process .cnf files - this |
1609 | - is currently dbqp-only and is the proper |
1610 | - way to do things :P |
1611 | - |
1612 | - """ |
1613 | - found_options = [] |
1614 | - opt_files = ['t/master.opt','t/suite.opt'] |
1615 | - for opt_file in opt_files: |
1616 | - found_options = found_options + self.process_opt_file(os.path.join(suite_dir,opt_file)) |
1617 | - # We also process the suite-level .cnf file(s). We override |
1618 | - # a master.opt file if we have a .cnf file. There is no reason they |
1619 | - # should ever be used in conjunction and I am biased towards .cnf ; ) |
1620 | - cnf_files = ['t/master.cnf'] |
1621 | - cnf_options = [] |
1622 | - for cnf_file in cnf_files: |
1623 | - config_file_path = os.path.join(suite_dir,cnf_file) |
1624 | - cnf_flag, returned_options = self.process_cnf_file(config_file_path) |
1625 | - cnf_options += returned_options |
1626 | - if cnf_flag: # we found a proper file and need to override |
1627 | - found_options = cnf_options |
1628 | - else: |
1629 | - config_file_path = None |
1630 | - return config_file_path, found_options |
1631 | - |
1632 | - def process_disabled_test_file(self, testdir): |
1633 | - """ Checks and processes the suite's disabled.def |
1634 | - file. This file must reside in the suite/t directory |
1635 | - It must be in the format: |
1636 | - test-name : comment (eg BugNNNN - bug on hold, test disabled) |
1637 | - In reality a test should *never* be disabled. EVER. |
1638 | - However, we keep this as a bit of utility |
1639 | - |
1640 | - """ |
1641 | - disabled_tests = {} |
1642 | - disabled_def_path = os.path.join(testdir,'disabled.def') |
1643 | - if not os.path.exists(disabled_def_path): |
1644 | - return disabled_tests |
1645 | - |
1646 | - try: |
1647 | - disabled_test_file = open(disabled_def_path,'r') |
1648 | - except IOError, e: |
1649 | - self.system_manager.logging.error("Problem opening disabled.def file: %s" %(disabled_def_path)) |
1650 | - sys.exit(1) |
1651 | - |
1652 | - self.system_manager.logging.debug("Processing disabled.def file: %s" %(disabled_def_path)) |
1653 | - disabled_bug_pattern = re.compile("[\S]+[\s]+:[\s]+[\S]") |
1654 | - |
1655 | - for line in disabled_test_file: |
1656 | - line = line.strip() |
1657 | - if not line.startswith('#'): # comment |
1658 | - if re.match(disabled_test_pattern,line): |
1659 | - self.system_manager.logging.debug("found disabled test - %s" %(line)) |
1660 | - test_name, test_comment = line.split(':') |
1661 | - disabled_tests[test_name.strip()]=test_comment.strip() |
1662 | - |
1663 | - disabled_test_file.close() |
1664 | - return disabled_tests |
1665 | - |
1666 | - |
1667 | - def process_opt_file(self, opt_file_path): |
1668 | - """ Process a test-run '.opt' file. |
1669 | - These files contain test and suite-specific server options |
1670 | - (ie what options the server needs to use for the test) |
1671 | - |
1672 | - Returns a list of the options (we don't really validate...yet) |
1673 | - |
1674 | - NOTE: test-run.pl allows for server *and* system options |
1675 | - (eg timezone, slave_count, etc) in opt files. We don't. |
1676 | - None of our tests use this and we should probably avoid it |
1677 | - We can introduce server and system .opt files or even better |
1678 | - would be to use config files as we do with drizzle-automation |
1679 | - This would allow us to specify options for several different |
1680 | - things in a single file, but in a clean and standardized manner |
1681 | - |
1682 | - """ |
1683 | - found_options = [] |
1684 | - if not os.path.exists(opt_file_path): |
1685 | - return found_options |
1686 | - |
1687 | - try: |
1688 | - opt_file = open(opt_file_path,'r') |
1689 | - except IOError, e: |
1690 | - self.system_manager.logging.error("Problem opening option file: %s" %(opt_file_path)) |
1691 | - sys.exit(1) |
1692 | - |
1693 | - self.system_manager.logging.debug("Processing opt file: %s" %(opt_file_path)) |
1694 | - for line in opt_file: |
1695 | - options = line.split('--') |
1696 | - if options: |
1697 | - for option in options: |
1698 | - if option: |
1699 | - if 'restart' in option or '#' in option: |
1700 | - option = 'restart' |
1701 | - found_options.append('--%s' %(option.strip())) |
1702 | - opt_file.close() |
1703 | - return found_options |
1704 | - |
1705 | - def process_cnf_file(self, cnf_file_path): |
1706 | - """ We extract meaningful information from a .cnf file |
1707 | - if it exists. Currently limited to server allocation |
1708 | - needs |
1709 | - |
1710 | - """ |
1711 | - |
1712 | - server_requirements = [] |
1713 | - cnf_flag = 0 |
1714 | - if os.path.exists(cnf_file_path): |
1715 | - cnf_flag = 1 |
1716 | - config_reader = RawConfigParser() |
1717 | - config_reader.read(cnf_file_path) |
1718 | - server_requirements = self.process_server_reqs(config_reader.get('test_servers','servers')) |
1719 | - return ( cnf_flag, server_requirements ) |
1720 | - |
1721 | - def process_server_reqs(self,data_string): |
1722 | - """ We read in the list of lists as a string, so we need to |
1723 | - handle this / break it down into proper chunks |
1724 | - |
1725 | - """ |
1726 | - server_reqs = [] |
1727 | - # We expect to see a list of lists and throw away the |
1728 | - # enclosing brackets |
1729 | - option_sets = data_string[1:-1].strip().split(',') |
1730 | - for option_set in option_sets: |
1731 | - server_reqs.append([option_set[1:-1].strip()]) |
1732 | - return server_reqs |
1733 | - |
1734 | - def testlist_filter(self, testlist): |
1735 | - """ Filter our list of testdir contents based on several |
1736 | - criteria. This looks for user-specified test-cases |
1737 | - and applies the do-test and skip-test filters |
1738 | - |
1739 | - Returns the list of tests that we want to execute |
1740 | - for further processing |
1741 | - |
1742 | - """ |
1743 | - |
1744 | - # We want only .test files |
1745 | - # Possible TODO: allow alternate test extensions |
1746 | - testlist = [test_file for test_file in testlist if test_file.endswith('.test')] |
1747 | - |
1748 | - # Search for specific test names |
1749 | - if self.desired_tests: # We have specific, named tests we want from the suite(s) |
1750 | - tests_to_use = [] |
1751 | - for test in self.desired_tests: |
1752 | - if test.endswith('.test'): |
1753 | - pass |
1754 | - else: |
1755 | - test = test+'.test' |
1756 | - if test in testlist: |
1757 | - tests_to_use.append(test) |
1758 | - testlist = tests_to_use |
1759 | - |
1760 | - # TODO: Allow for regex? |
1761 | - # Apply do-test filter |
1762 | - if self.dotest: |
1763 | - testlist = [test_file for test_file in testlist if test_file.startswith(self.dotest)] |
1764 | - # Apply skip-test filter |
1765 | - if self.skiptest: |
1766 | - testlist = [test_file for test_file in testlist if not test_file.startswith(self.skiptest)] |
1767 | - return testlist |
1768 | - |
1769 | - def find_result_path(self, result_dir, result_file_name): |
1770 | - """ This is copied from test-run.pl dtr_cases.pl |
1771 | - If we have an engine option passed in and the |
1772 | - path resultdir/engine/testname.result exists, that is |
1773 | - our .result file |
1774 | - |
1775 | - Need to check if we really need this - maybe PBXT? |
1776 | - |
1777 | - """ |
1778 | - result_path = os.path.join(result_dir,result_file_name) |
1779 | - if self.default_engine: |
1780 | - candidate_path = os.path.join(result_dir, self.default_engine, |
1781 | - result_file_name) |
1782 | - if os.path.exists(candidate_path): |
1783 | - result_path = candidate_path |
1784 | - return result_path |
1785 | - |
1786 | - def check_if_disabled(self, disabled_tests, test_name): |
1787 | - """ Scan the list of disabled tests if it exists to see |
1788 | - if the test is disabled. |
1789 | - |
1790 | - """ |
1791 | - |
1792 | - if disabled_tests: |
1793 | - if test_name in disabled_tests: |
1794 | - self.system_manager.logging.debug("%s says - I'm disabled" %(test_name)) |
1795 | - return (1, disabled_tests[test_name]) |
1796 | - return (0,None) |
1797 | - |
1798 | - def sort_testcases(self): |
1799 | - """ We sort our testcases according to the server_options they have |
1800 | - For each testcase, we sort the list of options, so if a test has |
1801 | - --plugin-add=csv --abracadabra, we would get |
1802 | - --abracadabra --plugin-add=csv |
1803 | - |
1804 | - This results in tests that have similar options being run in order |
1805 | - this minimizes server restarts which can be costly |
1806 | - |
1807 | - """ |
1808 | - test_management.testManager.sort_testcases(self) |
1809 | - organizer = {} |
1810 | - ordered_list = [] |
1811 | - for testcase in self.test_list: |
1812 | - key = " ".join(sorted(testcase.server_options)) |
1813 | - if key in organizer: |
1814 | - organizer[key].append(testcase) |
1815 | - else: |
1816 | - organizer[key] = [testcase] |
1817 | - for value_list in organizer.values(): |
1818 | - ordered_list = ordered_list + value_list |
1819 | - self.test_list = ordered_list |
1820 | - |
1821 | - |
1822 | - |
1823 | |
1824 | === removed directory 'tests/lib/dbqp_modes/native' |
1825 | === removed directory 'tests/lib/dbqp_modes/randgen' |
1826 | === removed file 'tests/lib/dbqp_modes/randgen/__init__.py' |
1827 | === removed file 'tests/lib/dbqp_modes/randgen/randgen_test_execution.py' |
1828 | --- tests/lib/dbqp_modes/randgen/randgen_test_execution.py 2011-06-28 21:07:43 +0000 |
1829 | +++ tests/lib/dbqp_modes/randgen/randgen_test_execution.py 1970-01-01 00:00:00 +0000 |
1830 | @@ -1,104 +0,0 @@ |
1831 | -#! /usr/bin/env python |
1832 | -# -*- mode: python; indent-tabs-mode: nil; -*- |
1833 | -# vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
1834 | -# |
1835 | -# Copyright (C) 2010 Patrick Crews |
1836 | -# |
1837 | -# |
1838 | -# This program is free software; you can redistribute it and/or modify |
1839 | -# it under the terms of the GNU General Public License as published by |
1840 | -# the Free Software Foundation; either version 2 of the License, or |
1841 | -# (at your option) any later version. |
1842 | -# |
1843 | -# This program is distributed in the hope that it will be useful, |
1844 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1845 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1846 | -# GNU General Public License for more details. |
1847 | -# |
1848 | -# You should have received a copy of the GNU General Public License |
1849 | -# along with this program; if not, write to the Free Software |
1850 | -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
1851 | - |
1852 | -""" dtr_test_execution: |
1853 | - code related to the execution of dtr test cases |
1854 | - |
1855 | - We are provided access to a testManager with |
1856 | - randgen-specific testCases. We contact the executionManager |
1857 | - to produce the system and server configurations we need |
1858 | - to execute a test. |
1859 | - |
1860 | -""" |
1861 | - |
1862 | -# imports |
1863 | -import os |
1864 | -import sys |
1865 | -import subprocess |
1866 | -import commands |
1867 | - |
1868 | -import lib.test_mgmt.test_execution as test_execution |
1869 | - |
1870 | -class testExecutor(test_execution.testExecutor): |
1871 | - """ randgen-specific testExecutor |
1872 | - |
1873 | - """ |
1874 | - |
1875 | - def execute_testCase (self): |
1876 | - """ Execute a randgen testCase |
1877 | - |
1878 | - """ |
1879 | - test_execution.testExecutor.execute_testCase(self) |
1880 | - self.status = 0 |
1881 | - |
1882 | - # execute the randgen |
1883 | - self.execute_randgen() |
1884 | - |
1885 | - # analyze results |
1886 | - self.current_test_status = self.process_randgen_output() |
1887 | - self.set_server_status(self.current_test_status) |
1888 | - self.server_manager.reset_servers(self.name) |
1889 | - |
1890 | - |
1891 | - |
1892 | - |
1893 | - def execute_randgen(self): |
1894 | - """ Execute the commandline and return the result. |
1895 | - We use subprocess as we can pass os.environ dicts and whatnot |
1896 | - |
1897 | - """ |
1898 | - |
1899 | - testcase_name = self.current_testcase.fullname |
1900 | - self.time_manager.start(testcase_name,'test') |
1901 | - randgen_outfile = os.path.join(self.logdir,'randgen.out') |
1902 | - randgen_output = open(randgen_outfile,'w') |
1903 | - dsn = "--dsn=dbi:drizzle:host=localhost:port=%d:user=root:password="":database=test" %(self.master_server.master_port) |
1904 | - randgen_cmd = " ".join([self.current_testcase.test_command, dsn]) |
1905 | - randgen_subproc = subprocess.Popen( randgen_cmd |
1906 | - , shell=True |
1907 | - , cwd=self.system_manager.randgen_path |
1908 | - , env=self.working_environment |
1909 | - , stdout = randgen_output |
1910 | - , stderr = subprocess.STDOUT |
1911 | - ) |
1912 | - randgen_subproc.wait() |
1913 | - retcode = randgen_subproc.returncode |
1914 | - execution_time = int(self.time_manager.stop(testcase_name)*1000) # millisec |
1915 | - |
1916 | - randgen_output.close() |
1917 | - randgen_file = open(randgen_outfile,'r') |
1918 | - output = ''.join(randgen_file.readlines()) |
1919 | - self.logging.debug(output) |
1920 | - randgen_file.close() |
1921 | - |
1922 | - self.logging.debug("randgen_retcode: %d" %(retcode)) |
1923 | - self.current_test_retcode = retcode |
1924 | - self.current_test_output = output |
1925 | - self.current_test_exec_time = execution_time |
1926 | - |
1927 | - def process_randgen_output(self): |
1928 | - """ randgen has run, we now check out what we have """ |
1929 | - retcode = self.current_test_retcode |
1930 | - if retcode == 0: |
1931 | - return 'pass' |
1932 | - else: |
1933 | - return 'fail' |
1934 | - |
1935 | |
1936 | === removed file 'tests/lib/dbqp_modes/randgen/randgen_test_management.py' |
1937 | --- tests/lib/dbqp_modes/randgen/randgen_test_management.py 2011-06-17 22:54:46 +0000 |
1938 | +++ tests/lib/dbqp_modes/randgen/randgen_test_management.py 1970-01-01 00:00:00 +0000 |
1939 | @@ -1,146 +0,0 @@ |
1940 | -#! /usr/bin/env python |
1941 | -# -*- mode: python; indent-tabs-mode: nil; -*- |
1942 | -# vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
1943 | -# |
1944 | -# Copyright (C) 2010 Patrick Crews |
1945 | -# |
1946 | -## This program is free software; you can redistribute it and/or modify |
1947 | -# it under the terms of the GNU General Public License as published by |
1948 | -# the Free Software Foundation; either version 2 of the License, or |
1949 | -# (at your option) any later version. |
1950 | -# |
1951 | -# This program is distributed in the hope that it will be useful, |
1952 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1953 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1954 | -# GNU General Public License for more details. |
1955 | -# |
1956 | -# You should have received a copy of the GNU General Public License |
1957 | -# along with this program; if not, write to the Free Software |
1958 | -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
1959 | - |
1960 | -""" randgen_test_management: |
1961 | - code related to the gathering / analysis / management of |
1962 | - the test cases |
1963 | - ie - collecting the list of tests in each suite, then |
1964 | - gathering additional, relevant information for randgen |
1965 | - mode. (stocastic model-based testing) |
1966 | - |
1967 | -""" |
1968 | - |
1969 | -# imports |
1970 | -import os |
1971 | -import re |
1972 | -import sys |
1973 | -from ConfigParser import RawConfigParser |
1974 | - |
1975 | -import lib.test_mgmt.test_management as test_management |
1976 | - |
1977 | - |
1978 | - |
1979 | -class testCase: |
1980 | - """Holds info on a single randgen test |
1981 | - |
1982 | - """ |
1983 | - def __init__( self, system_manager, name=None |
1984 | - , fullname = None, server_requirements=[[]] |
1985 | - , comment=None, test_command=None, cnf_path=None |
1986 | - , debug=False ): |
1987 | - self.system_manager = system_manager |
1988 | - self.logging = self.system_manager.logging |
1989 | - self.skip_keys = ['system_manager','logging'] |
1990 | - self.name = name |
1991 | - self.fullname = fullname |
1992 | - self.suitename = 'randgen_tests' |
1993 | - self.master_sh = None |
1994 | - self.comment = comment |
1995 | - self.server_requirements = server_requirements |
1996 | - self.test_command = test_command |
1997 | - self.cnf_path = cnf_path |
1998 | - |
1999 | - if debug: |
2000 | - self.system_manager.logging.debug_class(self) |
2001 | - |
2002 | - def should_run(self): |
2003 | - if self.skip_flag or self.disable: |
2004 | - return 0 |
2005 | - else: |
2006 | - return 1 |
2007 | - |
2008 | - |
2009 | - |
2010 | - |
2011 | - |
2012 | -class testManager(test_management.testManager): |
2013 | - """Deals with scanning test directories, gathering test cases, and |
2014 | - collecting per-test information (opt files, etc) for use by the |
2015 | - test-runner |
2016 | - |
2017 | - """ |
2018 | - |
2019 | - def __init__( self, variables, system_manager): |
2020 | - super(testManager, self).__init__( variables, system_manager) |
2021 | - self.suitepaths = [os.path.join(self.testdir,'randgen_tests')] |
2022 | - if variables['suitelist'] is None: |
2023 | - self.suitelist = ['main'] |
2024 | - else: |
2025 | - self.suitelist = variables['suitelist'] |
2026 | - |
2027 | - def process_suite(self,suite_dir): |
2028 | - """Process a test suite. |
2029 | - Look for randgen tests, which are nice clean conf files |
2030 | - |
2031 | - """ |
2032 | - |
2033 | - # We know this based on how we organize randgen test conf files |
2034 | - suite_name = os.path.basename(suite_dir) |
2035 | - self.system_manager.logging.verbose("Processing suite: %s" %(suite_name)) |
2036 | - testlist = [os.path.join(suite_dir,test_file) for test_file in sorted(os.listdir(suite_dir)) if test_file.endswith('.cnf')] |
2037 | - |
2038 | - # Search for specific test names |
2039 | - if self.desired_tests: # We have specific, named tests we want from the suite(s) |
2040 | - tests_to_use = [] |
2041 | - for test in self.desired_tests: |
2042 | - if test.endswith('.cnf'): |
2043 | - pass |
2044 | - else: |
2045 | - test = test+'.cnf' |
2046 | - test = os.path.join(suite_dir,test) |
2047 | - if test in testlist: |
2048 | - tests_to_use.append(test) |
2049 | - testlist = tests_to_use |
2050 | - for test_case in testlist: |
2051 | - self.add_test(self.process_test_file(suite_name, test_case)) |
2052 | - |
2053 | - |
2054 | - def process_test_file(self, suite_name, testfile): |
2055 | - """ We convert the info in a testfile into a testCase object """ |
2056 | - |
2057 | - config_reader = RawConfigParser() |
2058 | - config_reader.read(testfile) |
2059 | - # test_name = filename - .cnf...simpler |
2060 | - test_name = os.path.basename(testfile).replace('.cnf','') |
2061 | - test_comment = config_reader.get('test_info','comment') |
2062 | - server_requirements = self.process_server_reqs(config_reader.get('test_servers','servers')) |
2063 | - test_command = config_reader.get('test_command','command') |
2064 | - return testCase( self.system_manager |
2065 | - , name = test_name |
2066 | - , fullname = "%s.%s" %(suite_name, test_name) |
2067 | - , server_requirements = server_requirements |
2068 | - , test_command = test_command |
2069 | - , cnf_path = testfile |
2070 | - , debug = self.debug ) |
2071 | - |
2072 | - #sys.exit(0) |
2073 | - |
2074 | - def process_server_reqs(self,data_string): |
2075 | - """ We read in the list of lists as a string, so we need to |
2076 | - handle this / break it down into proper chunks |
2077 | - |
2078 | - """ |
2079 | - server_reqs = [] |
2080 | - # We expect to see a list of lists and throw away the |
2081 | - # enclosing brackets |
2082 | - option_sets = data_string[1:-1].strip().split(',') |
2083 | - for option_set in option_sets: |
2084 | - server_reqs.append([option_set[1:-1].strip()]) |
2085 | - return server_reqs |
2086 | |
2087 | === removed directory 'tests/lib/dbqp_modes/sqlbench' |
2088 | === removed file 'tests/lib/dbqp_modes/sqlbench/__init__.py' |
2089 | === removed file 'tests/lib/dbqp_modes/sqlbench/sqlbench_test_execution.py' |
2090 | --- tests/lib/dbqp_modes/sqlbench/sqlbench_test_execution.py 2011-06-28 21:07:43 +0000 |
2091 | +++ tests/lib/dbqp_modes/sqlbench/sqlbench_test_execution.py 1970-01-01 00:00:00 +0000 |
2092 | @@ -1,115 +0,0 @@ |
2093 | -#! /usr/bin/env python |
2094 | -# -*- mode: python; indent-tabs-mode: nil; -*- |
2095 | -# vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
2096 | -# |
2097 | -# Copyright (C) 2011 Patrick Crews |
2098 | -# |
2099 | -# |
2100 | -# This program is free software; you can redistribute it and/or modify |
2101 | -# it under the terms of the GNU General Public License as published by |
2102 | -# the Free Software Foundation; either version 2 of the License, or |
2103 | -# (at your option) any later version. |
2104 | -# |
2105 | -# This program is distributed in the hope that it will be useful, |
2106 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2107 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2108 | -# GNU General Public License for more details. |
2109 | -# |
2110 | -# You should have received a copy of the GNU General Public License |
2111 | -# along with this program; if not, write to the Free Software |
2112 | -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
2113 | - |
2114 | -""" sqlbench_test_execution: |
2115 | - code related to the execution of sqlbench test cases |
2116 | - |
2117 | - We are provided access to a testManager with |
2118 | - sqlbench-specific testCases. |
2119 | - |
2120 | -""" |
2121 | - |
2122 | -# imports |
2123 | -import os |
2124 | -import re |
2125 | -import sys |
2126 | -import subprocess |
2127 | -import commands |
2128 | - |
2129 | -import lib.test_mgmt.test_execution as test_execution |
2130 | - |
2131 | - |
2132 | - |
2133 | -class testExecutor(test_execution.testExecutor): |
2134 | - """ sqlbench-specific testExecutor |
2135 | - |
2136 | - """ |
2137 | - |
2138 | - def execute_testCase (self): |
2139 | - """ Execute a sqlbench testCase |
2140 | - |
2141 | - """ |
2142 | - test_execution.testExecutor.execute_testCase(self) |
2143 | - self.status = 0 |
2144 | - |
2145 | - # execute sqlbench |
2146 | - self.execute_sqlbench() |
2147 | - |
2148 | - # analyze results |
2149 | - self.current_test_status = self.process_sqlbench_output() |
2150 | - self.set_server_status(self.current_test_status) |
2151 | - self.server_manager.reset_servers(self.name) |
2152 | - |
2153 | - def execute_sqlbench(self): |
2154 | - """ Execute the commandline and return the result. |
2155 | - We use subprocess as we can pass os.environ dicts and whatnot |
2156 | - |
2157 | - """ |
2158 | - |
2159 | - testcase_name = self.current_testcase.fullname |
2160 | - self.time_manager.start(testcase_name,'test') |
2161 | - sqlbench_outfile = os.path.join(self.logdir,'sqlbench.out') |
2162 | - sqlbench_output = open(sqlbench_outfile,'w') |
2163 | - sqlbench_cmd = self.current_testcase.test_command |
2164 | - self.logging.info("Executing sqlbench: %s" %(sqlbench_cmd)) |
2165 | - |
2166 | - sqlbench_subproc = subprocess.Popen( sqlbench_cmd |
2167 | - , shell=True |
2168 | - , cwd=os.path.join(self.system_manager.testdir, 'sql-bench') |
2169 | - , env=self.working_environment |
2170 | - , stdout = sqlbench_output |
2171 | - , stderr = subprocess.STDOUT |
2172 | - ) |
2173 | - sqlbench_subproc.wait() |
2174 | - retcode = sqlbench_subproc.returncode |
2175 | - execution_time = int(self.time_manager.stop(testcase_name)*1000) # millisec |
2176 | - |
2177 | - sqlbench_output.close() |
2178 | - sqlbench_file = open(sqlbench_outfile,'r') |
2179 | - output = ''.join(sqlbench_file.readlines()) |
2180 | - self.logging.debug(output) |
2181 | - sqlbench_file.close() |
2182 | - |
2183 | - self.logging.debug("sqlbench_retcode: %d" %(retcode)) |
2184 | - self.current_test_retcode = retcode |
2185 | - self.current_test_output = output |
2186 | - self.current_test_exec_time = execution_time |
2187 | - |
2188 | - def process_sqlbench_output(self): |
2189 | - |
2190 | - # Check for 'Failed' in sql-bench output |
2191 | - # The tests don't die on a failed test and |
2192 | - # require some checking of the output file |
2193 | - infile_name = self.current_test_output.split('\n')[1].strip() |
2194 | - inf= open(infile_name, "r") |
2195 | - inlines= inf.readlines() |
2196 | - error_flag= False |
2197 | - for inline in inlines: |
2198 | - if 'Failed' in inline: |
2199 | - error_flag= True |
2200 | - logging.info(inline.strip()) |
2201 | - inf.close() |
2202 | - self.current_test_output += ''.join(inlines) |
2203 | - if self.current_test_retcode == 0 and not error_flag: |
2204 | - return 'pass' |
2205 | - else: |
2206 | - return 'fail' |
2207 | - |
2208 | |
2209 | === removed file 'tests/lib/dbqp_modes/sqlbench/sqlbench_test_management.py' |
2210 | --- tests/lib/dbqp_modes/sqlbench/sqlbench_test_management.py 2011-06-18 00:51:07 +0000 |
2211 | +++ tests/lib/dbqp_modes/sqlbench/sqlbench_test_management.py 1970-01-01 00:00:00 +0000 |
2212 | @@ -1,189 +0,0 @@ |
2213 | -#! /usr/bin/env python |
2214 | -# -*- mode: python; indent-tabs-mode: nil; -*- |
2215 | -# vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
2216 | -# |
2217 | -# Copyright (C) 2011 Patrick Crews |
2218 | -# |
2219 | -## This program is free software; you can redistribute it and/or modify |
2220 | -# it under the terms of the GNU General Public License as published by |
2221 | -# the Free Software Foundation; either version 2 of the License, or |
2222 | -# (at your option) any later version. |
2223 | -# |
2224 | -# This program is distributed in the hope that it will be useful, |
2225 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2226 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2227 | -# GNU General Public License for more details. |
2228 | -# |
2229 | -# You should have received a copy of the GNU General Public License |
2230 | -# along with this program; if not, write to the Free Software |
2231 | -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
2232 | - |
2233 | -""" sqlbench_test_management: |
2234 | - code related to the gathering / analysis / management of |
2235 | - the test cases |
2236 | - ie - collecting the list of tests in each suite, then |
2237 | - gathering additional, relevant information for sqlbench mode |
2238 | - |
2239 | -""" |
2240 | - |
2241 | -# imports |
2242 | -import os |
2243 | -import re |
2244 | -import sys |
2245 | -from ConfigParser import RawConfigParser |
2246 | - |
2247 | -import lib.test_mgmt.test_management as test_management |
2248 | - |
2249 | - |
2250 | - |
2251 | -class testCase: |
2252 | - """Holds info on a single sqlbench test |
2253 | - |
2254 | - """ |
2255 | - def __init__( self, system_manager, name=None |
2256 | - , fullname = None, server_requirements=[[]] |
2257 | - , comment=None, test_command=None, cnf_path=None |
2258 | - , suitename = 'sqlbench_tests' |
2259 | - , debug=False ): |
2260 | - self.system_manager = system_manager |
2261 | - self.logging = self.system_manager.logging |
2262 | - self.skip_keys = ['system_manager','logging'] |
2263 | - self.name = name |
2264 | - self.fullname = fullname |
2265 | - self.suitename = suitename |
2266 | - self.master_sh = None |
2267 | - self.comment = comment |
2268 | - self.server_requirements = server_requirements |
2269 | - self.test_command = test_command |
2270 | - self.cnf_path = cnf_path |
2271 | - |
2272 | - if debug: |
2273 | - self.system_manager.logging.debug_class(self) |
2274 | - |
2275 | - def should_run(self): |
2276 | - if self.skip_flag or self.disable: |
2277 | - return 0 |
2278 | - else: |
2279 | - return 1 |
2280 | - |
2281 | - |
2282 | - |
2283 | - |
2284 | - |
2285 | -class testManager(test_management.testManager): |
2286 | - """Deals with scanning test directories, gathering test cases, and |
2287 | - collecting per-test information (opt files, etc) for use by the |
2288 | - test-runner |
2289 | - |
2290 | - """ |
2291 | - |
2292 | - def __init__( self, variables, system_manager): |
2293 | - super(testManager, self).__init__( variables, system_manager) |
2294 | - self.suitepaths = [os.path.join(self.testdir,'sqlbench_tests')] |
2295 | - if variables['suitelist'] is None: |
2296 | - self.suitelist = ['main'] |
2297 | - else: |
2298 | - self.suitelist = variables['suitelist'] |
2299 | - |
2300 | - def process_suite(self,suite_dir): |
2301 | - """Process a test suite. |
2302 | - Look for sqlbench tests, which are nice clean conf files |
2303 | - |
2304 | - """ |
2305 | - |
2306 | - # We know this based on how we organize sqlbench test conf files |
2307 | - suite_name = os.path.basename(suite_dir) |
2308 | - self.system_manager.logging.verbose("Processing suite: %s" %(suite_name)) |
2309 | - testlist = [os.path.join(suite_dir,test_file) for test_file in sorted(os.listdir(suite_dir)) if test_file.endswith('.cnf')] |
2310 | - |
2311 | - # Search for specific test names |
2312 | - if self.desired_tests: # We have specific, named tests we want from the suite(s) |
2313 | - tests_to_use = [] |
2314 | - for test in self.desired_tests: |
2315 | - if test.endswith('.cnf'): |
2316 | - pass |
2317 | - else: |
2318 | - test = test+'.cnf' |
2319 | - test = os.path.join(suite_dir,test) |
2320 | - if test in testlist: |
2321 | - tests_to_use.append(test) |
2322 | - testlist = tests_to_use |
2323 | - for test_case in testlist: |
2324 | - self.add_test(self.process_test_file(suite_name, test_case)) |
2325 | - |
2326 | - |
2327 | - def process_test_file(self, suite_name, testfile): |
2328 | - """ We convert the info in a testfile into a testCase object """ |
2329 | - |
2330 | - config_reader = RawConfigParser() |
2331 | - config_reader.read(testfile) |
2332 | - # test_name = filename - .cnf...simpler |
2333 | - test_name = os.path.basename(testfile).replace('.cnf','') |
2334 | - test_comment = config_reader.get('test_info','comment') |
2335 | - server_requirements = self.process_server_reqs(config_reader.get('test_servers','servers')) |
2336 | - test_command = config_reader.get('test_command','command') |
2337 | - return testCase( self.system_manager |
2338 | - , name = test_name |
2339 | - , fullname = "%s.%s" %(suite_name, test_name) |
2340 | - , server_requirements = server_requirements |
2341 | - , test_command = test_command |
2342 | - , cnf_path = testfile |
2343 | - , debug = self.debug ) |
2344 | - |
2345 | - #sys.exit(0) |
2346 | - |
2347 | - def process_server_reqs(self,data_string): |
2348 | - """ We read in the list of lists as a string, so we need to |
2349 | - handle this / break it down into proper chunks |
2350 | - |
2351 | - """ |
2352 | - server_reqs = [] |
2353 | - # We expect to see a list of lists and throw away the |
2354 | - # enclosing brackets |
2355 | - option_sets = data_string[1:-1].strip().split(',') |
2356 | - for option_set in option_sets: |
2357 | - server_reqs.append([option_set[1:-1].strip()]) |
2358 | - return server_reqs |
2359 | - |
2360 | - def record_test_result(self, test_case, test_status, output, exec_time): |
2361 | - """ Accept the results of an executed testCase for further |
2362 | - processing. |
2363 | - |
2364 | - """ |
2365 | - if test_status not in self.executed_tests: |
2366 | - self.executed_tests[test_status] = [test_case] |
2367 | - else: |
2368 | - self.executed_tests[test_status].append(test_case) |
2369 | - # report |
2370 | - self.logging.test_report( test_case.fullname, test_status |
2371 | - , str(exec_time), output |
2372 | - , report_output= True) |
2373 | - |
2374 | -class crashmeTestManager(testManager): |
2375 | - """Deals with scanning test directories, gathering test cases, and |
2376 | - collecting per-test information (opt files, etc) for use by the |
2377 | - test-runner |
2378 | - |
2379 | - """ |
2380 | - |
2381 | - def __init__( self, variables, system_manager): |
2382 | - super(testManager, self).__init__( variables, system_manager) |
2383 | - self.suitepaths = [os.path.join(self.testdir,'crashme_tests')] |
2384 | - if variables['suitelist'] is None: |
2385 | - self.suitelist = ['main'] |
2386 | - else: |
2387 | - self.suitelist = variables['suitelist'] |
2388 | - |
2389 | - def record_test_result(self, test_case, test_status, output, exec_time): |
2390 | - """ Accept the results of an executed testCase for further |
2391 | - processing. |
2392 | - |
2393 | - """ |
2394 | - if test_status not in self.executed_tests: |
2395 | - self.executed_tests[test_status] = [test_case] |
2396 | - else: |
2397 | - self.executed_tests[test_status].append(test_case) |
2398 | - # report |
2399 | - self.logging.test_report( test_case.fullname, test_status |
2400 | - , str(exec_time), output |
2401 | - , report_output= True) |
2402 | |
2403 | === removed directory 'tests/lib/dbqp_modes/sysbench' |
2404 | === removed file 'tests/lib/dbqp_modes/sysbench/__init__.py' |
2405 | === removed file 'tests/lib/dbqp_modes/sysbench/sysbench_test_execution.py' |
2406 | --- tests/lib/dbqp_modes/sysbench/sysbench_test_execution.py 2011-06-28 21:07:43 +0000 |
2407 | +++ tests/lib/dbqp_modes/sysbench/sysbench_test_execution.py 1970-01-01 00:00:00 +0000 |
2408 | @@ -1,162 +0,0 @@ |
2409 | -#! /usr/bin/env python |
2410 | -# -*- mode: python; indent-tabs-mode: nil; -*- |
2411 | -# vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
2412 | -# |
2413 | -# Copyright (C) 2010 Patrick Crews |
2414 | -# |
2415 | -# |
2416 | -# This program is free software; you can redistribute it and/or modify |
2417 | -# it under the terms of the GNU General Public License as published by |
2418 | -# the Free Software Foundation; either version 2 of the License, or |
2419 | -# (at your option) any later version. |
2420 | -# |
2421 | -# This program is distributed in the hope that it will be useful, |
2422 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2423 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2424 | -# GNU General Public License for more details. |
2425 | -# |
2426 | -# You should have received a copy of the GNU General Public License |
2427 | -# along with this program; if not, write to the Free Software |
2428 | -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
2429 | - |
2430 | -""" sysbench_test_execution: |
2431 | - code related to the execution of sysbench test cases |
2432 | - |
2433 | - We are provided access to a testManager with |
2434 | - sysbench-specific testCases. |
2435 | - |
2436 | -""" |
2437 | - |
2438 | -# imports |
2439 | -import os |
2440 | -import re |
2441 | -import sys |
2442 | -import subprocess |
2443 | -import commands |
2444 | - |
2445 | -import lib.test_mgmt.test_execution as test_execution |
2446 | - |
2447 | -class testExecutor(test_execution.testExecutor): |
2448 | - """ sysbench-specific testExecutor |
2449 | - |
2450 | - """ |
2451 | - |
2452 | - def execute_testCase (self): |
2453 | - """ Execute a sysbench testCase |
2454 | - |
2455 | - """ |
2456 | - test_execution.testExecutor.execute_testCase(self) |
2457 | - self.status = 0 |
2458 | - |
2459 | - # prepare the server for sysbench |
2460 | - self.prepare_sysbench() |
2461 | - |
2462 | - # execute sysbench |
2463 | - self.execute_sysbench() |
2464 | - |
2465 | - # analyze results |
2466 | - self.current_test_status = self.process_sysbench_output() |
2467 | - self.set_server_status(self.current_test_status) |
2468 | - self.server_manager.reset_servers(self.name) |
2469 | - |
2470 | - def prepare_sysbench(self): |
2471 | - """ Prepare the server for a sysbench run |
2472 | - We use subprocess as we can pass os.environ dicts and whatnot |
2473 | - |
2474 | - """ |
2475 | - |
2476 | - sysbench_outfile = os.path.join(self.logdir,'sysbench.out') |
2477 | - sysbench_output = open(sysbench_outfile,'w') |
2478 | - sysbench_cmd = ' '.join([self.current_testcase.test_command,'prepare']) |
2479 | - self.logging.info("Preparing database for sysbench run...") |
2480 | - self.logging.debug(sysbench_cmd) |
2481 | - sysbench_subproc = subprocess.Popen( sysbench_cmd |
2482 | - , shell=True |
2483 | - #, cwd=os.getcwd() |
2484 | - , env=self.working_environment |
2485 | - , stdout = sysbench_output |
2486 | - , stderr = subprocess.STDOUT |
2487 | - ) |
2488 | - sysbench_subproc.wait() |
2489 | - retcode = sysbench_subproc.returncode |
2490 | - |
2491 | - sysbench_output.close() |
2492 | - sysbench_file = open(sysbench_outfile,'r') |
2493 | - output = ''.join(sysbench_file.readlines()) |
2494 | - sysbench_file.close() |
2495 | - self.logging.debug("sysbench_retcode: %d" %(retcode)) |
2496 | - self.logging.debug(output) |
2497 | - if retcode: |
2498 | - self.logging.error("sysbench_prepare failed with retcode %d:" %(retcode)) |
2499 | - self.logging.error(output) |
2500 | - sys.exit(1) |
2501 | - |
2502 | - |
2503 | - |
2504 | - |
2505 | - def execute_sysbench(self): |
2506 | - """ Execute the commandline and return the result. |
2507 | - We use subprocess as we can pass os.environ dicts and whatnot |
2508 | - |
2509 | - """ |
2510 | - |
2511 | - testcase_name = self.current_testcase.fullname |
2512 | - self.time_manager.start(testcase_name,'test') |
2513 | - sysbench_outfile = os.path.join(self.logdir,'sysbench.out') |
2514 | - sysbench_output = open(sysbench_outfile,'w') |
2515 | - sysbench_cmd = ' '.join([self.current_testcase.test_command, 'run']) |
2516 | - self.logging.info("Executing sysbench: %s" %(sysbench_cmd)) |
2517 | - |
2518 | - sysbench_subproc = subprocess.Popen( sysbench_cmd |
2519 | - , shell=True |
2520 | - #, cwd=self.system_manager.sysbench_path |
2521 | - , env=self.working_environment |
2522 | - , stdout = sysbench_output |
2523 | - , stderr = subprocess.STDOUT |
2524 | - ) |
2525 | - sysbench_subproc.wait() |
2526 | - retcode = sysbench_subproc.returncode |
2527 | - execution_time = int(self.time_manager.stop(testcase_name)*1000) # millisec |
2528 | - |
2529 | - sysbench_output.close() |
2530 | - sysbench_file = open(sysbench_outfile,'r') |
2531 | - output = ''.join(sysbench_file.readlines()) |
2532 | - self.logging.debug(output) |
2533 | - sysbench_file.close() |
2534 | - |
2535 | - self.logging.debug("sysbench_retcode: %d" %(retcode)) |
2536 | - self.current_test_retcode = retcode |
2537 | - self.current_test_output = output |
2538 | - self.current_test_exec_time = execution_time |
2539 | - |
2540 | - def process_sysbench_output(self): |
2541 | - """ sysbench has run, we now check out what we have |
2542 | - We also output the data from the run |
2543 | - |
2544 | - """ |
2545 | - # This slice code taken from drizzle-automation's sysbench handling |
2546 | - # Slice up the output report into a matrix and insert into the DB. |
2547 | - regexes= { |
2548 | - 'tps': re.compile(r".*transactions\:\s+\d+\D*(\d+\.\d+).*") |
2549 | - , 'deadlocksps': re.compile(r".*deadlocks\:\s+\d+\D*(\d+\.\d+).*") |
2550 | - , 'rwreqps': re.compile(r".*read\/write\s+requests\:\s+\d+\D*(\d+\.\d+).*") |
2551 | - , 'min_req_lat_ms': re.compile(r".*min\:\s+(\d*\.\d+)ms.*") |
2552 | - , 'max_req_lat_ms': re.compile(r".*max\:\s+(\d*\.\d+)ms.*") |
2553 | - , 'avg_req_lat_ms': re.compile(r".*avg\:\s+(\d*\.\d+)ms.*") |
2554 | - , '95p_req_lat_ms': re.compile(r".*approx.\s+95\s+percentile\:\s+(\d+\.\d+)ms.*") |
2555 | - } |
2556 | - run= {} |
2557 | - for line in self.current_test_output.split("\n"): |
2558 | - for key in regexes.keys(): |
2559 | - result= regexes[key].match(line) |
2560 | - if result: |
2561 | - run[key]= float(result.group(1)) # group(0) is entire match... |
2562 | - # we set our test output to the regex'd-up data |
2563 | - # we also make it a single string, separated by newlines |
2564 | - self.current_test_output = str(run)[1:-1].replace(',','\n').replace("'",'') |
2565 | - |
2566 | - if self.current_test_retcode == 0: |
2567 | - return 'pass' |
2568 | - else: |
2569 | - return 'fail' |
2570 | - |
2571 | |
2572 | === removed file 'tests/lib/dbqp_modes/sysbench/sysbench_test_management.py' |
2573 | --- tests/lib/dbqp_modes/sysbench/sysbench_test_management.py 2011-06-17 22:54:46 +0000 |
2574 | +++ tests/lib/dbqp_modes/sysbench/sysbench_test_management.py 1970-01-01 00:00:00 +0000 |
2575 | @@ -1,159 +0,0 @@ |
2576 | -#! /usr/bin/env python |
2577 | -# -*- mode: python; indent-tabs-mode: nil; -*- |
2578 | -# vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
2579 | -# |
2580 | -# Copyright (C) 2010 Patrick Crews |
2581 | -# |
2582 | -## This program is free software; you can redistribute it and/or modify |
2583 | -# it under the terms of the GNU General Public License as published by |
2584 | -# the Free Software Foundation; either version 2 of the License, or |
2585 | -# (at your option) any later version. |
2586 | -# |
2587 | -# This program is distributed in the hope that it will be useful, |
2588 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2589 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2590 | -# GNU General Public License for more details. |
2591 | -# |
2592 | -# You should have received a copy of the GNU General Public License |
2593 | -# along with this program; if not, write to the Free Software |
2594 | -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
2595 | - |
2596 | -""" sysbench_test_management: |
2597 | - code related to the gathering / analysis / management of |
2598 | - the test cases |
2599 | - ie - collecting the list of tests in each suite, then |
2600 | - gathering additional, relevant information for sysbench mode |
2601 | - |
2602 | -""" |
2603 | - |
2604 | -# imports |
2605 | -import os |
2606 | -import re |
2607 | -import sys |
2608 | -from ConfigParser import RawConfigParser |
2609 | - |
2610 | -import lib.test_mgmt.test_management as test_management |
2611 | - |
2612 | - |
2613 | - |
2614 | -class testCase: |
2615 | - """Holds info on a single sysbench test |
2616 | - |
2617 | - """ |
2618 | - def __init__( self, system_manager, name=None |
2619 | - , fullname = None, server_requirements=[[]] |
2620 | - , comment=None, test_command=None, cnf_path=None |
2621 | - , debug=False ): |
2622 | - self.system_manager = system_manager |
2623 | - self.logging = self.system_manager.logging |
2624 | - self.skip_keys = ['system_manager','logging'] |
2625 | - self.name = name |
2626 | - self.fullname = fullname |
2627 | - self.suitename = 'sysbench_tests' |
2628 | - self.master_sh = None |
2629 | - self.comment = comment |
2630 | - self.server_requirements = server_requirements |
2631 | - self.test_command = test_command |
2632 | - self.cnf_path = cnf_path |
2633 | - |
2634 | - if debug: |
2635 | - self.system_manager.logging.debug_class(self) |
2636 | - |
2637 | - def should_run(self): |
2638 | - if self.skip_flag or self.disable: |
2639 | - return 0 |
2640 | - else: |
2641 | - return 1 |
2642 | - |
2643 | - |
2644 | - |
2645 | - |
2646 | - |
2647 | -class testManager(test_management.testManager): |
2648 | - """Deals with scanning test directories, gathering test cases, and |
2649 | - collecting per-test information (opt files, etc) for use by the |
2650 | - test-runner |
2651 | - |
2652 | - """ |
2653 | - |
2654 | - def __init__( self, variables, system_manager): |
2655 | - super(testManager, self).__init__( variables, system_manager) |
2656 | - self.suitepaths = [os.path.join(self.testdir,'sysbench_tests')] |
2657 | - if variables['suitelist'] is None: |
2658 | - self.suitelist = ['readonly'] |
2659 | - else: |
2660 | - self.suitelist = variables['suitelist'] |
2661 | - |
2662 | - def process_suite(self,suite_dir): |
2663 | - """Process a test suite. |
2664 | - Look for sysbench tests, which are nice clean conf files |
2665 | - |
2666 | - """ |
2667 | - |
2668 | - # We know this based on how we organize sysbench test conf files |
2669 | - suite_name = os.path.basename(suite_dir) |
2670 | - self.system_manager.logging.verbose("Processing suite: %s" %(suite_name)) |
2671 | - testlist = [os.path.join(suite_dir,test_file) for test_file in sorted(os.listdir(suite_dir)) if test_file.endswith('.cnf')] |
2672 | - |
2673 | - # Search for specific test names |
2674 | - if self.desired_tests: # We have specific, named tests we want from the suite(s) |
2675 | - tests_to_use = [] |
2676 | - for test in self.desired_tests: |
2677 | - if test.endswith('.cnf'): |
2678 | - pass |
2679 | - else: |
2680 | - test = test+'.cnf' |
2681 | - test = os.path.join(suite_dir,test) |
2682 | - if test in testlist: |
2683 | - tests_to_use.append(test) |
2684 | - testlist = tests_to_use |
2685 | - for test_case in testlist: |
2686 | - self.add_test(self.process_test_file(suite_name, test_case)) |
2687 | - |
2688 | - |
2689 | - def process_test_file(self, suite_name, testfile): |
2690 | - """ We convert the info in a testfile into a testCase object """ |
2691 | - |
2692 | - config_reader = RawConfigParser() |
2693 | - config_reader.read(testfile) |
2694 | - # test_name = filename - .cnf...simpler |
2695 | - test_name = os.path.basename(testfile).replace('.cnf','') |
2696 | - test_comment = config_reader.get('test_info','comment') |
2697 | - server_requirements = self.process_server_reqs(config_reader.get('test_servers','servers')) |
2698 | - test_command = config_reader.get('test_command','command') |
2699 | - return testCase( self.system_manager |
2700 | - , name = test_name |
2701 | - , fullname = "%s.%s" %(suite_name, test_name) |
2702 | - , server_requirements = server_requirements |
2703 | - , test_command = test_command |
2704 | - , cnf_path = testfile |
2705 | - , debug = self.debug ) |
2706 | - |
2707 | - #sys.exit(0) |
2708 | - |
2709 | - def process_server_reqs(self,data_string): |
2710 | - """ We read in the list of lists as a string, so we need to |
2711 | - handle this / break it down into proper chunks |
2712 | - |
2713 | - """ |
2714 | - server_reqs = [] |
2715 | - # We expect to see a list of lists and throw away the |
2716 | - # enclosing brackets |
2717 | - option_sets = data_string[1:-1].strip().split(',') |
2718 | - for option_set in option_sets: |
2719 | - server_reqs.append([option_set[1:-1].strip()]) |
2720 | - return server_reqs |
2721 | - |
2722 | - def record_test_result(self, test_case, test_status, output, exec_time): |
2723 | - """ Accept the results of an executed testCase for further |
2724 | - processing. |
2725 | - |
2726 | - """ |
2727 | - if test_status not in self.executed_tests: |
2728 | - self.executed_tests[test_status] = [test_case] |
2729 | - else: |
2730 | - self.executed_tests[test_status].append(test_case) |
2731 | - # report |
2732 | - self.logging.test_report( test_case.fullname, test_status |
2733 | - , str(exec_time), output |
2734 | - , report_output= True) |
2735 | |
2736 | === removed file 'tests/lib/dbqp_modes/test_mode.py' |
2737 | --- tests/lib/dbqp_modes/test_mode.py 2011-06-28 21:07:43 +0000 |
2738 | +++ tests/lib/dbqp_modes/test_mode.py 1970-01-01 00:00:00 +0000 |
2739 | @@ -1,68 +0,0 @@ |
2740 | -#! /usr/bin/env python |
2741 | -# -*- mode: python; indent-tabs-mode: nil; -*- |
2742 | -# vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
2743 | -# |
2744 | -# Copyright (C) 2010 Patrick Crews |
2745 | -# |
2746 | -# This program is free software; you can redistribute it and/or modify |
2747 | -# it under the terms of the GNU General Public License as published by |
2748 | -# the Free Software Foundation; either version 2 of the License, or |
2749 | -# (at your option) any later version. |
2750 | -# |
2751 | -# This program is distributed in the hope that it will be useful, |
2752 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2753 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2754 | -# GNU General Public License for more details. |
2755 | -# |
2756 | -# You should have received a copy of the GNU General Public License |
2757 | -# along with this program; if not, write to the Free Software |
2758 | -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
2759 | - |
2760 | -"""test_mode.py |
2761 | - code for dealing with testing modes |
2762 | - A given mode should have a systemInitializer, testManager, and testExecutor |
2763 | - that define how to setup, manage, and execute test cases |
2764 | - |
2765 | -""" |
2766 | - |
2767 | -# imports |
2768 | -import sys |
2769 | - |
2770 | -def handle_mode(variables, system_manager): |
2771 | - """ Deals with the 'mode' option and returns |
2772 | - the appropriate code objects for the test-runner to play with |
2773 | - |
2774 | - """ |
2775 | - |
2776 | - test_mode = variables['mode'].strip() |
2777 | - system_manager.logging.info("Using testing mode: %s" %test_mode) |
2778 | - |
2779 | - if test_mode == 'cleanup': |
2780 | - # cleanup mode - we try to kill any servers whose pid's we detect |
2781 | - # in our workdir. Might extend to other things (file cleanup, etc) |
2782 | - # at some later point |
2783 | - system_manager.cleanup(exit=True) |
2784 | - |
2785 | - else: # we expect something from dbqp_modes |
2786 | - supported_modes = [ 'dtr' |
2787 | - , 'randgen' |
2788 | - , 'sysbench' |
2789 | - , 'sqlbench' |
2790 | - , 'crashme' |
2791 | - , 'native' |
2792 | - ] |
2793 | - if test_mode not in supported_modes: |
2794 | - system_manager.logging.error("invalid mode argument: %s" %test_mode) |
2795 | - sys.exit(1) |
2796 | - |
2797 | - mgmt_module = "lib.dbqp_modes.%s.%s_test_management" %(test_mode, test_mode) |
2798 | - tmp = __import__(mgmt_module, globals(), locals(), ['testManager'], -1) |
2799 | - testManager = tmp.testManager |
2800 | - |
2801 | - exec_module = "%s.%s_test_execution" %(test_mode, test_mode) |
2802 | - tmp = __import__(exec_module, globals(), locals(), ['testExecutor'], -1) |
2803 | - testExecutor = tmp.testExecutor |
2804 | - |
2805 | - test_manager = testManager( variables, system_manager ) |
2806 | - return (test_manager, testExecutor) |
2807 | - |
2808 | |
2809 | === removed directory 'tests/lib/dbqp_opts' |
2810 | === removed file 'tests/lib/dbqp_opts/__init__.py' |
2811 | === removed file 'tests/lib/dbqp_opts/test_run_options.py' |
2812 | --- tests/lib/dbqp_opts/test_run_options.py 2011-08-15 16:18:59 +0000 |
2813 | +++ tests/lib/dbqp_opts/test_run_options.py 1970-01-01 00:00:00 +0000 |
2814 | @@ -1,507 +0,0 @@ |
2815 | -#! /usr/bin/env python |
2816 | -# -*- mode: python; indent-tabs-mode: nil; -*- |
2817 | -# vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
2818 | -# |
2819 | -# Copyright (C) 2010, 2011 Patrick Crews |
2820 | -# |
2821 | -# This program is free software; you can redistribute it and/or modify |
2822 | -# it under the terms of the GNU General Public License as published by |
2823 | -# the Free Software Foundation; either version 2 of the License, or |
2824 | -# (at your option) any later version. |
2825 | -# |
2826 | -# This program is distributed in the hope that it will be useful, |
2827 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2828 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2829 | -# GNU General Public License for more details. |
2830 | -# |
2831 | -# You should have received a copy of the GNU General Public License |
2832 | -# along with this program; if not, write to the Free Software |
2833 | -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
2834 | - |
2835 | - |
2836 | - |
2837 | -"""Processes command line options for Drizzle test-runner""" |
2838 | - |
2839 | -import os |
2840 | -import sys |
2841 | -import copy |
2842 | -import exceptions |
2843 | -import optparse |
2844 | - |
2845 | -# functions |
2846 | -def comma_list_split(option, opt, value, parser): |
2847 | - """Callback for splitting input expected in list form""" |
2848 | - cur_list = getattr(parser.values, option.dest,[]) |
2849 | - input_list = value.split(',') |
2850 | - # this is a hack to work with make target - we |
2851 | - # don't deal with a dangling ',' in our list |
2852 | - if '' in input_list: |
2853 | - input_list.remove('') |
2854 | - if cur_list: |
2855 | - value_list = cur_list + input_list |
2856 | - else: |
2857 | - value_list = input_list |
2858 | - setattr(parser.values, option.dest, value_list) |
2859 | - |
2860 | -def get_abspath(option, opt, value, parser): |
2861 | - """ Utility function to make sure we have absolute paths |
2862 | - if the user supplies values |
2863 | - |
2864 | - """ |
2865 | - the_path = os.path.abspath(value) |
2866 | - setattr(parser.values, option.dest, the_path) |
2867 | - |
2868 | -def organize_options(args, test_cases): |
2869 | - """Put our arguments in a nice dictionary |
2870 | - We use option.dest as dictionary key |
2871 | - item = supplied input |
2872 | - [' |
2873 | - """ |
2874 | - variables = {} |
2875 | - # we make a copy as the python manual on vars |
2876 | - # says we shouldn't alter the dictionary returned |
2877 | - # by vars() - could affect symbol table? |
2878 | - variables = copy.copy(vars(args)) |
2879 | - variables['test_cases']= test_cases |
2880 | - # This code should become a function once |
2881 | - # enough thought has been given to it |
2882 | - if variables['manualgdb']: |
2883 | - variables['gdb']=True |
2884 | - if variables['repeat'] <= 0: |
2885 | - print "Setting --repeat=1. You chose a silly value that I will ignore :P" |
2886 | - variables['repeat'] = 1 |
2887 | - if variables['mode'] == 'randgen' or variables['gendatafile']: |
2888 | - print "Setting --no-secure-file-priv=True for randgen usage..." |
2889 | - variables['nosecurefilepriv']=True |
2890 | - if variables['mode'] == 'cleanup': |
2891 | - print "Setting --start-dirty=True for cleanup mode..." |
2892 | - variables['startdirty']=True |
2893 | - if variables['libeatmydata'] and os.path.exists(variables['libeatmydatapath']): |
2894 | - # We are using libeatmydata vs. shared mem for server speedup |
2895 | - print "Using libeatmydata at %s. Setting --no-shm / not using shared memory for testing..." %(variables['libeatmydatapath']) |
2896 | - variables['noshm']=True |
2897 | - return variables |
2898 | - |
2899 | -def populate_defaults(variables, basedir_default): |
2900 | - """ We fill in any default values that need |
2901 | - to be put in post-parsing |
2902 | - |
2903 | - """ |
2904 | - if not variables['basedir']: |
2905 | - # We populate this value with the default now |
2906 | - # it allows us to have a default and have user |
2907 | - # supplied opts to override them |
2908 | - variables['basedir'].append(basedir_default) |
2909 | - return variables |
2910 | - |
2911 | -def handle_user_opts(variables, basedir_default, testdir_default, suitepaths_default): |
2912 | - """ Some variables are dependent upon default values |
2913 | - We do the probably hacky thing of going through |
2914 | - and updating them accordingly |
2915 | - |
2916 | - We make the assumption / decision that only |
2917 | - the first basedir value supplied should |
2918 | - be applicable when searching for tests |
2919 | - |
2920 | - """ |
2921 | - master_basedir = os.path.abspath(variables['basedir'][0]) |
2922 | - if master_basedir != basedir_default: |
2923 | - new_path = os.path.join(master_basedir, 'plugin') |
2924 | - search_path = os.path.join(basedir_default,'plugin') |
2925 | - tmp = variables['suitepaths'] |
2926 | - tmp[tmp.index(search_path)] = new_path |
2927 | - variables['suitepaths'] = tmp |
2928 | - if variables['testdir'] != testdir_default: |
2929 | - new_path = os.path.join(variables['testdir'],'suite') |
2930 | - search_path = os.path.join(testdir_default,'suite') |
2931 | - tmp = variables['suitepaths'] |
2932 | - tmp[tmp.index(search_path)] = new_path |
2933 | - variables['suitepaths'] = tmp |
2934 | - return variables |
2935 | - |
2936 | - |
2937 | -# Create the CLI option parser |
2938 | -parser= optparse.OptionParser(version='%prog (database quality platform aka project steve austin) version 0.1.1') |
2939 | - |
2940 | -# set some default values |
2941 | -testdir_default = os.path.abspath(os.getcwd()) |
2942 | -workdir_default = os.path.join(testdir_default,'workdir') |
2943 | -clientbindir_default = os.path.abspath(os.path.join(testdir_default,'../client')) |
2944 | -basedir_default = os.path.split(testdir_default)[0] |
2945 | -server_type_default = 'drizzle' |
2946 | -valgrind_suppression_default = os.path.join(testdir_default,'valgrind.supp') |
2947 | -suitepaths_default = [ os.path.join(basedir_default,'plugin') |
2948 | - , os.path.join(testdir_default,'suite') |
2949 | - ] |
2950 | -randgen_path_default = os.path.join(testdir_default,'randgen') |
2951 | - |
2952 | - |
2953 | -config_control_group = optparse.OptionGroup(parser, |
2954 | - "Configuration controls - allows you to specify a file with a number of options already specified") |
2955 | -config_control_group.add_option( |
2956 | - "--sys_config_file" |
2957 | - , dest="sysconfigfilepath" |
2958 | - , action='store' |
2959 | - , default=None # We want to have a file that will be our default defaults file... |
2960 | - , help="The file that specifies system configuration specs for dbqp to execute tests (not yet implemented)" |
2961 | - ) |
2962 | -parser.add_option_group(config_control_group) |
2963 | - |
2964 | - |
2965 | -system_control_group = optparse.OptionGroup(parser, |
2966 | - "Options for the test-runner itself - defining the system under test and how to execute tests") |
2967 | - |
2968 | -system_control_group.add_option( |
2969 | - "--force" |
2970 | - , dest="force" |
2971 | - , action="store_true" |
2972 | - , default=False |
2973 | - , help="Set this to continue test execution beyond the first failed test" |
2974 | - ) |
2975 | - |
2976 | -system_control_group.add_option( |
2977 | - "--start-and-exit" |
2978 | - , dest="startandexit" |
2979 | - , action="store_true" |
2980 | - , default=False |
2981 | - , help="Spin up the server(s) for the first specified test then exit (will leave servers running)" |
2982 | - ) |
2983 | - |
2984 | -system_control_group.add_option( |
2985 | - "--verbose" |
2986 | - , dest="verbose" |
2987 | - , action="store_true" |
2988 | - , default = False |
2989 | - , help="Produces extensive output about test-runner state. Distinct from --debug" |
2990 | - ) |
2991 | - |
2992 | -system_control_group.add_option( |
2993 | - "--debug" |
2994 | - , dest="debug" |
2995 | - , action="store_true" |
2996 | - , default = False |
2997 | - , help="Provide internal-level debugging output. Distinct from --verbose" |
2998 | - ) |
2999 | - |
3000 | -system_control_group.add_option( |
3001 | - "--mode" |
3002 | - , dest="mode" |
3003 | - , default="dtr" |
3004 | - , help="Testing mode. We currently support dtr, randgen, sysbench, sqlbench, crashme and cleanup modes. See docs for further details about individual modes [%default]" |
3005 | - ) |
3006 | - |
3007 | -system_control_group.add_option( |
3008 | - "--record" |
3009 | - , dest="record" |
3010 | - , action="store_true" |
3011 | - , default=False |
3012 | - , help="Record a testcase result (if the testing mode supports it) [%default]" |
3013 | - ) |
3014 | - |
3015 | -system_control_group.add_option( |
3016 | - "--fast" |
3017 | - , dest="fast" |
3018 | - , action="store_true" |
3019 | - , default=False |
3020 | - , help="Don't try to cleanup from earlier runs (currently just a placeholder) [%default]" |
3021 | - ) |
3022 | - |
3023 | -parser.add_option_group(system_control_group) |
3024 | - |
3025 | -test_control_group = optparse.OptionGroup(parser, |
3026 | - "Options for controlling which tests are executed") |
3027 | - |
3028 | -test_control_group.add_option( |
3029 | - "--suite" |
3030 | - , dest="suitelist" |
3031 | - , type='string' |
3032 | - , action="callback" |
3033 | - , callback=comma_list_split |
3034 | - , help="The name of the suite containing tests we want. Can accept comma-separated list (with no spaces). Additional --suite args are appended to existing list [autosearch]" |
3035 | - ) |
3036 | - |
3037 | -test_control_group.add_option( |
3038 | - "--suitepath" |
3039 | - , dest="suitepaths" |
3040 | - , type='string' |
3041 | - , action="append" |
3042 | - , default = suitepaths_default |
3043 | - , help="The path containing the suite(s) you wish to execute. Use one --suitepath for each suite you want to use. [%default]" |
3044 | - ) |
3045 | - |
3046 | -test_control_group.add_option( |
3047 | - "--do-test" |
3048 | - , dest="dotest" |
3049 | - , type='string' |
3050 | - , default = None |
3051 | - , help="input can either be a prefix or a regex. Will only execute tests that match the provided pattern" |
3052 | - ) |
3053 | - |
3054 | -test_control_group.add_option( |
3055 | - "--skip-test" |
3056 | - , dest="skiptest" |
3057 | - , type='string' |
3058 | - , default = None |
3059 | - , help = "input can either be a prefix or a regex. Will exclude tests that match the provided pattern" |
3060 | - ) |
3061 | - |
3062 | -test_control_group.add_option( |
3063 | - "--reorder" |
3064 | - , dest="reorder" |
3065 | - , action="store_true" |
3066 | - , default=False |
3067 | - , help = "sort the testcases so that they are executed optimally for the given mode [%default]" |
3068 | - ) |
3069 | - |
3070 | -test_control_group.add_option( |
3071 | - "--repeat" |
3072 | - , dest="repeat" |
3073 | - , type='int' |
3074 | - , action="store" |
3075 | - , default=1 |
3076 | - , help = "Run each test case the specified number of times. For a given sequence, the first test will be run n times, then the second, etc [%default]" |
3077 | - ) |
3078 | - |
3079 | -parser.add_option_group(test_control_group) |
3080 | - |
3081 | -# test subject control group |
3082 | -# terrible name for options tht define the server / code |
3083 | -# that is under test |
3084 | - |
3085 | -# find some default values |
3086 | -# assume we are in-tree testing in general and operating from root/test(?) |
3087 | -testdir_default = os.path.abspath(os.getcwd()) |
3088 | - |
3089 | -basedir_default = os.path.split(testdir_default)[0] |
3090 | - |
3091 | -test_subject_control_group = optparse.OptionGroup(parser, |
3092 | - "Options for defining the code that will be under test") |
3093 | - |
3094 | -test_subject_control_group.add_option( |
3095 | - "--basedir" |
3096 | - , dest="basedir" |
3097 | - , type='string' |
3098 | - , default = [] |
3099 | - , action="append" |
3100 | - , help = "Pass this argument to signal to the test-runner that this is an in-tree test. We automatically set a number of variables relative to the argument (client-bindir, serverdir, testdir) [%basedir_default]" |
3101 | - ) |
3102 | - |
3103 | -test_subject_control_group.add_option( |
3104 | - "--default_server_type" |
3105 | - , dest="defaultservertype" |
3106 | - , type='string' |
3107 | - , default = server_type_default |
3108 | - , action='store' |
3109 | - , help = "Defines what we consider to be the default server type. We assume a server is default type unless specified otherwise. [%default]" |
3110 | - ) |
3111 | - |
3112 | -test_subject_control_group.add_option( |
3113 | - "--serverdir" |
3114 | - , dest="serverpath" |
3115 | - , type='string' |
3116 | - , action="callback" |
3117 | - , callback=get_abspath |
3118 | - , help = "Path to the server executable. [%default]" |
3119 | - ) |
3120 | - |
3121 | -test_subject_control_group.add_option( |
3122 | - "--client-bindir" |
3123 | - , dest="clientbindir" |
3124 | - , type = 'string' |
3125 | - , action="callback" |
3126 | - , callback=get_abspath |
3127 | - , help = "Path to the directory containing client program binaries for use in testing [%default]" |
3128 | - ) |
3129 | - |
3130 | - |
3131 | -test_subject_control_group.add_option( |
3132 | - "--default-storage-engine" |
3133 | - , dest="defaultengine" |
3134 | - , default = 'innodb' |
3135 | - , help="Start drizzled using the specified engine [%default]" |
3136 | - ) |
3137 | - |
3138 | - |
3139 | -parser.add_option_group(test_subject_control_group) |
3140 | -# end test subject control group |
3141 | - |
3142 | -# environment options |
3143 | - |
3144 | -environment_control_group = optparse.OptionGroup(parser, |
3145 | - "Options for defining the testing environment") |
3146 | - |
3147 | -environment_control_group.add_option( |
3148 | - "--testdir" |
3149 | - , dest="testdir" |
3150 | - , type = 'string' |
3151 | - , default = testdir_default |
3152 | - , action="callback" |
3153 | - , callback=get_abspath |
3154 | - , help = "Path to the test dir, containing additional files for test execution. [%default]" |
3155 | - ) |
3156 | - |
3157 | -environment_control_group.add_option( |
3158 | - "--workdir" |
3159 | - , dest="workdir" |
3160 | - , type='string' |
3161 | - , default = workdir_default |
3162 | - , action="callback" |
3163 | - , callback=get_abspath |
3164 | - , help = "Path to the directory test-run will use to store generated files and directories. [%default]" |
3165 | - ) |
3166 | - |
3167 | -environment_control_group.add_option( |
3168 | - "--top-srcdir" |
3169 | - , dest="topsrcdir" |
3170 | - , type='string' |
3171 | - , default = basedir_default |
3172 | - , help = "build option [%default]" |
3173 | - ) |
3174 | - |
3175 | -environment_control_group.add_option( |
3176 | - "--top-builddir" |
3177 | - , dest="topbuilddir" |
3178 | - , type='string' |
3179 | - , default = basedir_default |
3180 | - , help = "build option [%default]" |
3181 | - ) |
3182 | - |
3183 | -environment_control_group.add_option( |
3184 | - "--no-shm" |
3185 | - , dest="noshm" |
3186 | - , action='store_true' |
3187 | - , default=False |
3188 | - , help = "By default, we symlink workdir to a location in shm. Use this flag to not symlink [%default]" |
3189 | - ) |
3190 | - |
3191 | -environment_control_group.add_option( |
3192 | - "--libeatmydata" |
3193 | - , dest="libeatmydata" |
3194 | - , action='store_true' |
3195 | - , default=False |
3196 | - , help = "We use libeatmydata (if available) to disable fsyncs and speed up test execution. Implies --no-shm" |
3197 | - ) |
3198 | - |
3199 | -environment_control_group.add_option( |
3200 | - "--libeatmydata-path" |
3201 | - , dest="libeatmydatapath" |
3202 | - , action='store' |
3203 | - , default='/usr/local/lib/libeatmydata.so' |
3204 | - , help = "Path to the libeatmydata install you want to use [%default]" |
3205 | - ) |
3206 | - |
3207 | -environment_control_group.add_option( |
3208 | - "--start-dirty" |
3209 | - , dest="startdirty" |
3210 | - , action='store_true' |
3211 | - , default=False |
3212 | - , help = "Don't try to clean up working directories before test execution [%default]" |
3213 | - ) |
3214 | - |
3215 | -environment_control_group.add_option( |
3216 | - "--no-secure-file-priv" |
3217 | - , dest = "nosecurefilepriv" |
3218 | - , action='store_true' |
3219 | - , default=False |
3220 | - , help = "Turn off the use of --secure-file-priv=vardir for started servers" |
3221 | - ) |
3222 | - |
3223 | -environment_control_group.add_option( |
3224 | - "--randgen-path" |
3225 | - , dest="randgenpath" |
3226 | - , action='store' |
3227 | - , default=randgen_path_default |
3228 | - , help = "The path to a randgen installation that can be used to execute randgen-based tests" |
3229 | - ) |
3230 | - |
3231 | -parser.add_option_group(environment_control_group) |
3232 | -# end environment control group |
3233 | - |
3234 | -option_passing_group = optparse.OptionGroup(parser, |
3235 | - "Options to pass options on to the server") |
3236 | - |
3237 | -option_passing_group.add_option( |
3238 | -"--drizzled" |
3239 | - , dest="drizzledoptions" |
3240 | - , type='string' |
3241 | - , action='append' |
3242 | - , default = [] |
3243 | - , help = "Pass additional options to the server. Will be passed to all servers for all tests (mostly for --start-and-exit)" |
3244 | - ) |
3245 | - |
3246 | -parser.add_option_group(option_passing_group) |
3247 | -# end option passing group |
3248 | - |
3249 | -analysis_control_group = optparse.OptionGroup(parser, |
3250 | - "Options for defining the tools we use for code analysis (valgrind, gprof, gcov, etc)") |
3251 | - |
3252 | -analysis_control_group.add_option( |
3253 | - "--valgrind" |
3254 | - , dest="valgrind" |
3255 | - , action='store_true' |
3256 | - , default = False |
3257 | - , help = "Run drizzletest and drizzled executables using valgrind with default options [%default]" |
3258 | - ) |
3259 | - |
3260 | -analysis_control_group.add_option( |
3261 | - "--valgrind-option" |
3262 | - , dest="valgrindarglist" |
3263 | - , type='string' |
3264 | - , action="append" |
3265 | - , help = "Pass an option to valgrind (overrides/removes default valgrind options)" |
3266 | - ) |
3267 | - |
3268 | -analysis_control_group.add_option( |
3269 | - "--valgrind-suppressions" |
3270 | - , dest="valgrindsuppressions" |
3271 | - , type='string' |
3272 | - , action='store' |
3273 | - , default = valgrind_suppression_default |
3274 | - , help = "Point at a valgrind suppression file [%default]" |
3275 | - ) |
3276 | - |
3277 | -parser.add_option_group(analysis_control_group) |
3278 | - |
3279 | -debugger_control_group = optparse.OptionGroup(parser, |
3280 | - "Options for controlling the use of debuggers with test execution") |
3281 | - |
3282 | -debugger_control_group.add_option( |
3283 | - "--gdb" |
3284 | - , dest="gdb" |
3285 | - , action='store_true' |
3286 | - , default=False |
3287 | - , help="Start the drizzled server(s) in gdb" |
3288 | - ) |
3289 | - |
3290 | -debugger_control_group.add_option( |
3291 | - "--manual-gdb" |
3292 | - , dest="manualgdb" |
3293 | - , action='store_true' |
3294 | - , default=False |
3295 | - , help="Allows you to start the drizzled server(s) in gdb manually (in another window, etc)" |
3296 | - ) |
3297 | - |
3298 | -parser.add_option_group(debugger_control_group) |
3299 | - |
3300 | -utility_group = optparse.OptionGroup(parser, |
3301 | - "Options to call additional utilities such as datagen") |
3302 | - |
3303 | -utility_group.add_option( |
3304 | - "--gendata" |
3305 | - , dest="gendatafile" |
3306 | - , action='store' |
3307 | - , type='string' |
3308 | - , default=None |
3309 | - , help="Call the randgen's gendata utility to use the specified configuration file. This will populate the server prior to any test execution") |
3310 | - |
3311 | -parser.add_option_group(utility_group) |
3312 | - |
3313 | -# supplied will be those arguments matching an option, |
3314 | -# and test_cases will be everything else |
3315 | -(args, test_cases)= parser.parse_args() |
3316 | - |
3317 | -variables = {} |
3318 | -variables = organize_options(args, test_cases) |
3319 | -variables = populate_defaults(variables, basedir_default) |
3320 | -variables = handle_user_opts(variables, basedir_default, testdir_default, suitepaths_default) |
3321 | - |
3322 | |
3323 | === renamed directory 'tests/kewpie/lib/modes' => 'tests/lib/modes' |
3324 | === modified file 'tests/lib/modes/native/native_test_management.py' |
3325 | --- tests/kewpie/lib/modes/native/native_test_management.py 2011-12-14 00:22:48 +0000 |
3326 | +++ tests/lib/modes/native/native_test_management.py 2012-05-31 12:35:24 +0000 |
3327 | @@ -72,10 +72,6 @@ |
3328 | else: |
3329 | return 1 |
3330 | |
3331 | - |
3332 | - |
3333 | - |
3334 | - |
3335 | class testManager(test_management.testManager): |
3336 | """Deals with scanning test directories, gathering test cases, and |
3337 | collecting per-test information (opt files, etc) for use by the |
3338 | @@ -88,7 +84,7 @@ |
3339 | server_type = variables['defaultservertype'] |
3340 | if server_type == 'mysql' or server_type =='galera': |
3341 | server_type = 'percona' |
3342 | - self.suitepaths = [os.path.join(self.testdir,'%s_tests' %(server_type))] |
3343 | + self.suitepaths = [os.path.join(self.testdir,'qp_tests')] |
3344 | if variables['suitelist'] is None: |
3345 | self.suitelist = ['main'] |
3346 | else: |
3347 | |
3348 | === renamed directory 'tests/kewpie/lib/opts' => 'tests/lib/opts' |
3349 | === modified file 'tests/lib/opts/defaults.py' |
3350 | --- tests/kewpie/lib/opts/defaults.py 2012-03-27 00:53:10 +0000 |
3351 | +++ tests/lib/opts/defaults.py 2012-05-31 12:35:24 +0000 |
3352 | @@ -33,7 +33,7 @@ |
3353 | """ |
3354 | |
3355 | # Standard default values |
3356 | - branch_root = os.path.dirname(os.path.dirname(qp_rootdir)) |
3357 | + branch_root = (os.path.dirname(qp_rootdir)) |
3358 | defaults = { 'qp_root':qp_rootdir |
3359 | , 'testdir': qp_rootdir |
3360 | , 'workdir': os.path.join(qp_rootdir,'workdir') |
3361 | @@ -45,10 +45,68 @@ |
3362 | , 'suitepaths': [ os.path.join(branch_root,'plugin') |
3363 | , os.path.join(branch_root,'tests/suite') |
3364 | , os.path.join(branch_root,'tests') |
3365 | - , os.path.join(qp_rootdir,'drizzle_tests') |
3366 | + , os.path.join(qp_rootdir,'qp_tests') |
3367 | ] |
3368 | , 'suitelist' : ['randgen_main'] |
3369 | - , 'randgen_path': os.path.join(qp_rootdir,'randgen') |
3370 | + , 'dtrsuitelist': ['main' |
3371 | + ,'bool_type' |
3372 | + ,'cast' |
3373 | + ,'ddl_transactions' |
3374 | + ,'execute' |
3375 | + ,'flush_tables' |
3376 | + ,'identifiers' |
3377 | + ,'jp' |
3378 | + ,'mysql_compatibility' |
3379 | + ,'regression' |
3380 | + ,'tamil' |
3381 | + ,'time_type' |
3382 | + ,'unsigned_integer_type' |
3383 | + ,'uuid_type' |
3384 | + ,'microtime_type' |
3385 | + ,'utility_functions' |
3386 | + ,'utility_dictionary' |
3387 | + ,'user_locks' |
3388 | + ,'trigger_dictionary' |
3389 | + ,'tableprototester' |
3390 | + ,'table_cache_dictionary' |
3391 | + ,'string_functions' |
3392 | + ,'storage_engine_api_tester' |
3393 | + ,'status_dictionary' |
3394 | + ,'sleep' |
3395 | + ,'slave' |
3396 | + ,'simple_user_policy' |
3397 | + ,'show_schema_proto' |
3398 | + ,'show_dictionary' |
3399 | + ,'session_dictionary' |
3400 | + ,'schema_engine' |
3401 | + ,'schema_dictionary' |
3402 | + ,'registry_dictionary' |
3403 | + ,'regex_policy' |
3404 | + ,'rand_function' |
3405 | + ,'query_log' |
3406 | + ,'performance_dictionary' |
3407 | + ,'mysql_protocol' |
3408 | + ,'myisam' |
3409 | + ,'memory' |
3410 | + ,'md5' |
3411 | + ,'logging_stats' |
3412 | + ,'json_server' |
3413 | + ,'innobase' |
3414 | + ,'information_schema_dictionary' |
3415 | + ,'hello_world' |
3416 | + ,'hello_events' |
3417 | + ,'function_dictionary' |
3418 | + ,'error_dictionary' |
3419 | + ,'errmsg_stderr' |
3420 | + ,'debug' |
3421 | + ,'crc32' |
3422 | + ,'collation_dictionary' |
3423 | + ,'catalog' |
3424 | + ,'auth_test' |
3425 | + ,'auth_schema' |
3426 | + ,'auth_file' |
3427 | + ] |
3428 | + , 'randgen_path': os.path.join(qp_rootdir,'test_tools/randgen') |
3429 | , 'subunit_file': os.path.join(qp_rootdir,'workdir/test_results.subunit') |
3430 | , 'xtrabackuppath': os.path.join(branch_root,'plugin/innobase/xtrabackup/drizzlebackup.innobase') |
3431 | , 'innobackupexpath': os.path.join(branch_root,'plugin/innobase/xtrabackup/innobackupex') |
3432 | |
3433 | === modified file 'tests/lib/opts/test_run_options.py' |
3434 | --- tests/kewpie/lib/opts/test_run_options.py 2012-02-20 19:36:39 +0000 |
3435 | +++ tests/lib/opts/test_run_options.py 2012-05-31 12:35:24 +0000 |
3436 | @@ -113,14 +113,14 @@ |
3437 | tmp = variables['suitepaths'] |
3438 | tmp[tmp.index(search_path)] = new_path |
3439 | variables['suitepaths'] = tmp |
3440 | - """ |
3441 | - if variables['testdir'] != defaults['testdir']: |
3442 | - new_path = os.path.join(variables['testdir'],'suite') |
3443 | - search_path = os.path.join(defaults['testdir'],'suite') |
3444 | - tmp = variables['suitepaths'] |
3445 | - tmp[tmp.index(search_path)] = new_path |
3446 | - variables['suitepaths'] = tmp |
3447 | - """ |
3448 | + |
3449 | + # dtr mode is a special case and we have different suites |
3450 | + # paths, etc. We change our default list of suites |
3451 | + # if we are using dtr mode and the user hasn't specified |
3452 | + # any suites (they want default dtr suites) |
3453 | + if variables['mode'] == 'dtr': |
3454 | + if variables['suitelist'] == defaults['suitelist']: |
3455 | + variables['suitelist'] = defaults['dtrsuitelist'] |
3456 | return variables |
3457 | |
3458 | def parse_qp_options(defaults): |
3459 | |
3460 | === renamed directory 'tests/kewpie/lib/server_mgmt' => 'tests/lib/server_mgmt' |
3461 | === removed directory 'tests/lib/server_mgmt' |
3462 | === removed file 'tests/lib/server_mgmt/__init__.py' |
3463 | === removed file 'tests/lib/server_mgmt/drizzled.py' |
3464 | --- tests/lib/server_mgmt/drizzled.py 2012-03-05 14:28:36 +0000 |
3465 | +++ tests/lib/server_mgmt/drizzled.py 1970-01-01 00:00:00 +0000 |
3466 | @@ -1,227 +0,0 @@ |
3467 | -#! /usr/bin/env python |
3468 | -# -*- mode: python; indent-tabs-mode: nil; -*- |
3469 | -# vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
3470 | -# |
3471 | -# Copyright (C) 2010,2011 Patrick Crews |
3472 | -# |
3473 | -# This program is free software; you can redistribute it and/or modify |
3474 | -# it under the terms of the GNU General Public License as published by |
3475 | -# the Free Software Foundation; either version 2 of the License, or |
3476 | -# (at your option) any later version. |
3477 | -# |
3478 | -# This program is distributed in the hope that it will be useful, |
3479 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
3480 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3481 | -# GNU General Public License for more details. |
3482 | -# |
3483 | -# You should have received a copy of the GNU General Public License |
3484 | -# along with this program; if not, write to the Free Software |
3485 | -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
3486 | - |
3487 | - |
3488 | -""" drizzled.py: code to allow a serverManager |
3489 | - to provision and start up a drizzled server object |
3490 | - for test execution |
3491 | - |
3492 | -""" |
3493 | - |
3494 | -# imports |
3495 | -import os |
3496 | -from lib.server_mgmt.server import Server |
3497 | - |
3498 | -class drizzleServer(Server): |
3499 | - """ represents a drizzle server, its possessions |
3500 | - (datadir, ports, etc), and methods for controlling |
3501 | - and querying it |
3502 | - |
3503 | - TODO: create a base server class that contains |
3504 | - standard methods from which we can inherit |
3505 | - Currently there are definitely methods / attr |
3506 | - which are general |
3507 | - |
3508 | - """ |
3509 | - |
3510 | - def __init__( self, name, server_manager, code_tree, default_storage_engine |
3511 | - , server_options, requester, workdir_root): |
3512 | - super(drizzleServer, self).__init__( name |
3513 | - , server_manager |
3514 | - , code_tree |
3515 | - , default_storage_engine |
3516 | - , server_options |
3517 | - , requester |
3518 | - , workdir_root) |
3519 | - self.preferred_base_port = 9306 |
3520 | - |
3521 | - # client files |
3522 | - self.drizzledump = self.code_tree.drizzledump |
3523 | - self.drizzle_client = self.code_tree.drizzle_client |
3524 | - self.drizzleimport = self.code_tree.drizzleimport |
3525 | - self.drizzleslap = self.code_tree.drizzleslap |
3526 | - self.server_path = self.code_tree.drizzle_server |
3527 | - self.drizzle_client_path = self.code_tree.drizzle_client |
3528 | - self.schemawriter = self.code_tree.schemawriter |
3529 | - |
3530 | - # Get our ports |
3531 | - self.port_block = self.system_manager.port_manager.get_port_block( self.name |
3532 | - , self.preferred_base_port |
3533 | - , 6 ) |
3534 | - self.master_port = self.port_block[0] |
3535 | - self.drizzle_tcp_port = self.port_block[1] |
3536 | - self.mc_port = self.port_block[2] |
3537 | - self.pbms_port = self.port_block[3] |
3538 | - self.rabbitmq_node_port = self.port_block[4] |
3539 | - self.json_server_port = self.port_block[5] |
3540 | - |
3541 | - # Generate our working directories |
3542 | - self.dirset = { self.name : { 'var': {'std_data_ln':( os.path.join(self.code_tree.testdir,'std_data')) |
3543 | - ,'log':None |
3544 | - ,'run':None |
3545 | - ,'tmp':None |
3546 | - ,'master-data': {'local': { 'test':None |
3547 | - , 'mysql':None |
3548 | - } |
3549 | - } |
3550 | - } |
3551 | - } |
3552 | - } |
3553 | - self.workdir = self.system_manager.create_dirset( workdir_root |
3554 | - , self.dirset) |
3555 | - self.vardir = os.path.join(self.workdir,'var') |
3556 | - self.tmpdir = os.path.join(self.vardir,'tmp') |
3557 | - self.rundir = os.path.join(self.vardir,'run') |
3558 | - self.logdir = os.path.join(self.vardir,'log') |
3559 | - self.datadir = os.path.join(self.vardir,'master-data') |
3560 | - |
3561 | - self.error_log = os.path.join(self.logdir,('%s.err' %(self.name))) |
3562 | - self.pid_file = os.path.join(self.rundir,('%s.pid' %(self.name))) |
3563 | - self.socket_file = os.path.join(self.vardir, ('%s.sock' %(self.name))) |
3564 | - self.timer_file = os.path.join(self.logdir,('timer')) |
3565 | - |
3566 | - # Do magic to create a config file for use with the slave |
3567 | - # plugin |
3568 | - self.slave_config_file = os.path.join(self.logdir,'slave.cnf') |
3569 | - self.create_slave_config_file() |
3570 | - |
3571 | - self.snapshot_path = os.path.join(self.tmpdir,('snapshot_%s' %(self.master_port))) |
3572 | - # We want to use --secure-file-priv = $vardir by default |
3573 | - # but there are times / tools when we need to shut this off |
3574 | - if self.no_secure_file_priv: |
3575 | - self.secure_file_string = '' |
3576 | - else: |
3577 | - self.secure_file_string = "--secure-file-priv='%s'" %(self.vardir) |
3578 | - self.user_string = '--user=root' |
3579 | - |
3580 | - self.initialize_databases() |
3581 | - self.take_db_snapshot() |
3582 | - |
3583 | - self.logging.debug_class(self) |
3584 | - |
3585 | - def report(self): |
3586 | - """ We print out some general useful info """ |
3587 | - report_values = [ 'name' |
3588 | - , 'master_port' |
3589 | - , 'drizzle_tcp_port' |
3590 | - , 'mc_port' |
3591 | - , 'pbms_port' |
3592 | - , 'rabbitmq_node_port' |
3593 | - , 'vardir' |
3594 | - , 'status' |
3595 | - ] |
3596 | - self.logging.info("%s server:" %(self.owner)) |
3597 | - for key in report_values: |
3598 | - value = vars(self)[key] |
3599 | - self.logging.info("%s: %s" %(key.upper(), value)) |
3600 | - |
3601 | - def get_start_cmd(self): |
3602 | - """ Return the command string that will start up the server |
3603 | - as desired / intended |
3604 | - |
3605 | - """ |
3606 | - |
3607 | - server_args = [ self.process_server_options() |
3608 | - , "--mysql-protocol.port=%d" %(self.master_port) |
3609 | - , "--mysql-protocol.connect-timeout=60" |
3610 | - , "--innodb.data-file-path=ibdata1:20M:autoextend" |
3611 | - , "--sort-buffer-size=256K" |
3612 | - , "--max-heap-table-size=1M" |
3613 | - , "--mysql-unix-socket-protocol.path=%s" %(self.socket_file) |
3614 | - , "--pid-file=%s" %(self.pid_file) |
3615 | - , "--drizzle-protocol.port=%d" %(self.drizzle_tcp_port) |
3616 | - , "--default-storage-engine=%s" %(self.default_storage_engine) |
3617 | - , "--datadir=%s" %(self.datadir) |
3618 | - , "--tmpdir=%s" %(self.tmpdir) |
3619 | - , self.secure_file_string |
3620 | - , self.user_string |
3621 | - ] |
3622 | - |
3623 | - if self.gdb: |
3624 | - server_args.append('--gdb') |
3625 | - return self.system_manager.handle_gdb_reqs(self, server_args) |
3626 | - else: |
3627 | - return "%s %s %s & " % ( self.cmd_prefix |
3628 | - , self.server_path |
3629 | - , " ".join(server_args) |
3630 | - ) |
3631 | - |
3632 | - |
3633 | - def get_stop_cmd(self): |
3634 | - """ Return the command that will shut us down """ |
3635 | - |
3636 | - return "%s --user=root --port=%d --connect-timeout=5 --silent --password= --shutdown " %(self.drizzle_client_path, self.master_port) |
3637 | - |
3638 | - |
3639 | - def get_ping_cmd(self): |
3640 | - """Return the command string that will |
3641 | - ping / check if the server is alive |
3642 | - |
3643 | - """ |
3644 | - |
3645 | - return "%s --ping --port=%d --user=root" % (self.drizzle_client_path, self.master_port) |
3646 | - |
3647 | - def is_started(self): |
3648 | - """ Determine if the server is up and running - |
3649 | - this may vary from server type to server type |
3650 | - |
3651 | - """ |
3652 | - |
3653 | - # We experiment with waiting for a pid file to be created vs. pinging |
3654 | - # This is what test-run.pl does and it helps us pass logging_stats tests |
3655 | - # while not self.ping_server(server, quiet=True) and timer != timeout: |
3656 | - |
3657 | - return self.system_manager.find_path( [self.pid_file] |
3658 | - , required=0) |
3659 | - |
3660 | - def create_slave_config_file(self): |
3661 | - """ Create a config file suitable for use |
3662 | - with the slave-plugin. This allows |
3663 | - us to tie other servers in easily |
3664 | - |
3665 | - """ |
3666 | - |
3667 | - config_data = [ "[master1]" |
3668 | - , "master-host=127.0.0.1" |
3669 | - , "master-port=%d" %self.master_port |
3670 | - , "master-user=root" |
3671 | - , "master-pass=''" |
3672 | - , "max-reconnects=100" |
3673 | - #, "seconds-between-reconnects=20" |
3674 | - ] |
3675 | - outfile = open(self.slave_config_file,'w') |
3676 | - for line in config_data: |
3677 | - outfile.write("%s\n" %(line)) |
3678 | - outfile.close() |
3679 | - |
3680 | - |
3681 | - |
3682 | - |
3683 | - |
3684 | - |
3685 | - |
3686 | - |
3687 | - |
3688 | - |
3689 | - |
3690 | - |
3691 | - |
3692 | - |
3693 | - |
3694 | |
3695 | === removed file 'tests/lib/server_mgmt/mysqld.py' |
3696 | --- tests/lib/server_mgmt/mysqld.py 2011-07-26 19:30:09 +0000 |
3697 | +++ tests/lib/server_mgmt/mysqld.py 1970-01-01 00:00:00 +0000 |
3698 | @@ -1,233 +0,0 @@ |
3699 | -#! /usr/bin/env python |
3700 | -# -*- mode: python; indent-tabs-mode: nil; -*- |
3701 | -# vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
3702 | -# |
3703 | -# Copyright (C) 2010,2011 Patrick Crews |
3704 | -# |
3705 | -# This program is free software; you can redistribute it and/or modify |
3706 | -# it under the terms of the GNU General Public License as published by |
3707 | -# the Free Software Foundation; either version 2 of the License, or |
3708 | -# (at your option) any later version. |
3709 | -# |
3710 | -# This program is distributed in the hope that it will be useful, |
3711 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
3712 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3713 | -# GNU General Public License for more details. |
3714 | -# |
3715 | -# You should have received a copy of the GNU General Public License |
3716 | -# along with this program; if not, write to the Free Software |
3717 | -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
3718 | - |
3719 | - |
3720 | -""" mysqld.py: code to allow a serverManager |
3721 | - to provision and start up a mysqld server object |
3722 | - for test execution |
3723 | - |
3724 | -""" |
3725 | - |
3726 | -# imports |
3727 | -import os |
3728 | -import sys |
3729 | -import subproc |
3730 | - |
3731 | - |
3732 | -from lib.server_mgmt.server import Server |
3733 | - |
3734 | -class mysqlServer(Server): |
3735 | - """ represents a mysql server, its possessions |
3736 | - (datadir, ports, etc), and methods for controlling |
3737 | - and querying it |
3738 | - |
3739 | - TODO: create a base server class that contains |
3740 | - standard methods from which we can inherit |
3741 | - Currently there are definitely methods / attr |
3742 | - which are general |
3743 | - |
3744 | - """ |
3745 | - |
3746 | - def __init__( self, name, server_manager, code_tree, default_storage_engine |
3747 | - , server_options, requester, workdir_root): |
3748 | - super(mysqlServer, self).__init__( name |
3749 | - , server_manager |
3750 | - , code_tree |
3751 | - , default_storage_engine |
3752 | - , server_options |
3753 | - , requester |
3754 | - , workdir_root) |
3755 | - self.preferred_base_port = 9306 |
3756 | - |
3757 | - # client files |
3758 | - self.mysqldump = self.code_tree.mysqldump |
3759 | - self.mysqladmin = self.code_tree.mysqladmin |
3760 | - self.mysql_client = self.code_tree.mysql_client |
3761 | - self.mysqlimport = self.code_tree.mysqlimport |
3762 | - self.mysqlslap = self.code_tree.mysqlslap |
3763 | - self.server_path = self.code_tree.mysql_server |
3764 | - self.mysql_client_path = self.code_tree.mysql_client |
3765 | - |
3766 | - # important stuff |
3767 | - self.langdir = self.code_tree.langdir |
3768 | - self.charsetdir = self.code_tree.charsetdir |
3769 | - self.bootstrap_file = self.code_tree.bootstrap_path |
3770 | - self.bootstrap_cmd = None |
3771 | - |
3772 | - # Get our ports |
3773 | - self.port_block = self.system_manager.port_manager.get_port_block( self.name |
3774 | - , self.preferred_base_port |
3775 | - , 1 ) |
3776 | - self.master_port = self.port_block[0] |
3777 | - |
3778 | - # Generate our working directories |
3779 | - self.dirset = { self.name : { 'var': {'std_data_ln':( os.path.join(self.code_tree.testdir,'std_data')) |
3780 | - ,'log':None |
3781 | - ,'run':None |
3782 | - ,'tmp':None |
3783 | - ,'master-data': {'local': { 'test':None |
3784 | - , 'mysql':None |
3785 | - } |
3786 | - } |
3787 | - } |
3788 | - } |
3789 | - } |
3790 | - self.workdir = self.system_manager.create_dirset( workdir_root |
3791 | - , self.dirset) |
3792 | - self.vardir = os.path.join(self.workdir,'var') |
3793 | - self.tmpdir = os.path.join(self.vardir,'tmp') |
3794 | - self.rundir = os.path.join(self.vardir,'run') |
3795 | - self.logdir = os.path.join(self.vardir,'log') |
3796 | - self.datadir = os.path.join(self.vardir,'master-data') |
3797 | - |
3798 | - self.error_log = os.path.join(self.logdir,('%s.err' %(self.name))) |
3799 | - self.bootstrap_log = os.path.join(self.logdir,('bootstrap.log')) |
3800 | - self.pid_file = os.path.join(self.rundir,('%s.pid' %(self.name))) |
3801 | - self.socket_file = os.path.join(self.vardir, ('%s.sock' %(self.name))) |
3802 | - self.timer_file = os.path.join(self.logdir,('timer')) |
3803 | - |
3804 | - self.snapshot_path = os.path.join(self.tmpdir,('snapshot_%s' %(self.master_port))) |
3805 | - # We want to use --secure-file-priv = $vardir by default |
3806 | - # but there are times / tools when we need to shut this off |
3807 | - if self.no_secure_file_priv: |
3808 | - self.secure_file_string = '' |
3809 | - else: |
3810 | - self.secure_file_string = "--secure-file-priv='%s'" %(self.vardir) |
3811 | - self.user_string = '--user=root' |
3812 | - |
3813 | - self.initialize_databases() |
3814 | - self.take_db_snapshot() |
3815 | - |
3816 | - self.logging.debug_class(self) |
3817 | - |
3818 | - def report(self): |
3819 | - """ We print out some general useful info """ |
3820 | - report_values = [ 'name' |
3821 | - , 'master_port' |
3822 | - , 'mysql_tcp_port' |
3823 | - , 'vardir' |
3824 | - , 'status' |
3825 | - ] |
3826 | - self.logging.info("%s server:" %(self.owner)) |
3827 | - for key in report_values: |
3828 | - value = vars(self)[key] |
3829 | - self.logging.info("%s: %s" %(key.upper(), value)) |
3830 | - |
3831 | - def initialize_databases(self): |
3832 | - """ Do the voodoo required to have a working database setup. |
3833 | - For MySQL, this is calling the server with the |
3834 | - --bootstrap argument. We generate the bootstrap |
3835 | - file during codeTree intialization as the file is standard for |
3836 | - all MySQL servers that are spawned from a single codeTree |
3837 | - |
3838 | - """ |
3839 | - |
3840 | - # generate the bootstrap startup command |
3841 | - if not self.bootstrap_cmd: |
3842 | - mysqld_args = [ "--no-defaults" |
3843 | - , "--bootstrap" |
3844 | - , "--basedir=%s" %(self.code_tree.basedir) |
3845 | - , "--datadir=%s" %(self.datadir) |
3846 | - , "--loose-skip-falcon" |
3847 | - , "--loose-skip-ndbcluster" |
3848 | - , "--tmpdir=%s" %(self.tmpdir) |
3849 | - , "--core-file" |
3850 | - , "--lc-messages-dir=%s" %(self.langdir) |
3851 | - , "--character-sets-dir=%s" %(self.charsetdir) |
3852 | - ] |
3853 | - # We add server_path into the mix this way as we |
3854 | - # may alter how we store / handle server args later |
3855 | - mysqld_args = [self.server_path].append(mysqld_args) |
3856 | - self.bootstrap_cmd = " ".join(mysqld_args) |
3857 | - # execute our command |
3858 | - bootstrap_subproc = subprocess.Popen( self.bootstrap_cmd |
3859 | - , shell=True |
3860 | - , stdout=self.bootstrap_log |
3861 | - , stderr=self.bootstrap_log |
3862 | - ) |
3863 | - bootstrap_subproc.wait() |
3864 | - bootstrap_retcode = bootstrap_subproc.returncode |
3865 | - if bootstrap_retcode: |
3866 | - self.logging.error("Received retcode: %s executing command: %s" |
3867 | - %(bootstrap_retcode, self.bootstrap_cmd)) |
3868 | - self.logging.error("Check the bootstrap log: %s" %(self.bootstrap_log)) |
3869 | - sys.exit(1) |
3870 | - |
3871 | - |
3872 | - def get_start_cmd(self): |
3873 | - """ Return the command string that will start up the server |
3874 | - as desired / intended |
3875 | - |
3876 | - """ |
3877 | - |
3878 | - server_args = [ self.process_server_options() |
3879 | - , "--mysql-protocol.port=%d" %(self.master_port) |
3880 | - , "--mysql-protocol.connect-timeout=60" |
3881 | - , "--innodb.data-file-path=ibdata1:20M:autoextend" |
3882 | - , "--sort-buffer-size=256K" |
3883 | - , "--max-heap-table-size=1M" |
3884 | - , "--mysql-unix-socket-protocol.path=%s" %(self.socket_file) |
3885 | - , "--pid-file=%s" %(self.pid_file) |
3886 | - , "--mysql-protocol.port=%d" %(self.mysql_tcp_port) |
3887 | - , "--default-storage-engine=%s" %(self.default_storage_engine) |
3888 | - , "--datadir=%s" %(self.datadir) |
3889 | - , "--tmpdir=%s" %(self.tmpdir) |
3890 | - , self.secure_file_string |
3891 | - , self.user_string |
3892 | - ] |
3893 | - |
3894 | - if self.gdb: |
3895 | - server_args.append('--gdb') |
3896 | - return self.system_manager.handle_gdb_reqs(self, server_args) |
3897 | - else: |
3898 | - return "%s %s %s & " % ( self.cmd_prefix |
3899 | - , self.server_path |
3900 | - , " ".join(server_args) |
3901 | - ) |
3902 | - |
3903 | - |
3904 | - def get_stop_cmd(self): |
3905 | - """ Return the command that will shut us down """ |
3906 | - |
3907 | - return "%s --user=root --port=%d --connect-timeout=5 --silent --password= --shutdown " %(self.mysql_client_path, self.master_port) |
3908 | - |
3909 | - |
3910 | - def get_ping_cmd(self): |
3911 | - """Return the command string that will |
3912 | - ping / check if the server is alive |
3913 | - |
3914 | - """ |
3915 | - |
3916 | - return "%s --ping --port=%d --user=root" % (self.mysql_client_path, self.master_port) |
3917 | - |
3918 | - def is_started(self): |
3919 | - """ Determine if the server is up and running - |
3920 | - this may vary from server type to server type |
3921 | - |
3922 | - """ |
3923 | - |
3924 | - # We experiment with waiting for a pid file to be created vs. pinging |
3925 | - # This is what test-run.pl does and it helps us pass logging_stats tests |
3926 | - # while not self.ping_server(server, quiet=True) and timer != timeout: |
3927 | - |
3928 | - return self.system_manager.find_path( [self.pid_file] |
3929 | - , required=0) |
3930 | - |
3931 | - |
3932 | |
3933 | === removed file 'tests/lib/server_mgmt/server.py' |
3934 | --- tests/lib/server_mgmt/server.py 2011-06-23 19:18:02 +0000 |
3935 | +++ tests/lib/server_mgmt/server.py 1970-01-01 00:00:00 +0000 |
3936 | @@ -1,159 +0,0 @@ |
3937 | -#! /usr/bin/env python |
3938 | -# -*- mode: python; indent-tabs-mode: nil; -*- |
3939 | -# vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
3940 | -# |
3941 | -# Copyright (C) 2010,2011 Patrick Crews |
3942 | -# |
3943 | -# This program is free software; you can redistribute it and/or modify |
3944 | -# it under the terms of the GNU General Public License as published by |
3945 | -# the Free Software Foundation; either version 2 of the License, or |
3946 | -# (at your option) any later version. |
3947 | -# |
3948 | -# This program is distributed in the hope that it will be useful, |
3949 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
3950 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3951 | -# GNU General Public License for more details. |
3952 | -# |
3953 | -# You should have received a copy of the GNU General Public License |
3954 | -# along with this program; if not, write to the Free Software |
3955 | -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
3956 | - |
3957 | - |
3958 | -""" server.py: generic server object used by the server |
3959 | - manager. This contains the generic methods for all |
3960 | - servers. Specific types (Drizzle, MySQL, etc) should |
3961 | - inherit from this guy |
3962 | - |
3963 | -""" |
3964 | - |
3965 | -# imports |
3966 | -import os |
3967 | - |
3968 | -class Server(object): |
3969 | - """ the server class from which other servers |
3970 | - will inherit - contains generic methods |
3971 | - certain methods will be overridden by more |
3972 | - specific ones |
3973 | - |
3974 | - """ |
3975 | - |
3976 | - def __init__(self |
3977 | - , name |
3978 | - , server_manager |
3979 | - , code_tree |
3980 | - , default_storage_engine |
3981 | - , server_options |
3982 | - , requester |
3983 | - , workdir_root): |
3984 | - self.skip_keys = [ 'server_manager' |
3985 | - , 'system_manager' |
3986 | - , 'dirset' |
3987 | - , 'preferred_base_port' |
3988 | - , 'no_secure_file_priv' |
3989 | - , 'secure_file_string' |
3990 | - , 'port_block' |
3991 | - ] |
3992 | - self.debug = server_manager.debug |
3993 | - self.verbose = server_manager.verbose |
3994 | - self.initial_run = 1 |
3995 | - self.owner = requester |
3996 | - self.server_options = server_options |
3997 | - self.default_storage_engine = default_storage_engine |
3998 | - self.server_manager = server_manager |
3999 | - # We register with server_manager asap |
4000 | - self.server_manager.log_server(self, requester) |
4001 | - |
4002 | - self.system_manager = self.server_manager.system_manager |
4003 | - self.code_tree = code_tree |
4004 | - self.valgrind = self.system_manager.valgrind |
4005 | - self.gdb = self.system_manager.gdb |
4006 | - if self.valgrind: |
4007 | - self.valgrind_time_buffer = 10 |
4008 | - else: |
4009 | - self.valgrind_time_buffer = 1 |
4010 | - self.cmd_prefix = self.system_manager.cmd_prefix |
4011 | - self.logging = self.system_manager.logging |
4012 | - self.no_secure_file_priv = self.server_manager.no_secure_file_priv |
4013 | - self.name = name |
4014 | - self.status = 0 # stopped, 1 = running |
4015 | - self.tried_start = 0 |
4016 | - self.failed_test = 0 # was the last test a failure? our state is suspect |
4017 | - self.server_start_timeout = 60 * self.valgrind_time_buffer |
4018 | - self.pid = None |
4019 | - self.need_reset = False |
4020 | - |
4021 | - def initialize_databases(self): |
4022 | - """ Call schemawriter to make db.opt files """ |
4023 | - databases = [ 'test' |
4024 | - , 'mysql' |
4025 | - ] |
4026 | - for database in databases: |
4027 | - db_path = os.path.join(self.datadir,'local',database,'db.opt') |
4028 | - cmd = "%s %s %s" %(self.schemawriter, database, db_path) |
4029 | - self.system_manager.execute_cmd(cmd) |
4030 | - |
4031 | - def process_server_options(self): |
4032 | - """Consume the list of options we have been passed. |
4033 | - Return a string with them joined |
4034 | - |
4035 | - """ |
4036 | - |
4037 | - return " ".join(self.server_options) |
4038 | - |
4039 | - def take_db_snapshot(self): |
4040 | - """ Take a snapshot of our vardir for quick restores """ |
4041 | - |
4042 | - self.logging.info("Taking clean db snapshot...") |
4043 | - if os.path.exists(self.snapshot_path): |
4044 | - # We need to remove an existing path as python shutil |
4045 | - # doesn't want an existing target |
4046 | - self.system_manager.remove_dir(self.snapshot_path) |
4047 | - self.system_manager.copy_dir(self.datadir, self.snapshot_path) |
4048 | - |
4049 | - def restore_snapshot(self): |
4050 | - """ Restore from a stored snapshot """ |
4051 | - |
4052 | - self.logging.verbose("Restoring from db snapshot") |
4053 | - if not os.path.exists(self.snapshot_path): |
4054 | - self.logging.error("Could not find snapshot: %s" %(self.snapshot_path)) |
4055 | - self.system_manager.remove_dir(self.datadir) |
4056 | - self.system_manager.copy_dir(self.snapshot_path, self.datadir) |
4057 | - |
4058 | - def is_started(self): |
4059 | - """ Is the server running? Particulars are server-dependent """ |
4060 | - |
4061 | - return "You need to implement is_started" |
4062 | - |
4063 | - def get_start_cmd(self): |
4064 | - """ Return the command the server_manager can use to start me """ |
4065 | - |
4066 | - return "You need to implement get_start_cmd" |
4067 | - |
4068 | - def get_stop_cmd(self): |
4069 | - """ Return the command the server_manager can use to stop me """ |
4070 | - |
4071 | - return "You need to implement get_stop_cmd" |
4072 | - |
4073 | - def get_ping_cmd(self): |
4074 | - """ Return the command that can be used to 'ping' me |
4075 | - Very similar to is_started, but different |
4076 | - |
4077 | - Determining if a server is still running (ping) |
4078 | - may differ from the method used to determine |
4079 | - server startup |
4080 | - |
4081 | - """ |
4082 | - |
4083 | - return "You need to implement get_ping_cmd" |
4084 | - |
4085 | - def cleanup(self): |
4086 | - """ Cleanup - just free ports for now...""" |
4087 | - self.system_manager.port_manager.free_ports(self.port_block) |
4088 | - |
4089 | - def set_server_options(self, server_options): |
4090 | - """ We update our server_options to the new set """ |
4091 | - self.server_options = server_options |
4092 | - |
4093 | - def reset(self): |
4094 | - """ Voodoo to reset ourselves """ |
4095 | - self.failed_test = 0 |
4096 | |
4097 | === removed file 'tests/lib/server_mgmt/server_management.py' |
4098 | --- tests/lib/server_mgmt/server_management.py 2011-06-28 21:07:43 +0000 |
4099 | +++ tests/lib/server_mgmt/server_management.py 1970-01-01 00:00:00 +0000 |
4100 | @@ -1,584 +0,0 @@ |
4101 | -#! /usr/bin/env python |
4102 | -# -*- mode: python; indent-tabs-mode: nil; -*- |
4103 | -# vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
4104 | -# |
4105 | -# Copyright (C) 2010, 2011 Patrick Crews |
4106 | -# |
4107 | -# This program is free software; you can redistribute it and/or modify |
4108 | -# it under the terms of the GNU General Public License as published by |
4109 | -# the Free Software Foundation; either version 2 of the License, or |
4110 | -# (at your option) any later version. |
4111 | -# |
4112 | -# This program is distributed in the hope that it will be useful, |
4113 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
4114 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4115 | -# GNU General Public License for more details. |
4116 | -# |
4117 | -# You should have received a copy of the GNU General Public License |
4118 | -# along with this program; if not, write to the Free Software |
4119 | -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
4120 | - |
4121 | -"""server_management.py |
4122 | - code for dealing with apportioning servers |
4123 | - to suit the needs of the tests and executors |
4124 | - |
4125 | -""" |
4126 | -# imports |
4127 | -import thread |
4128 | -import time |
4129 | -import os |
4130 | -import subprocess |
4131 | -from ConfigParser import RawConfigParser |
4132 | - |
4133 | -class serverManager: |
4134 | - """ code that handles the server objects |
4135 | - We use this to track, do mass actions, etc |
4136 | - Single point of contact for this business |
4137 | - |
4138 | - """ |
4139 | - |
4140 | - def __init__(self, system_manager, variables): |
4141 | - self.skip_keys = [ 'system_manager' |
4142 | - , 'env_manager' |
4143 | - , 'code_manager' |
4144 | - , 'logging' |
4145 | - , 'gdb' |
4146 | - ] |
4147 | - self.debug = variables['debug'] |
4148 | - self.verbose = variables['verbose'] |
4149 | - self.initial_run = 1 |
4150 | - # we try this to shorten things - will see how this works |
4151 | - self.server_base_name = 's' |
4152 | - self.no_secure_file_priv = variables['nosecurefilepriv'] |
4153 | - self.system_manager = system_manager |
4154 | - self.code_manager = system_manager.code_manager |
4155 | - self.env_manager = system_manager.env_manager |
4156 | - self.logging = system_manager.logging |
4157 | - self.gdb = self.system_manager.gdb |
4158 | - self.default_storage_engine = variables['defaultengine'] |
4159 | - self.default_server_type = variables['defaultservertype'] |
4160 | - self.user_server_opts = variables['drizzledoptions'] |
4161 | - self.servers = {} |
4162 | - |
4163 | - self.mutex = thread.allocate_lock() |
4164 | - self.timer_increment = .5 |
4165 | - self.libeatmydata = variables['libeatmydata'] |
4166 | - self.libeatmydata_path = variables['libeatmydatapath'] |
4167 | - |
4168 | - self.logging.info("Using default-storage-engine: %s" %(self.default_storage_engine)) |
4169 | - |
4170 | - self.logging.debug_class(self) |
4171 | - |
4172 | - def request_servers( self, requester, workdir, cnf_path, server_requirements |
4173 | - , working_environ, expect_fail = 0): |
4174 | - """ We produce the server objects / start the server processes |
4175 | - as requested. We report errors and whatnot if we can't |
4176 | - That is, unless we expect the server to not start, then |
4177 | - we just return a value / message. |
4178 | - |
4179 | - server_requirements is a list of lists. Each list |
4180 | - is a set of server options - we create one server |
4181 | - for each set of options requested |
4182 | - |
4183 | - """ |
4184 | - |
4185 | - # Make sure our server is in a decent state, if the last test |
4186 | - # failed, then we reset the server |
4187 | - self.check_server_status(requester) |
4188 | - |
4189 | - # Make sure we have the proper number of servers for this requester |
4190 | - self.process_server_count( requester, len(server_requirements) |
4191 | - , workdir, server_requirements) |
4192 | - |
4193 | - # Make sure we are running with the correct options |
4194 | - self.evaluate_existing_servers(requester, cnf_path, server_requirements) |
4195 | - |
4196 | - # Fire our servers up |
4197 | - bad_start = self.start_servers( requester, working_environ |
4198 | - , expect_fail) |
4199 | - |
4200 | - # Return them to the requester |
4201 | - return (self.get_server_list(requester), bad_start) |
4202 | - |
4203 | - |
4204 | - |
4205 | - def allocate_server( self, requester, server_options |
4206 | - , workdir, server_type=None, server_version=None): |
4207 | - """ Intialize an appropriate server object. |
4208 | - Start up occurs elsewhere |
4209 | - |
4210 | - """ |
4211 | - # use default server type unless specifically requested to do otherwise |
4212 | - if not server_type: |
4213 | - server_type = self.default_server_type |
4214 | - |
4215 | - # Get a name for our server |
4216 | - server_name = self.get_server_name(requester) |
4217 | - |
4218 | - # initialize our new server_object |
4219 | - # get the right codeTree type from the code manager |
4220 | - code_tree = self.code_manager.get_tree(server_type, server_version) |
4221 | - |
4222 | - # import the correct server type object |
4223 | - if server_type == 'drizzle': |
4224 | - from lib.server_mgmt.drizzled import drizzleServer as server_type |
4225 | - elif server_type == 'mysql': |
4226 | - from lib.server_mgmt.mysqld import mysqlServer as server_type |
4227 | - |
4228 | - new_server = server_type( server_name |
4229 | - , self |
4230 | - , code_tree |
4231 | - , self.default_storage_engine |
4232 | - , server_options |
4233 | - , requester |
4234 | - , workdir ) |
4235 | - return new_server |
4236 | - |
4237 | - def start_servers(self, requester, working_environ, expect_fail): |
4238 | - """ Start all servers for the requester """ |
4239 | - bad_start = 0 |
4240 | - |
4241 | - for server in self.get_server_list(requester): |
4242 | - if server.status == 0: |
4243 | - bad_start = bad_start + self.start_server( server |
4244 | - , requester |
4245 | - , working_environ |
4246 | - , expect_fail |
4247 | - ) |
4248 | - else: |
4249 | - self.logging.debug("Server %s already running" %(server.name)) |
4250 | - return bad_start |
4251 | - |
4252 | - def start_server(self, server, requester, working_environ, expect_fail): |
4253 | - """ Start an individual server and return |
4254 | - an error code if it did not start in a timely manner |
4255 | - |
4256 | - Start the server, using the options in option_list |
4257 | - as well as self.standard_options |
4258 | - |
4259 | - if expect_fail = 1, we know the server shouldn't |
4260 | - start up |
4261 | - |
4262 | - """ |
4263 | - # take care of any environment updates we need to do |
4264 | - self.handle_environment_reqs(server, working_environ) |
4265 | - |
4266 | - self.logging.verbose("Starting server: %s.%s" %(server.owner, server.name)) |
4267 | - start_cmd = server.get_start_cmd() |
4268 | - self.logging.debug("Starting server with:") |
4269 | - self.logging.debug("%s" %(start_cmd)) |
4270 | - # we signal we tried to start as an attempt |
4271 | - # to catch the case where a server is just |
4272 | - # starting up and the user ctrl-c's |
4273 | - # we don't know the server is running (still starting up) |
4274 | - # so we give it a few minutes |
4275 | - self.tried_start = 1 |
4276 | - error_log = open(server.error_log,'w') |
4277 | - if start_cmd: # It will be none if --manual-gdb used |
4278 | - if not self.gdb: |
4279 | - server_subproc = subprocess.Popen( start_cmd |
4280 | - , shell=True |
4281 | - , env=working_environ |
4282 | - , stdout=error_log |
4283 | - , stderr=error_log |
4284 | - ) |
4285 | - server_subproc.wait() |
4286 | - server_retcode = server_subproc.returncode |
4287 | - else: |
4288 | - # This is a bit hackish - need to see if there is a cleaner |
4289 | - # way of handling this |
4290 | - # It is annoying that we have to say stdout + stderr = None |
4291 | - # We might need to further manipulate things so that we |
4292 | - # have a log |
4293 | - server_subproc = subprocess.Popen( start_cmd |
4294 | - , shell=True |
4295 | - , env = working_environ |
4296 | - , stdin=None |
4297 | - , stdout=None |
4298 | - , stderr=None |
4299 | - , close_fds=True |
4300 | - ) |
4301 | - |
4302 | - server_retcode = 0 |
4303 | - else: |
4304 | - # manual-gdb issue |
4305 | - server_retcode = 0 |
4306 | - |
4307 | - timer = float(0) |
4308 | - timeout = float(server.server_start_timeout) |
4309 | - |
4310 | - #if server_retcode: # We know we have an error, no need to wait |
4311 | - # timer = timeout |
4312 | - |
4313 | - |
4314 | - |
4315 | - while not server.is_started() and timer != timeout: |
4316 | - time.sleep(self.timer_increment) |
4317 | - # If manual-gdb, this == None and we want to give the |
4318 | - # user all the time they need |
4319 | - if start_cmd: |
4320 | - timer= timer + self.timer_increment |
4321 | - |
4322 | - if timer == timeout and not self.ping_server(server, quiet=True): |
4323 | - self.logging.error(( "Server failed to start within %d seconds. This could be a problem with the test machine or the server itself" %(timeout))) |
4324 | - server_retcode = 1 |
4325 | - |
4326 | - if server_retcode == 0: |
4327 | - server.status = 1 # we are running |
4328 | - if os.path.exists(server.pid_file): |
4329 | - pid_file = open(server.pid_file,'r') |
4330 | - pid = pid_file.readline().strip() |
4331 | - pid_file.close() |
4332 | - server.pid = pid |
4333 | - |
4334 | - if server_retcode != 0 and not expect_fail: |
4335 | - self.logging.error("Server startup command: %s failed with error code %d" %( start_cmd |
4336 | - , server_retcode)) |
4337 | - elif server_retcode == 0 and expect_fail: |
4338 | - # catch a startup that should have failed and report |
4339 | - self.logging.error("Server startup command :%s expected to fail, but succeeded" %(start_cmd)) |
4340 | - |
4341 | - server.tried_start = 0 |
4342 | - return server_retcode ^ expect_fail |
4343 | - |
4344 | - def ping_server(self, server, quiet=False): |
4345 | - """ Ping / check if the server is alive |
4346 | - Return True if server is up and running, False otherwise |
4347 | - """ |
4348 | - |
4349 | - ping_cmd = server.get_ping_cmd() |
4350 | - if not quiet: |
4351 | - self.logging.info("Pinging Drizzled server on port %d" % server.master_port) |
4352 | - (retcode, output)= self.system_manager.execute_cmd(ping_cmd, must_pass = 0) |
4353 | - return retcode == 0 |
4354 | - |
4355 | - |
4356 | - def stop_server(self, server): |
4357 | - """ Stop an individual server if it is running """ |
4358 | - if server.tried_start: |
4359 | - # we expect that we issued the command to start |
4360 | - # the server but it isn't up and running |
4361 | - # we kill a bit of time waiting for it |
4362 | - attempts_remain = 10 |
4363 | - while not self.ping_server(server, quiet=True) and attempts_remain: |
4364 | - time.sleep(1) |
4365 | - attempts_remain = attempts_remain - 1 |
4366 | - # Now we try to shut the server down |
4367 | - if self.ping_server(server, quiet=True): |
4368 | - self.logging.verbose("Stopping server %s.%s" %(server.owner, server.name)) |
4369 | - stop_cmd = server.get_stop_cmd() |
4370 | - #retcode, output = self.system_manager.execute_cmd(stop_cmd) |
4371 | - shutdown_subproc = subprocess.Popen( stop_cmd |
4372 | - , shell=True |
4373 | - ) |
4374 | - shutdown_subproc.wait() |
4375 | - shutdown_retcode = shutdown_subproc.returncode |
4376 | - # We do some monitoring for the server PID and kill it |
4377 | - # if need be. This is a bit of a band-aid for the |
4378 | - # zombie-server bug on Natty : ( Need to find the cause. |
4379 | - attempts_remain = 3 |
4380 | - while self.system_manager.find_pid(server.pid) and attempts_remain: |
4381 | - time.sleep(1) |
4382 | - attempts_remain = attempts_remain - 1 |
4383 | - if not attempts_remain: # we kill the pid |
4384 | - if self.verbose: |
4385 | - self.logging.warning("Forcing kill of server pid: %s" %(server.pid)) |
4386 | - self.system_manager.kill_pid(server.pid) |
4387 | - if shutdown_retcode: |
4388 | - self.logging.error("Problem shutting down server:") |
4389 | - self.logging.error("%s : %s" %(shutdown_retcode)) |
4390 | - else: |
4391 | - server.status = 0 # indicate we are shutdown |
4392 | - else: |
4393 | - # make sure the server is indicated as stopped |
4394 | - server.status = 0 |
4395 | - |
4396 | - def stop_servers(self, requester): |
4397 | - """ Stop all servers running for the requester """ |
4398 | - for server in self.get_server_list(requester): |
4399 | - self.stop_server(server) |
4400 | - |
4401 | - def stop_server_list(self, server_list, free_ports=False): |
4402 | - """ Stop the servers in an arbitrary list of them """ |
4403 | - for server in server_list: |
4404 | - self.stop_server(server) |
4405 | - if free_ports: |
4406 | - server.cleanup() |
4407 | - |
4408 | - def stop_all_servers(self): |
4409 | - """ Stop all running servers """ |
4410 | - |
4411 | - self.logging.info("Stopping all running servers...") |
4412 | - for server_list in self.servers.values(): |
4413 | - for server in server_list: |
4414 | - self.stop_server(server) |
4415 | - |
4416 | - def cleanup_all_servers(self): |
4417 | - """Mainly for freeing server ports for now """ |
4418 | - for server_list in self.servers.values(): |
4419 | - for server in server_list: |
4420 | - server.cleanup() |
4421 | - |
4422 | - def cleanup(self): |
4423 | - """Stop all servers and free their ports and whatnot """ |
4424 | - self.stop_all_servers() |
4425 | - self.cleanup_all_servers() |
4426 | - |
4427 | - def get_server_name(self, requester): |
4428 | - """ We name our servers requester.server_basename.count |
4429 | - where count is on a per-requester basis |
4430 | - We see how many servers this requester has and name things |
4431 | - appropriately |
4432 | - |
4433 | - """ |
4434 | - self.has_servers(requester) # if requester isn't there, we create a blank entry |
4435 | - server_count = self.server_count(requester) |
4436 | - return "%s%d" %(self.server_base_name, server_count) |
4437 | - |
4438 | - def has_servers(self, requester): |
4439 | - """ Check if the given requester has any servers """ |
4440 | - if requester not in self.servers: # new requester |
4441 | - self.log_requester(requester) |
4442 | - return self.server_count(requester) |
4443 | - |
4444 | - def log_requester(self, requester): |
4445 | - """ We create a log entry for the new requester """ |
4446 | - |
4447 | - self.servers[requester] = [] |
4448 | - |
4449 | - def log_server(self, new_server, requester): |
4450 | - self.servers[requester].append(new_server) |
4451 | - |
4452 | - def evaluate_existing_servers( self, requester, cnf_path, server_requirements): |
4453 | - """ See if the requester has any servers and if they |
4454 | - are suitable for the current test |
4455 | - |
4456 | - We should have the proper number of servers at this point |
4457 | - |
4458 | - """ |
4459 | - |
4460 | - # A dictionary that holds various tricks |
4461 | - # we can do with our test servers |
4462 | - special_processing_reqs = {} |
4463 | - |
4464 | - current_servers = self.servers[requester] |
4465 | - |
4466 | - for index,server in enumerate(current_servers): |
4467 | - # We handle a reset in case we need it: |
4468 | - if server.need_reset: |
4469 | - self.reset_server(server) |
4470 | - server.need_reset = False |
4471 | - |
4472 | - desired_server_options = server_requirements[index] |
4473 | - |
4474 | - # do any special config processing - this can alter |
4475 | - # how we view our servers |
4476 | - if cnf_path: |
4477 | - self.handle_server_config_file( cnf_path |
4478 | - , server |
4479 | - , special_processing_reqs |
4480 | - , desired_server_options |
4481 | - ) |
4482 | - |
4483 | - if self.compare_options( server.server_options |
4484 | - , desired_server_options): |
4485 | - return |
4486 | - else: |
4487 | - # We need to reset what is running and change the server |
4488 | - # options |
4489 | - desired_server_options = self.filter_server_options(desired_server_options) |
4490 | - self.reset_server(server) |
4491 | - self.update_server_options(server, desired_server_options) |
4492 | - |
4493 | - self.handle_special_server_requests(special_processing_reqs) |
4494 | - |
4495 | - def handle_server_config_file( self |
4496 | - , cnf_path |
4497 | - , server |
4498 | - , special_processing_reqs |
4499 | - , desired_server_options |
4500 | - ): |
4501 | - # We have a config reader so we can do |
4502 | - # special per-server magic for setting up more |
4503 | - # complex scenario-based testing (eg we use a certain datadir) |
4504 | - config_reader = RawConfigParser() |
4505 | - config_reader.read(cnf_path) |
4506 | - |
4507 | - # Do our checking for config-specific madness we need to do |
4508 | - if config_reader and config_reader.has_section(server.name): |
4509 | - # mark server for restart in case it hasn't yet |
4510 | - # this method is a bit hackish - need better method later |
4511 | - if '--restart' not in desired_server_options: |
4512 | - desired_server_options.append('--restart') |
4513 | - # We handle various scenarios |
4514 | - server_config_data = config_reader.items(server.name) |
4515 | - for cnf_option, data in server_config_data: |
4516 | - if cnf_option == 'load-datadir': |
4517 | - datadir_path = data |
4518 | - request_key = 'datadir_requests' |
4519 | - if request_key not in special_processing_reqs: |
4520 | - special_processing_reqs[request_key] = [] |
4521 | - special_processing_reqs[request_key].append((datadir_path,server)) |
4522 | - |
4523 | - def handle_special_server_requests(self, request_dictionary): |
4524 | - """ We run through our set of special requests and do |
4525 | - the appropriate voodoo |
4526 | - |
4527 | - """ |
4528 | - for key, item in request_dictionary.items(): |
4529 | - if key == 'datadir_requests': |
4530 | - self.load_datadirs(item) |
4531 | - |
4532 | - def filter_server_options(self, server_options): |
4533 | - """ Remove a list of options we don't want passed to the server |
4534 | - these are test-case specific options. |
4535 | - |
4536 | - NOTE: It is a bad hack to allow test-runner commands |
4537 | - to mix with server options willy-nilly in master-opt files |
4538 | - as we do. We need to kill this at some point : ( |
4539 | - |
4540 | - """ |
4541 | - remove_options = [ '--restart' |
4542 | - , '--skip-stack-trace' |
4543 | - , '--skip-core-file' |
4544 | - , '--' |
4545 | - ] |
4546 | - for remove_option in remove_options: |
4547 | - if remove_option in server_options: |
4548 | - server_options.remove(remove_option) |
4549 | - return server_options |
4550 | - |
4551 | - |
4552 | - def compare_options(self, optlist1, optlist2): |
4553 | - """ Compare two sets of server options and see if they match """ |
4554 | - return sorted(optlist1) == sorted(optlist2) |
4555 | - |
4556 | - def reset_server(self, server): |
4557 | - self.stop_server(server) |
4558 | - server.restore_snapshot() |
4559 | - server.reset() |
4560 | - |
4561 | - def reset_servers(self, requester): |
4562 | - for server in self.servers[requester]: |
4563 | - self.reset_server(server) |
4564 | - |
4565 | - def load_datadirs(self, datadir_requests): |
4566 | - """ We load source_dir to the server's datadir """ |
4567 | - for source_dir, server in datadir_requests: |
4568 | - source_dir_path = os.path.join(server.vardir,'std_data_ln',source_dir) |
4569 | - self.system_manager.remove_dir(server.datadir) |
4570 | - self.system_manager.copy_dir(source_dir_path, server.datadir) |
4571 | - # We need to signal that the server will need to be reset as we're |
4572 | - # using a non-standard datadir |
4573 | - server.need_reset = True |
4574 | - |
4575 | - |
4576 | - def process_server_count(self, requester, desired_count, workdir, server_reqs): |
4577 | - """ We see how many servers we have. We shrink / grow |
4578 | - the requesters set of servers as needed. |
4579 | - |
4580 | - If we shrink, we shutdown / reset the discarded servers |
4581 | - (naturally) |
4582 | - |
4583 | - """ |
4584 | - if desired_count < 0: desired_count = 1 |
4585 | - |
4586 | - current_count = self.has_servers(requester) |
4587 | - if desired_count > current_count: |
4588 | - for i in range(desired_count - current_count): |
4589 | - # We pass an empty options list when allocating |
4590 | - # We'll update the options to what is needed elsewhere |
4591 | - self.allocate_server(requester,[] , workdir) |
4592 | - elif desired_count < current_count: |
4593 | - good_servers = self.get_server_list(requester)[:desired_count] |
4594 | - retired_servers = self.get_server_list(requester)[desired_count - current_count:] |
4595 | - self.stop_server_list(retired_servers, free_ports=True) |
4596 | - self.set_server_list(requester, good_servers) |
4597 | - |
4598 | - |
4599 | - |
4600 | - def server_count(self, requester): |
4601 | - """ Return how many servers the the requester has """ |
4602 | - return len(self.servers[requester]) |
4603 | - |
4604 | - def get_server_list(self, requester): |
4605 | - """ Return the list of servers assigned to the requester """ |
4606 | - self.has_servers(requester) # initialize, hacky : ( |
4607 | - return self.servers[requester] |
4608 | - |
4609 | - def set_server_list(self, requester, server_list): |
4610 | - """ Set the requesters list of servers to server_list """ |
4611 | - |
4612 | - self.servers[requester] = server_list |
4613 | - |
4614 | - def add_server(self, requester, new_server): |
4615 | - """ Add new_server to the requester's set of servers """ |
4616 | - self.servers[requester].append(new_server) |
4617 | - |
4618 | - def update_server_options(self, server, server_options): |
4619 | - """ Change the option_list a server has to use on startup """ |
4620 | - self.logging.debug("Updating server: %s options" %(server.name)) |
4621 | - self.logging.debug("FROM: %s" %(server.server_options)) |
4622 | - self.logging.debug("TO: %s" %(server_options)) |
4623 | - server.set_server_options(server_options) |
4624 | - |
4625 | - def get_server_count(self): |
4626 | - """ Find out how many servers we have out """ |
4627 | - server_count = 0 |
4628 | - for server_list in self.servers.values(): |
4629 | - for server in server_list: |
4630 | - server_count = server_count + 1 |
4631 | - return server_count |
4632 | - |
4633 | - def check_server_status(self, requester): |
4634 | - """ Make sure our servers are good, |
4635 | - reset the otherwise. |
4636 | - |
4637 | - """ |
4638 | - for server in self.get_server_list(requester): |
4639 | - if server.failed_test: |
4640 | - self.reset_server(server) |
4641 | - |
4642 | - def handle_environment_reqs(self, server, working_environ): |
4643 | - """ We update the working_environ as we need to |
4644 | - before starting the server. |
4645 | - |
4646 | - This includes things like libeatmydata, ld_preloads, etc |
4647 | - |
4648 | - """ |
4649 | - environment_reqs = {} |
4650 | - |
4651 | - if self.libeatmydata: |
4652 | - # We want to use libeatmydata to disable fsyncs |
4653 | - # this speeds up test execution, but we only want |
4654 | - # it to happen for the servers' environments |
4655 | - |
4656 | - environment_reqs.update({'LD_PRELOAD':self.libeatmydata_path}) |
4657 | - |
4658 | - # handle ld_preloads |
4659 | - ld_lib_paths = self.env_manager.join_env_var_values(server.code_tree.ld_lib_paths) |
4660 | - environment_reqs.update({'LD_LIBRARY_PATH' : self.env_manager.append_env_var( 'LD_LIBRARY_PATH' |
4661 | - , ld_lib_paths |
4662 | - , suffix = 0 |
4663 | - , quiet = 1 |
4664 | - ) |
4665 | - , 'DYLD_LIBRARY_PATH' : self.env_manager.append_env_var( 'DYLD_LIBRARY_PATH' |
4666 | - , ld_lib_paths |
4667 | - , suffix = 0 |
4668 | - , quiet = 1 |
4669 | - ) |
4670 | - |
4671 | - }) |
4672 | - self.env_manager.update_environment_vars(environment_reqs) |
4673 | - |
4674 | - |
4675 | - |
4676 | - |
4677 | - |
4678 | - |
4679 | - |
4680 | - |
4681 | - |
4682 | - |
4683 | - |
4684 | - |
4685 | |
4686 | === renamed directory 'tests/kewpie/lib/sys_mgmt' => 'tests/lib/sys_mgmt' |
4687 | === removed directory 'tests/lib/sys_mgmt' |
4688 | === removed file 'tests/lib/sys_mgmt/__init__.py' |
4689 | === removed file 'tests/lib/sys_mgmt/codeTree.py' |
4690 | --- tests/lib/sys_mgmt/codeTree.py 2012-03-05 14:28:36 +0000 |
4691 | +++ tests/lib/sys_mgmt/codeTree.py 1970-01-01 00:00:00 +0000 |
4692 | @@ -1,357 +0,0 @@ |
4693 | -#! /usr/bin/env python |
4694 | -# -*- mode: python; indent-tabs-mode: nil; -*- |
4695 | -# vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
4696 | -# |
4697 | -# Copyright (C) 2010, 2011 Patrick Crews |
4698 | -# |
4699 | -# This program is free software; you can redistribute it and/or modify |
4700 | -# it under the terms of the GNU General Public License as published by |
4701 | -# the Free Software Foundation; either version 2 of the License, or |
4702 | -# (at your option) any later version. |
4703 | -# |
4704 | -# This program is distributed in the hope that it will be useful, |
4705 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
4706 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4707 | -# GNU General Public License for more details. |
4708 | -# |
4709 | -# You should have received a copy of the GNU General Public License |
4710 | -# along with this program; if not, write to the Free Software |
4711 | -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
4712 | - |
4713 | -"""codeTree |
4714 | - |
4715 | - definition of what a code tree should look like |
4716 | - to the test-runner (which files /directories it should find where) |
4717 | - |
4718 | - Files paths can be in one of several locations that we locate via |
4719 | - systemManager methods |
4720 | - |
4721 | -""" |
4722 | -# imports |
4723 | -import os |
4724 | -import sys |
4725 | - |
4726 | - |
4727 | -class codeTree: |
4728 | - """ Defines what files / directories we should find and where |
4729 | - allows for optional / required. |
4730 | - |
4731 | - """ |
4732 | - |
4733 | - def __init__(self, variables, system_manager): |
4734 | - self.debug = variables['debug'] |
4735 | - self.system_manager = system_manager |
4736 | - self.logging = system_manager.logging |
4737 | - |
4738 | - def debug_status(self): |
4739 | - self.logging.debug(self) |
4740 | - for key, item in sorted(vars(self).items()): |
4741 | - self.logging.debug("%s: %s" %(key, item)) |
4742 | - |
4743 | -class drizzleTree(codeTree): |
4744 | - """ What a Drizzle code tree should look like to the test-runner |
4745 | - |
4746 | - """ |
4747 | - |
4748 | - def __init__(self, variables,system_manager): |
4749 | - self.system_manager = system_manager |
4750 | - self.logging = self.system_manager.logging |
4751 | - self.skip_keys = ['ld_lib_paths'] |
4752 | - self.debug = variables['debug'] |
4753 | - self.verbose = variables['verbose'] |
4754 | - self.basedir = self.system_manager.find_path([os.path.abspath(variables['basedir'][0])]) |
4755 | - self.source_dist = os.path.isdir(os.path.join(self.basedir, 'drizzled')) |
4756 | - self.builddir = self.system_manager.find_path([os.path.abspath(self.basedir)]) |
4757 | - self.top_builddir = variables['topbuilddir'] |
4758 | - self.testdir = self.system_manager.find_path([os.path.abspath(variables['testdir'])]) |
4759 | - self.clientbindir = self.system_manager.find_path([os.path.join(self.builddir, 'client') |
4760 | - , os.path.join(self.basedir, 'client') |
4761 | - , os.path.join(self.basedir, 'bin')]) |
4762 | - self.srcdir = self.system_manager.find_path([self.basedir]) |
4763 | - self.suite_paths = variables['suitepaths'] |
4764 | - |
4765 | - |
4766 | - self.drizzle_client = self.system_manager.find_path([os.path.join(self.clientbindir, |
4767 | - 'drizzle')]) |
4768 | - |
4769 | - self.drizzledump = self.system_manager.find_path([os.path.join(self.clientbindir, |
4770 | - 'drizzledump')]) |
4771 | - |
4772 | - self.drizzleimport = self.system_manager.find_path([os.path.join(self.clientbindir, |
4773 | - 'drizzleimport')]) |
4774 | - |
4775 | - self.drizzle_server = self.system_manager.find_path([os.path.join(self.basedir,'drizzled/drizzled'), |
4776 | - os.path.join(self.clientbindir,'drizzled'), |
4777 | - os.path.join(self.basedir,'libexec/drizzled'), |
4778 | - os.path.join(self.basedir,'bin/drizzled'), |
4779 | - os.path.join(self.basedir,'sbin/drizzled'), |
4780 | - os.path.join(self.builddir,'drizzled/drizzled')]) |
4781 | - |
4782 | - |
4783 | - self.drizzleslap = self.system_manager.find_path([os.path.join(self.clientbindir, |
4784 | - 'drizzleslap')]) |
4785 | - |
4786 | - self.schemawriter = self.system_manager.find_path([os.path.join(self.basedir, |
4787 | - 'drizzled/message/schema_writer'), |
4788 | - os.path.join(self.builddir, |
4789 | - 'drizzled/message/schema_writer')]) |
4790 | - |
4791 | - self.drizzletest = self.system_manager.find_path([os.path.join(self.clientbindir, |
4792 | - 'drizzletest')]) |
4793 | - |
4794 | - self.server_version_string = None |
4795 | - self.server_executable = None |
4796 | - self.server_version = None |
4797 | - self.server_compile_os = None |
4798 | - self.server_platform = None |
4799 | - self.server_compile_comment = None |
4800 | - self.type = 'drizzle' |
4801 | - |
4802 | - self.process_server_version() |
4803 | - self.ld_lib_paths = self.get_ld_lib_paths() |
4804 | - |
4805 | - self.report() |
4806 | - |
4807 | - self.logging.debug_class(self) |
4808 | - |
4809 | - def report(self): |
4810 | - self.logging.info("Using Drizzle source tree:") |
4811 | - report_keys = ['basedir' |
4812 | - ,'clientbindir' |
4813 | - ,'testdir' |
4814 | - ,'server_version' |
4815 | - ,'server_compile_os' |
4816 | - ,'server_platform' |
4817 | - ,'server_comment'] |
4818 | - for key in report_keys: |
4819 | - self.logging.info("%s: %s" %(key, vars(self)[key])) |
4820 | - |
4821 | - |
4822 | - |
4823 | - def process_server_version(self): |
4824 | - """ Get the server version number from the found server executable """ |
4825 | - (retcode, self.server_version_string) = self.system_manager.execute_cmd(("%s --no-defaults --version" %(self.drizzle_server))) |
4826 | - # This is a bit bobo, but we're doing it, so nyah |
4827 | - # TODO fix this : ) |
4828 | - self.server_executable, data_string = [data_item.strip() for data_item in self.server_version_string.split('Ver ')] |
4829 | - self.server_version, data_string = [data_item.strip() for data_item in data_string.split('for ')] |
4830 | - self.server_compile_os, data_string = [data_item.strip() for data_item in data_string.split(' on')] |
4831 | - self.server_platform = data_string.split(' ')[0].strip() |
4832 | - self.server_comment = data_string.replace(self.server_platform,'').strip() |
4833 | - |
4834 | - def get_ld_lib_paths(self): |
4835 | - """ Return a list of paths we want added to LD_LIB variables |
4836 | - |
4837 | - These are processed later at the server_manager level, but we want to |
4838 | - specify them here (for a drizzle source tree) and now |
4839 | - |
4840 | - """ |
4841 | - ld_lib_paths = [] |
4842 | - if self.source_dist: |
4843 | - ld_lib_paths = [ os.path.join(self.basedir,"libdrizzleclient/.libs/") |
4844 | - #, os.path.join(self.basedir,"libdrizzle-2.0/libdrizzle.libs") |
4845 | - , os.path.join(self.basedir,"libdrizzle/.libs") |
4846 | - , os.path.join(self.basedir,"libdrizzle-2.0/libdrizzle/.libs") |
4847 | - , os.path.join(self.basedir,"libdrizzle-1.0/libdrizzle/.libs") |
4848 | - , os.path.join(self.basedir,"mysys/.libs/") |
4849 | - , os.path.join(self.basedir,"mystrings/.libs/") |
4850 | - , os.path.join(self.basedir,"drizzled/.libs/") |
4851 | - , "/usr/local/lib" |
4852 | - ] |
4853 | - else: |
4854 | - ld_lib_paths = [ os.path.join(self.basedir,"lib")] |
4855 | - return ld_lib_paths |
4856 | - |
4857 | -class mysqlTree(codeTree): |
4858 | - """ What a MySQL code tree should look like to the test-runner |
4859 | - |
4860 | - """ |
4861 | - |
4862 | - def __init__(self, variables,system_manager): |
4863 | - self.system_manager = system_manager |
4864 | - self.logging = self.system_manager.logging |
4865 | - self.skip_keys = ['ld_lib_paths'] |
4866 | - self.debug = variables['debug'] |
4867 | - self.verbose = variables['verbose'] |
4868 | - self.basedir = self.system_manager.find_path([os.path.abspath(variables['basedir'][0])]) |
4869 | - self.source_dist = os.path.isdir(os.path.join(self.basedir, 'mysqld')) |
4870 | - self.builddir = self.system_manager.find_path([os.path.abspath(self.basedir)]) |
4871 | - self.top_builddir = variables['topbuilddir'] |
4872 | - self.testdir = self.system_manager.find_path([os.path.abspath(variables['testdir'])]) |
4873 | - self.clientbindir = self.system_manager.find_path([os.path.join(self.basedir, 'client_release') |
4874 | - , os.path.join(self.basedir, 'client_debug') |
4875 | - , os.path.join(self.basedir, 'client') |
4876 | - , os.path.join(self.basedir, 'bin')]) |
4877 | - self.charsetdir = self.system_manager.find_path([os.path.join(self.basedir, 'mysql/charsets') |
4878 | - , os.path.join(self.basedir, 'sql/share/charsets') |
4879 | - , os.path.join(self.basedir, 'share/charsets')]) |
4880 | - self.langdir = self.system_manager.find_path([os.path.join(self.basedir, 'share/mysql') |
4881 | - , os.path.join(self.basedir, 'sql/share') |
4882 | - , os.path.join(self.basedir, 'share')]) |
4883 | - |
4884 | - |
4885 | - self.srcdir = self.system_manager.find_path([self.basedir]) |
4886 | - self.suite_paths = variables['suitepaths'] |
4887 | - |
4888 | - self.mysql_client = self.system_manager.find_path([os.path.join(self.clientbindir, |
4889 | - 'mysql')]) |
4890 | - |
4891 | - self.mysqldump = self.system_manager.find_path([os.path.join(self.clientbindir, |
4892 | - 'mysqldump')]) |
4893 | - |
4894 | - self.mysqlimport = self.system_manager.find_path([os.path.join(self.clientbindir, |
4895 | - 'mysqlimport')]) |
4896 | - |
4897 | - self.mysqladmin = self.system_manager.find_path([os.path.join(self.clientbindir, |
4898 | - 'mysqladmin')]) |
4899 | - |
4900 | - self.mysql_server = self.system_manager.find_path([ os.path.join(self.basedir, '/sql/mysqld-debug') |
4901 | - , os.path.join(self.basedir, '/libexec/mysqld-debug') |
4902 | - , os.path.join(self.basedir, '/sbin/mysqld-debug') |
4903 | - , os.path.join(self.basedir, '/bin/mysqld-debug') |
4904 | - , os.path.join(self.basedir, '/sql/mysqld') |
4905 | - , os.path.join(self.basedir, '/libexec/mysqld') |
4906 | - , os.path.join(self.basedir, '/sbin/mysqld') |
4907 | - , os.path.join(self.basedir, '/bin/mysqld') |
4908 | - , os.path.join(self.basedir, '/sql/mysqld-max-nt') |
4909 | - , os.path.join(self.basedir, '/libexec/mysqld-max-nt') |
4910 | - , os.path.join(self.basedir, '/sbin/mysqld-max-nt') |
4911 | - , os.path.join(self.basedir, '/bin/mysqld-max-nt') |
4912 | - , os.path.join(self.basedir, '/sql/mysqld-max') |
4913 | - , os.path.join(self.basedir, '/libexec/mysqld-max') |
4914 | - , os.path.join(self.basedir, '/sbin/mysqld-max') |
4915 | - , os.path.join(self.basedir, '/bin/mysqld-max') |
4916 | - , os.path.join(self.basedir, '/sql/mysqld-nt') |
4917 | - , os.path.join(self.basedir, '/libexec/mysqld-nt') |
4918 | - , os.path.join(self.basedir, '/sbin/mysqld-nt') |
4919 | - , os.path.join(self.basedir, '/bin/mysqld-nt') |
4920 | - ]) |
4921 | - |
4922 | - |
4923 | - |
4924 | - self.mysqlslap = self.system_manager.find_path([os.path.join(self.clientbindir, |
4925 | - 'mysqlslap')]) |
4926 | - |
4927 | - self.mysqltest = self.system_manager.find_path([os.path.join(self.clientbindir, |
4928 | - 'mysqltest')]) |
4929 | - self.server_version_string = None |
4930 | - self.server_executable = None |
4931 | - self.server_version = None |
4932 | - self.server_compile_os = None |
4933 | - self.server_platform = None |
4934 | - self.server_compile_comment = None |
4935 | - self.type = 'mysql' |
4936 | - self.process_server_version() |
4937 | - self.ld_lib_paths = self.get_ld_lib_paths() |
4938 | - self.bootstrap_path = os.path.join( self.system_manager.workdir |
4939 | - , 'mysql_bootstrap.sql' ) |
4940 | - self.generate_bootstrap() |
4941 | - |
4942 | - self.report() |
4943 | - |
4944 | - self.logging.debug_class(self) |
4945 | - |
4946 | - def report(self): |
4947 | - self.logging.info("Using mysql source tree:") |
4948 | - report_keys = ['basedir' |
4949 | - ,'clientbindir' |
4950 | - ,'testdir' |
4951 | - ,'server_version' |
4952 | - ,'server_compile_os' |
4953 | - ,'server_platform' |
4954 | - ,'server_comment'] |
4955 | - for key in report_keys: |
4956 | - self.logging.info("%s: %s" %(key, vars(self)[key])) |
4957 | - |
4958 | - def process_server_version(self): |
4959 | - """ Get the server version number from the found server executable """ |
4960 | - (retcode, self.server_version_string) = self.system_manager.execute_cmd(("%s --no-defaults --version" %(self.mysql_server))) |
4961 | - # This is a bit bobo, but we're doing it, so nyah |
4962 | - # TODO fix this : ) |
4963 | - self.server_executable, data_string = [data_item.strip() for data_item in self.server_version_string.split('Ver ')] |
4964 | - self.server_version, data_string = [data_item.strip() for data_item in data_string.split('for ')] |
4965 | - self.server_compile_os, data_string = [data_item.strip() for data_item in data_string.split(' on')] |
4966 | - self.server_platform = data_string.split(' ')[0].strip() |
4967 | - self.server_comment = data_string.replace(self.server_platform,'').strip() |
4968 | - |
4969 | - def get_ld_lib_paths(self): |
4970 | - """ Return a list of paths we want added to LD_LIB variables |
4971 | - |
4972 | - These are processed later at the server_manager level, but we want to |
4973 | - specify them here (for a mysql source tree) and now |
4974 | - |
4975 | - """ |
4976 | - ld_lib_paths = [] |
4977 | - if self.source_dist: |
4978 | - ld_lib_paths = [ os.path.join(self.basedir,"libmysql/.libs/") |
4979 | - , os.path.join(self.basedir,"libmysql_r/.libs") |
4980 | - , os.path.join(self.basedir,"zlib/.libs") |
4981 | - ] |
4982 | - else: |
4983 | - ld_lib_paths = [ os.path.join(self.basedir,"lib") |
4984 | - , os.path.join(self.basedir,"lib/mysql")] |
4985 | - return ld_lib_paths |
4986 | - |
4987 | - def generate_bootstrap(self): |
4988 | - """ We do the voodoo that we need to in order to create the bootstrap |
4989 | - file needed by MySQL |
4990 | - |
4991 | - """ |
4992 | - found_new_sql = False |
4993 | - # determine if we have a proper area for our sql or if we |
4994 | - # use the rigged method from 5.0 / 5.1 |
4995 | - # first we search various possible locations |
4996 | - test_file = "mysql_system_tables.sql" |
4997 | - for candidate_dir in [ "mysql" |
4998 | - , "sql/share" |
4999 | - , "share/mysql" |
5000 | - , "share" |
The diff has been truncated for viewing.
Was this the patch that failed to merge/build at the end?
I thought I put a note on that patch,... but,... confused.