pt-slave-find added --resolve-address option

This commit is contained in:
Frank Cizmich
2015-03-19 17:44:39 -03:00
parent 16a7ffa6f9
commit 29cbec8b75
2 changed files with 52 additions and 6 deletions

View File

@@ -43,7 +43,7 @@ elsif ( !$slave2_dbh ) {
plan skip_all => 'Cannot connect to second sandbox slave';
}
else {
plan tests => 9;
plan tests => 10;
}
my @args = ('h=127.0.0.1,P=12345,u=msandbox,p=msandbox');
@@ -67,6 +67,17 @@ my $expected = <<EOF;
EOF
is($output, $expected, 'Master with slave and slave of slave');
###############################################################################
# Test --resolve-hostname option (we don't know the hostname of the test
# machine so we settle for any non null string)
###############################################################################
$output = `$trunk/bin/pt-slave-find -h 127.0.0.1 -P 12345 -u msandbox -p msandbox --report-format hostname --resolve-address`;
like (
$output,
qr/127\.0\.0\.1:12345\s+\(\w+\)/s,
"--resolve-address option"
) or diag($output);
# #############################################################################
# Until MasterSlave::find_slave_hosts() is improved to overcome the problems
# with SHOW SLAVE HOSTS, this test won't work.
@@ -146,6 +157,7 @@ ok(
"Summary report format",
);
# #############################################################################
# Done.
# #############################################################################