-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5002 from brong/rename-ab
FastMail: test that rename a->c, b->a, c->b works
- Loading branch information
Showing
4 changed files
with
115 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!perl | ||
use Cassandane::Tiny; | ||
|
||
sub test_mailbox_rename_long_chain | ||
:AllowMoves :Replication :SyncLog :min_version_3_3 | ||
:needs_component_replication | ||
{ | ||
my ($self) = @_; | ||
|
||
my $mtalk = $self->{master_store}->get_client(); | ||
|
||
$mtalk->create('INBOX.Foo'); | ||
$mtalk->create('INBOX.Bar'); | ||
|
||
# replicate and check initial state | ||
my $synclogfname = "$self->{instance}->{basedir}/conf/sync/log"; | ||
$self->run_replication(rolling => 1, inputfile => $synclogfname); | ||
unlink($synclogfname); | ||
$self->check_replication('cassandane'); | ||
|
||
# perform the multi-path rename | ||
$mtalk = $self->{master_store}->get_client(); | ||
$mtalk->rename('INBOX.Bar', 'Inbox.Old'); | ||
$mtalk->rename('INBOX.Foo', 'Inbox.Foo2'); | ||
$mtalk->rename('INBOX.Foo2', 'Inbox.Foo3'); | ||
$mtalk->rename('INBOX.Foo3', 'Inbox.Foo4'); | ||
$mtalk->rename('INBOX.Foo4', 'Inbox.Foo5'); | ||
$mtalk->rename('INBOX.Foo5', 'Inbox.Foo6'); | ||
$mtalk->rename('INBOX.Foo6', 'Inbox.Foo7'); | ||
$mtalk->rename('INBOX.Foo7', 'Inbox.Foo8'); | ||
$mtalk->rename('INBOX.Foo8', 'Inbox.Bar'); | ||
# Create a couple of intermediates again | ||
$mtalk->create('INBOX.Foo5'); | ||
$mtalk->create('INBOX.Foo2'); | ||
|
||
# replicate and check that it syncs ok | ||
$self->run_replication(rolling => 1, inputfile => $synclogfname); | ||
unlink($synclogfname); | ||
$self->check_replication('cassandane'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!perl | ||
use Cassandane::Tiny; | ||
|
||
sub test_mailbox_rename_switch_ab | ||
:AllowMoves :Replication :SyncLog :min_version_3_3 | ||
:needs_component_replication | ||
{ | ||
my ($self) = @_; | ||
|
||
my $mtalk = $self->{master_store}->get_client(); | ||
|
||
$mtalk->create('INBOX.Foo'); | ||
$mtalk->create('INBOX.Bar'); | ||
|
||
# replicate and check initial state | ||
my $synclogfname = "$self->{instance}->{basedir}/conf/sync/log"; | ||
$self->run_replication(rolling => 1, inputfile => $synclogfname); | ||
unlink($synclogfname); | ||
$self->check_replication('cassandane'); | ||
|
||
# perform the three way rename | ||
$mtalk = $self->{master_store}->get_client(); | ||
$mtalk->rename('INBOX.Foo', 'Inbox.Foo2'); | ||
$mtalk->rename('INBOX.Bar', 'Inbox.Foo'); | ||
$mtalk->rename('INBOX.Foo2', 'Inbox.Bar'); | ||
|
||
# replicate and check that it syncs ok | ||
$self->run_replication(rolling => 1, inputfile => $synclogfname); | ||
unlink($synclogfname); | ||
$self->check_replication('cassandane'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters