| OLD | NEW |
| 1 import os | 1 import os |
| 2 from autotest_lib.client.bin import test, utils | 2 from autotest_lib.client.bin import test, utils |
| 3 | 3 |
| 4 | 4 |
| 5 # Dbt-2 is a fair-use implementation of the TPC-C benchmark. The test is | 5 # Dbt-2 is a fair-use implementation of the TPC-C benchmark. The test is |
| 6 # currently hardcoded to use PostgreSQL but the kit also supports MySQL. | 6 # currently hardcoded to use PostgreSQL but the kit also supports MySQL. |
| 7 | 7 |
| 8 class dbt2(test.test): | 8 class dbt2(test.test): |
| 9 version = 2 | 9 version = 2 |
| 10 | 10 |
| 11 def initialize(self): | 11 def initialize(self): |
| 12 self.job.require_gcc() | 12 self.job.require_gcc() |
| 13 | 13 |
| 14 | 14 |
| 15 # http://osdn.dl.sourceforge.net/sourceforge/osdldbt/dbt2-0.39.tar.gz | 15 # http://osdn.dl.sourceforge.net/sourceforge/osdldbt/dbt2-0.39.tar.gz |
| 16 def setup(self, tarball = 'dbt2-0.39.tar.bz2'): | 16 def setup(self, tarball = 'dbt2-0.39.tar.bz2'): |
| 17 tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) | 17 tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) |
| 18 utils.extract_tarball_to_dir(tarball, self.srcdir) | 18 utils.extract_tarball_to_dir(tarball, self.srcdir) |
| 19 self.job.setup_dep(['pgsql', 'pgpool', 'mysql']) | 19 self.job.setup_dep(['pgsql', 'pgpool', 'mysql']) |
| 20 | 20 |
| 21 # | 21 # |
| 22 # Extract one copy of the kit for MySQL. | 22 # Extract one copy of the kit for MySQL. |
| 23 # | 23 # |
| 24 utils.system('cp -pR ' + self.srcdir + ' ' + self.srcdir + '.mysql') | 24 utils.system('cp -pR ' + self.srcdir + ' ' + self.srcdir + '.mysql') |
| 25 os.chdir(self.srcdir + '.mysql') | 25 os.chdir(self.srcdir + '.mysql') |
| 26 utils.configure('--with-mysql=%s/deps/mysql/mysql' % self.autodir) | 26 utils.system('./configure --with-mysql=%s/deps/mysql/mysql' \ |
| 27 utils.make() | 27 % self.autodir) |
| 28 utils.system('make') |
| 28 | 29 |
| 29 # | 30 # |
| 30 # Extract one copy of the kit for PostgreSQL. | 31 # Extract one copy of the kit for PostgreSQL. |
| 31 # | 32 # |
| 32 utils.system('cp -pR ' + self.srcdir + ' ' + self.srcdir + '.pgsql') | 33 utils.system('cp -pR ' + self.srcdir + ' ' + self.srcdir + '.pgsql') |
| 33 os.chdir(self.srcdir + '.pgsql') | 34 os.chdir(self.srcdir + '.pgsql') |
| 34 utils.configure('--with-postgresql=%s/deps/pgsql/pgsql' % self.autodir) | 35 utils.system('./configure --with-postgresql=%s/deps/pgsql/pgsql' \ |
| 35 utils.make() | 36 % self.autodir) |
| 37 utils.system('make') |
| 36 | 38 |
| 37 # Create symlinks to autotest's results directory from dbt-2's | 39 # Create symlinks to autotest's results directory from dbt-2's |
| 38 # preferred results directory to self.resultsdir | 40 # preferred results directory to self.resultsdir |
| 39 utils.system('ln -s %s %s' % | 41 utils.system('ln -s %s %s' % |
| 40 (self.resultsdir, self.srcdir + '.mysql/scripts/output')) | 42 (self.resultsdir, self.srcdir + '.mysql/scripts/output')) |
| 41 utils.system('ln -s %s %s' % | 43 utils.system('ln -s %s %s' % |
| 42 (self.resultsdir, self.srcdir + '.pgsql/scripts/output')) | 44 (self.resultsdir, self.srcdir + '.pgsql/scripts/output')) |
| 43 | 45 |
| 44 | 46 |
| 45 def execute(self, db_type, args = ''): | 47 def execute(self, db_type, args = ''): |
| (...skipping 22 matching lines...) Expand all Loading... |
| 68 | 70 |
| 69 def execute_pgsql(self, args = ''): | 71 def execute_pgsql(self, args = ''): |
| 70 utils.system(self.srcdir + '.pgsql/scripts/pgsql/build_db.sh -g -w 1') | 72 utils.system(self.srcdir + '.pgsql/scripts/pgsql/build_db.sh -g -w 1') |
| 71 utils.system(self.srcdir + '.pgsql/scripts/run_workload.sh ' + args) | 73 utils.system(self.srcdir + '.pgsql/scripts/run_workload.sh ' + args) |
| 72 # | 74 # |
| 73 # Clean up by dropping the database after the test. | 75 # Clean up by dropping the database after the test. |
| 74 # | 76 # |
| 75 utils.system(self.srcdir + '.pgsql/scripts/pgsql/start_db.sh') | 77 utils.system(self.srcdir + '.pgsql/scripts/pgsql/start_db.sh') |
| 76 utils.system(self.srcdir + '.pgsql/scripts/pgsql/drop_db.sh') | 78 utils.system(self.srcdir + '.pgsql/scripts/pgsql/drop_db.sh') |
| 77 utils.system(self.srcdir + '.pgsql/scripts/pgsql/stop_db.sh') | 79 utils.system(self.srcdir + '.pgsql/scripts/pgsql/stop_db.sh') |
| OLD | NEW |