# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# ensure mbsync and offlineimap compatibility
use strict;
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# ensure mbsync and offlineimap compatibility
use strict;
use File::Path qw(mkpath);
use PublicInbox::TestCommon;
use PublicInbox::Spawn qw(which spawn);
use File::Path qw(mkpath);
use PublicInbox::TestCommon;
use PublicInbox::Spawn qw(which spawn);
my $inboxdir = $ENV{GIANT_INBOX_DIR};
(defined($inboxdir) && -d $inboxdir) or
plan skip_all => "GIANT_INBOX_DIR not defined for $0";
plan skip_all => "bad characters in $inboxdir" if $inboxdir =~ m![^\w\.\-/]!;
my ($tmpdir, $for_destroy) = tmpdir();
my $cfg = "$tmpdir/cfg";
my $inboxdir = $ENV{GIANT_INBOX_DIR};
(defined($inboxdir) && -d $inboxdir) or
plan skip_all => "GIANT_INBOX_DIR not defined for $0";
plan skip_all => "bad characters in $inboxdir" if $inboxdir =~ m![^\w\.\-/]!;
my ($tmpdir, $for_destroy) = tmpdir();
my $cfg = "$tmpdir/cfg";
{
open my $fh, '>', $cfg or BAIL_OUT "open: $!";
print $fh <<EOF or BAIL_OUT "print: $!";
[publicinbox "test"]
{
open my $fh, '>', $cfg or BAIL_OUT "open: $!";
print $fh <<EOF or BAIL_OUT "print: $!";
[publicinbox "test"]
my $c = tcp_connect($sock);
like(readline($c), qr/CAPABILITY /, 'got greeting');
}
my $c = tcp_connect($sock);
like(readline($c), qr/CAPABILITY /, 'got greeting');
}
is($?, 0, join(' ', @$cmd, 'done'));
}
is($?, 0, join(' ', @$cmd, 'done'));
}
-if (my $sec = $ENV{TEST_PERSIST}) {
- diag "sleeping ${sec}s, imap://$host:$port/$mailbox available";
+my $sec = $ENV{TEST_PERSIST} // 0;
+diag "TEST_PERSIST=$sec";
+if ($sec) {
+ diag "sleeping ${sec}s, imap://$host_port/$mailbox available";