Simplify how Pingback handles MySQL instances. Remove Percona::Toolkit::slurp_file() because it was causing 'sub redefined' errors, probably due to PerconaTest::slurp_file(). Add more PTVCDEBUG statements.

This commit is contained in:
Daniel Nichter
2012-08-27 17:10:42 -06:00
parent a08bf4c4fc
commit 98338b6508
26 changed files with 2966 additions and 1005 deletions

View File

@@ -19,8 +19,8 @@ use PerconaTest;
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $dbh = $sb->get_dbh_for('master');
my $slave_dbh = $sb->get_dbh_for('slave1');
my $master_dbh = $sb->get_dbh_for('master');
my $slave1_dbh = $sb->get_dbh_for('slave1');
my $vc = VersionCheck->new();
@@ -38,7 +38,18 @@ sub test_v {
my $versions = $vc->get_versions(
items => $items,
instances => { "0xDEADBEEF" => $dbh, "0x8BADF00D" => $slave_dbh },
instances => [
{
id => "0xDEADBEEF",
name => "master",
dbh => $master_dbh,
},
{
id => "0x8BADF00D",
name => "slave1",
dbh => $slave1_dbh,
},
],
);
diag(Dumper($versions));
is_deeply(
@@ -125,12 +136,12 @@ use File::Spec;
}
SKIP: {
skip "Cannot cannot to sandbox master", 2 unless $dbh;
skip "Cannot cannot to sandbox master", 2 unless $master_dbh;
my (undef, $mysql_version)
= $dbh->selectrow_array("SHOW VARIABLES LIKE 'version'");
= $master_dbh->selectrow_array("SHOW VARIABLES LIKE 'version'");
my (undef, $mysql_distro)
= $dbh->selectrow_array("SHOW VARIABLES LIKE 'version_comment'");
= $master_dbh->selectrow_array("SHOW VARIABLES LIKE 'version_comment'");
test_v(
name => "mysql_variable",
@@ -178,7 +189,6 @@ ok(
"Newline stripped from OS"
);
# #############################################################################
# Validate items
# #############################################################################
@@ -203,6 +213,6 @@ is_deeply(
# Done.
# #############################################################################
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox")
if $dbh;
if $master_dbh;
done_testing;
exit;