Make tests start up host2.

This commit is contained in:
Daniel Nichter
2013-03-11 10:05:04 -06:00
parent acf25127ad
commit 2aa2176fdd
3 changed files with 18 additions and 10 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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);