mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-04-17 01:01:39 +08:00
Make tests start up host2.
This commit is contained in:
@@ -19,7 +19,7 @@ use Sandbox;
|
||||
require "$trunk/bin/pt-upgrade";
|
||||
|
||||
# This runs immediately if the server is already running, else it starts it.
|
||||
# diag(`$trunk/sandbox/start-sandbox master 12348 >/dev/null`);
|
||||
diag(`$trunk/sandbox/start-sandbox master 12348 >/dev/null`);
|
||||
|
||||
my $dp = new DSNParser(opts=>$dsn_opts);
|
||||
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
|
||||
@@ -107,7 +107,7 @@ close $dh;
|
||||
# Done.
|
||||
# #############################################################################
|
||||
#$sb->wipe_clean($dbh2);
|
||||
#$sb->wipe_clean($dbh1);
|
||||
#diag(`$trunk/sandbox/stop-sandbox 12348 >/dev/null`);
|
||||
#ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
|
||||
$sb->wipe_clean($dbh1);
|
||||
diag(`$trunk/sandbox/stop-sandbox 12348 >/dev/null`);
|
||||
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
|
||||
done_testing;
|
||||
|
||||
@@ -20,7 +20,7 @@ use Sandbox;
|
||||
require "$trunk/bin/pt-upgrade";
|
||||
|
||||
# This runs immediately if the server is already running, else it starts it.
|
||||
# diag(`$trunk/sandbox/start-sandbox master 12348 >/dev/null`);
|
||||
diag(`$trunk/sandbox/start-sandbox master 12348 >/dev/null`);
|
||||
|
||||
my $dp = new DSNParser(opts=>$dsn_opts);
|
||||
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
|
||||
@@ -127,7 +127,7 @@ close $dh;
|
||||
# Done.
|
||||
# #############################################################################
|
||||
#$sb->wipe_clean($dbh2);
|
||||
#$sb->wipe_clean($dbh1);
|
||||
#diag(`$trunk/sandbox/stop-sandbox 12348 >/dev/null`);
|
||||
#ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
|
||||
$sb->wipe_clean($dbh1);
|
||||
diag(`$trunk/sandbox/stop-sandbox 12348 >/dev/null`);
|
||||
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
|
||||
done_testing;
|
||||
|
||||
@@ -20,15 +20,23 @@ use PerconaTest;
|
||||
use Sandbox;
|
||||
require "$trunk/bin/pt-upgrade";
|
||||
|
||||
my $dp = new DSNParser(opts=>$dsn_opts);
|
||||
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
|
||||
# This runs immediately if the server is already running, else it starts it.
|
||||
diag(`$trunk/sandbox/start-sandbox master 12348 >/dev/null`);
|
||||
|
||||
my $dp = new DSNParser(opts=>$dsn_opts);
|
||||
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
|
||||
my $dbh1 = $sb->get_dbh_for('host1');
|
||||
my $dbh2 = $sb->get_dbh_for('host2');
|
||||
|
||||
if ( !$dbh1 ) {
|
||||
plan skip_all => 'Cannot connect to sandbox host1';
|
||||
}
|
||||
elsif ( !$dbh2 ) {
|
||||
plan skip_all => 'Cannot connect to sandbox host2';
|
||||
}
|
||||
|
||||
my $host1_dsn = $sb->dsn_for('host1');
|
||||
my $host2_dsn = $sb->dsn_for('host2');
|
||||
|
||||
my $tmpdir = tempdir("/tmp/pt-upgrade.$PID.XXXXXX", CLEANUP => 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user