* Fix quoting bug reported by Sean M. Pappalardo
* Fix need for password argument when using md5
-* Get pkonly working with 'bucardo add all tables'
* Get Drizzle tests verified as working
* Get bucardo-report working again
* Note 8.2 minimum requirement somewhere (probably from COPY (select))
$t = q{Add database fails for an invalid port};
$res = $bct->ctl('bucardo add database foo dbname=bar dbport=1');
-like ($res, qr/Connection test failed.*could not connect to server/s, $t);
+like ($res, qr/Connection .+ failed.*could not connect to server/s, $t);
$t = q{Add database fails for non-existent host};
$res = $bct->ctl("bucardo add database bucardo_test dbname=bucardo_test user=$dbuserA port=$dbportA host=badbucardohost");
-like ($res, qr/Connection test failed.*could not translate host name/s, $t);
+like ($res, qr/Connection .+ failed.*could not translate host name/s, $t);
$t = q{Add database fails for non-existent database};
$res = $bct->ctl("bucardo add database foo dbname=bar user=$dbuserA port=$dbportA host=$dbhostA");
-like ($res, qr/Connection test failed.*database "bar" does not exist/s, $t);
+like ($res, qr/Connection .+ failed.*database "bar" does not exist/s, $t);
$t = q{Add database fails for non-existent user};
$res = $bct->ctl("bucardo add database bucardo_test dbname=bucardo_test user=nobob port=$dbportA host=$dbhostA");
-like ($res, qr/Connection test failed.* "nobob" does not exist/s, $t);
+like ($res, qr/Connection .+ failed.* "nobob" does not exist/s, $t);
$t = q{Add database works for non-existent cluster with --force flag};
$res = $bct->ctl('bucardo add database foo dbname=bar --force');
my $bct = BucardoTesting->new() or BAIL_OUT "Creation of BucardoTesting object failed\n";
$location = 'fullcopy';
-my $numtabletypes = keys %tabletype;
plan tests => 339;
pass("*** Beginning 'fullcopy' tests");
## Create a bucardo database, and install Bucardo into it
$dbhX = $bct->setup_bucardo('A');
-## Tell Bucardo about these databases
-
## Teach Bucardo about four databases
for my $name (qw/ A B C D /) {
$t = "Adding database from cluster $name works";
like ($res, qr/Added database "$name"/, $t);
}
-## Put all primary key tables into a herd
+## Put all tables (including non-PK) into a herd
$t = q{Adding all PK tables on the master works};
$command =
-"bucardo add tables all db=A herd=pk pkonly";
+"bucardo add tables '*bucardo_test*' db=A herd=all";
$res = $bct->ctl($command);
-like ($res, qr/Creating herd: pk.*New tables added: \d/s, $t);
+like ($res, qr/Created the herd named "all".*are now part of/s, $t);
## Create a new database group going from A and B to C and D
$t = q{Created a new database group};
## Create a new sync
$t = q{Created a new sync};
$command =
-"bucardo add sync fctest herd=pk dbs=pg ping=false";
+"bucardo add sync fctest herd=all dbs=pg type=fullcopy";
$res = $bct->ctl($command);
like ($res, qr/Added sync "fctest"/, $t);
-## Start up Bucardo with this new sync
+## Start up Bucardo with this new sync.
+## No need to wait for the sync, as fullcopy syncs don't auto-run
$bct->restart_bucardo($dbhX);
-## Immediate kicks to catch any startup sync effects
-$bct->ctl('bucardo kick fctest 0');
-$bct->ctl('bucardo kick fctest 0');
+
+
+
## Get the statement handles ready for each table type
for my $table (sort keys %tabletype) {
## Create a new sync
$t = q{Created a new sync};
$command =
-"bucardo add sync fctest2 herd=pk dbs=pg2 ping=false";
+"bucardo add sync fctest2 herd=all dbs=pg2 ping=false";
$res = $bct->ctl($command);
like ($res, qr/Added sync "fctest2"/, $t);
## Create a new sync
$t = q{Created a new sync};
$command =
-"bucardo add sync fctest3 herd=pk dbs=pg3 ping=false";
+"bucardo add sync fctest3 herd=all dbs=pg3 ping=false";
$res = $bct->ctl($command);
like ($res, qr/Added sync "fctest3"/, $t);
sub restart_bucardo {
## Start Bucardo, but stop first if it is already running
- ## Arguments:
+ ## Arguments: one, two, or three
## 1. database handle to the bucardo_control_test db
## 2. The notice we wait for, defaults to: bucardo_started
## 3. The message to give to the "pass" function, defaults to: Bucardo was started
$dbh = $self->connect_database($clustername, 'bucardo');
## Make some adjustments
- $sth = $dbh->prepare('UPDATE bucardo.bucardo_config SET value = $2 WHERE setting = $1');
+ $sth = $dbh->prepare('UPDATE bucardo.bucardo_config SET setting = $2 WHERE name = $1');
$count = $sth->execute('piddir' => $PIDDIR);
$count = $sth->execute('reason_file' => "$PIDDIR/reason");
$count = $sth->execute('sendmail_file' => 'debug.sendmail.txt');
$dbh->commit();
## Make some adjustments
- $sth = $dbh->prepare('UPDATE bucardo.bucardo_config SET value = $2 WHERE setting = $1');
+ $sth = $dbh->prepare('UPDATE bucardo.bucardo_config SET setting = $2 WHERE name = $1');
$count = $sth->execute('piddir' => $PIDDIR);
$count = $sth->execute('reason_file' => "$PIDDIR/reason");
$count = $sth->execute('audit_pid' => 1);