#!perl use Cassandane::Tiny; sub test_allday_sametz :min_version_3_0 { my ($self) = @_; my $CalDAV = $self->{caldav}; my $tz = <NewCalendar({name => 'foo', timeZone => $tz}); $self->assert_not_null($CalendarId); my $now = DateTime->now(); $now->set_time_zone('Australia/Brisbane'); # bump everything forward so a slow run (say: valgrind) # doesn't cause things to magically fire... $now->add(DateTime::Duration->new(seconds => 300)); # define the event to start in 2 days # (need to go 2 days out to account for the timezone of the testing location, # otherwise we may store the event locally AFTER the adjusted alarm trigger) my $startdt = $now->clone(); $startdt->add(DateTime::Duration->new(days => 2)); $startdt->truncate(to => 'day'); my $start = $startdt->strftime('%Y%m%d'); my $enddt = $startdt->clone(); $enddt->add(DateTime::Duration->new(days => 1)); my $end = $enddt->strftime('%Y%m%d'); # set the trigger to notify us at the start of the event my $trigger="PT0S"; my $uuid = "95989f3d-575f-4828-9610-6f16b9d54d04"; my $href = "$CalendarId/$uuid.ics"; my $card = <Request('PUT', $href, $card, 'Content-Type' => 'text/calendar'); # clean notification cache $self->{instance}->getnotify(); $self->{instance}->run_command({ cyrus => 1 }, 'calalarmd', '-t' => $startdt->epoch() + 60 ); $self->assert_alarms({summary => 'allday', start => $start, timezone => 'Australia/Brisbane'}); }