mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 05:00:45 +00:00
Revert back to ok() for Sandbox::ok() so tests file don't have to be updated. Shorten verify_test_data_integrity() to verify_test_data().
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
# This program is copyright 2008-2011 Percona Inc.
|
# This program is copyright 2008-2012 Percona Inc.
|
||||||
# Feedback and improvements are welcome.
|
# Feedback and improvements are welcome.
|
||||||
#
|
#
|
||||||
# THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
|
# THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||||
@@ -280,8 +280,10 @@ sub ok {
|
|||||||
push @errors, $self->slave_is_ok('slave1', 'master');
|
push @errors, $self->slave_is_ok('slave1', 'master');
|
||||||
push @errors, $self->slave_is_ok('slave2', 'slave1', 1);
|
push @errors, $self->slave_is_ok('slave2', 'slave1', 1);
|
||||||
push @errors, $self->leftover_servers();
|
push @errors, $self->leftover_servers();
|
||||||
push @errors, $self->verify_test_data_integrity();
|
push @errors, $self->verify_test_data();
|
||||||
return join(' ', grep { $_ ne '' } @errors);
|
|
||||||
|
@errors = grep { warn "ERROR: ", $_, "\n" if $_; $_; } @errors;
|
||||||
|
return !@errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub _d {
|
sub _d {
|
||||||
@@ -295,7 +297,7 @@ sub _d {
|
|||||||
# Verifies that master, slave1, and slave2 have a faithful copy of the mysql and
|
# Verifies that master, slave1, and slave2 have a faithful copy of the mysql and
|
||||||
# sakila databases. The reference data is inserted into percona_test.checksums
|
# sakila databases. The reference data is inserted into percona_test.checksums
|
||||||
# by util/checksum-test-dataset when sandbox/test-env starts the environment.
|
# by util/checksum-test-dataset when sandbox/test-env starts the environment.
|
||||||
sub verify_test_data_integrity {
|
sub verify_test_data {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
my $master = $self->get_dbh_for('master');
|
my $master = $self->get_dbh_for('master');
|
||||||
my $ref = $master->selectall_hashref(
|
my $ref = $master->selectall_hashref(
|
||||||
@@ -323,7 +325,7 @@ sub verify_test_data_integrity {
|
|||||||
}
|
}
|
||||||
$master->disconnect;
|
$master->disconnect;
|
||||||
if ( @diffs ) {
|
if ( @diffs ) {
|
||||||
return "Tables with differences: " . join(', ', @diffs);
|
return "Tables are different: " . join(', ', @diffs);
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
@@ -461,5 +461,5 @@ is(
|
|||||||
# Done.
|
# Done.
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
$sb->wipe_clean($master_dbh);
|
$sb->wipe_clean($master_dbh);
|
||||||
is($sb->ok(), '', "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
|
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
|
||||||
exit;
|
exit;
|
||||||
|
@@ -62,5 +62,5 @@ like($output, qr/COMMENT='test1'/, '--lock-and-rename worked');
|
|||||||
# Done.
|
# Done.
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
$sb->wipe_clean($master_dbh);
|
$sb->wipe_clean($master_dbh);
|
||||||
is($sb->ok(), '', "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
|
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
|
||||||
exit;
|
exit;
|
||||||
|
Reference in New Issue
Block a user