X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=xt%2Fimapd-mbsync-oimap.t;h=0baf5b4cc073d0421c9f030eb5b4be7f245311c4;hb=d323a16ced5e3a77136a1ebca4a2f7d5678121c4;hp=d2237a24bef96c73c0f34d4e635d3c4260cd086e;hpb=94245dfc85576b5981b23fc5c917189b5fbbe3e8;p=public-inbox.git
diff --git a/xt/imapd-mbsync-oimap.t b/xt/imapd-mbsync-oimap.t
index d2237a24..0baf5b4c 100644
--- a/xt/imapd-mbsync-oimap.t
+++ b/xt/imapd-mbsync-oimap.t
@@ -1,24 +1,26 @@
#!perl -w
-# Copyright (C) 2020 all contributors
+# Copyright (C) 2020-2021 all contributors
# License: AGPL-3.0+
# ensure mbsync and offlineimap compatibility
use strict;
-use Test::More;
+use v5.10.1;
use File::Path qw(mkpath);
use PublicInbox::TestCommon;
use PublicInbox::Spawn qw(which spawn);
+require_mods(qw(-imapd));
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 $mailbox = 'inbox.test';
+my $newsgroup = 'inbox.test';
+my $mailbox = "$newsgroup.0";
{
open my $fh, '>', $cfg or BAIL_OUT "open: $!";
print $fh < $sock }) or BAIL_OUT "-imapd: $?";
my $c = tcp_connect($sock);
like(readline($c), qr/CAPABILITY /, 'got greeting');
}
+
+my $host_port = tcp_host_port($sock);
my ($host, $port) = ($sock->sockhost, $sock->sockport);
my %pids;
@@ -97,7 +101,7 @@ UseNamespace no
# DisableExtension COMPRESS=DEFLATE
Channel "test"
-Master ":remote:inbox"
+Master ":remote:INBOX"
Slave ":local:test"
Expunge None
Sync PullNew
@@ -115,8 +119,10 @@ while (scalar keys %pids) {
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";
diag "tmpdir=$tmpdir (Maildirs available)";
diag "stdout=$out";
diag "stderr=$err";