From 52cf8892802c32693958679601fb66ed1ea5458e Mon Sep 17 00:00:00 2001 From: Bron Gondwana Date: Mon, 19 Aug 2024 23:20:21 +1000 Subject: [PATCH] FastMail: test that rename a->c, b->a, c->b works Even if replication didn't catch each step of the way! --- .../FastMail/mailbox_rename_switch_ab | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 cassandane/tiny-tests/FastMail/mailbox_rename_switch_ab diff --git a/cassandane/tiny-tests/FastMail/mailbox_rename_switch_ab b/cassandane/tiny-tests/FastMail/mailbox_rename_switch_ab new file mode 100644 index 0000000000..1df0c98a7a --- /dev/null +++ b/cassandane/tiny-tests/FastMail/mailbox_rename_switch_ab @@ -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'); +}