Skip to content

Commit

Permalink
FastMail: test that rename a->c, b->a, c->b works
Browse files Browse the repository at this point in the history
Even if replication didn't catch each step of the way!
  • Loading branch information
brong committed Aug 19, 2024
1 parent 2adcc5c commit 52cf889
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions cassandane/tiny-tests/FastMail/mailbox_rename_switch_ab
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');
}

0 comments on commit 52cf889

Please sign in to comment.