From 5a35100aab443c807607c1c9cb91249541dd4662 Mon Sep 17 00:00:00 2001 From: Robert Stepanek Date: Wed, 17 Feb 2021 14:58:16 +0100 Subject: [PATCH] SearchSquat: add test for reintroduced -s option --- Cassandane/Cyrus/SearchSquat.pm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Cassandane/Cyrus/SearchSquat.pm b/Cassandane/Cyrus/SearchSquat.pm index f7cb2286b..c106739d7 100644 --- a/Cassandane/Cyrus/SearchSquat.pm +++ b/Cassandane/Cyrus/SearchSquat.pm @@ -114,4 +114,27 @@ sub test_simple } } +# XXX version gated to 3.4+ for now to keep travis happy, but if we +# XXX backport the fix we should change or remove the gate... +sub test_skip_unmodified_slow + :SearchEngineSquat :min_version_3_4 +{ + my ($self) = @_; + my $imap = $self->{store}->get_client(); + + $self->make_message() || die; + + sleep(1); + + $self->{instance}->getsyslog(); + $self->{instance}->run_command({cyrus => 1}, 'squatter'); + my @lines = $self->{instance}->getsyslog(); + $self->assert(not grep /Squat skipping mailbox/, @lines); + + $self->{instance}->getsyslog(); + $self->{instance}->run_command({cyrus => 1}, 'squatter', '-v', '-s', '0'); + @lines = $self->{instance}->getsyslog(); + $self->assert(grep /Squat skipping mailbox/, @lines); +} + 1;