X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=xt%2Fimapd-mbsync-oimap.t;h=0baf5b4cc073d0421c9f030eb5b4be7f245311c4;hb=refs%2Fheads%2Fmaster;hp=fdaa22aa9efb868b1b4da4206cc4ef525f81da37;hpb=d67fff9abf168c7517311bdd8987ce174a60f2c4;p=public-inbox.git
diff --git a/xt/imapd-mbsync-oimap.t b/xt/imapd-mbsync-oimap.t
index fdaa22aa..b0281105 100644
--- a/xt/imapd-mbsync-oimap.t
+++ b/xt/imapd-mbsync-oimap.t
@@ -1,12 +1,13 @@
#!perl -w
-# Copyright (C) 2020 all contributors
+# Copyright (C) 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);
+use PublicInbox::Spawn qw(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";
@@ -34,12 +35,15 @@ my $td = start_script($cmd, $env, { 3 => $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;
SKIP: {
mkpath([map { "$tmpdir/oimapdir/$_" } qw(cur new tmp)]);
- my $oimap = which('offlineimap') or skip 'no offlineimap(1)', 1;
+ my $oimap = require_cmd('offlineimap', 1) or
+ skip 'no offlineimap(1)', 1;
open my $fh, '>', "$tmpdir/.offlineimaprc" or BAIL_OUT "open: $!";
print $fh <', "$tmpdir/.mbsyncrc" or BAIL_OUT "open: $!";
print $fh <