X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=xt%2Fimapd-validate.t;h=5d27d2a0655eefddb914522a62453311a9c1c467;hb=HEAD;hp=3e44515650dcd794fa2b698e11af11e471112fdc;hpb=4042599799a3706d1b1c0589675b07cab610505a;p=public-inbox.git
diff --git a/xt/imapd-validate.t b/xt/imapd-validate.t
index 3e445156..5d665fa9 100644
--- a/xt/imapd-validate.t
+++ b/xt/imapd-validate.t
@@ -1,11 +1,12 @@
#!perl -w
-# Copyright (C) 2020 all contributors
+# Copyright (C) all contributors
# License: AGPL-3.0+
# Expensive test to validate compression and TLS.
use strict;
-use Test::More;
+use v5.10.1;
use Symbol qw(gensym);
use PublicInbox::DS qw(now);
+use PublicInbox::SHA;
use POSIX qw(_exit);
use PublicInbox::TestCommon;
my $inbox_dir = $ENV{GIANT_INBOX_DIR};
@@ -15,7 +16,7 @@ my $BATCH = $ENV{TEST_BATCH} // 100;
my $REPEAT = $ENV{TEST_REPEAT} // 1;
diag "TEST_BATCH=$BATCH TEST_REPEAT=$REPEAT";
-require_mods(qw(Mail::IMAPClient Email::Address::XS||Mail::Address));
+require_mods(qw(Mail::IMAPClient -imapd));
my $imap_client = 'Mail::IMAPClient';
my $can_compress = $imap_client->can('compress');
if ($can_compress) { # hope this gets fixed upstream, soon
@@ -64,7 +65,7 @@ my $do_get_all = sub {
my ($desc, $opt) = @_;
local $SIG{__DIE__} = sub { print STDERR $desc, ': ', @_; _exit(1) };
my $t0 = now();
- my $dig = Digest::SHA->new(1);
+ my $dig = PublicInbox::SHA->new(1);
my $mic = $imap_client->new(%$opt);
$mic->examine($mailbox) or die "examine: $!";
my $uid_base = 1;
@@ -152,11 +153,11 @@ $make_local_server = sub {
# not using multiple workers, here, since we want to increase
# the chance of tripping concurrency bugs within PublicInbox/IMAP*.pm
my $cmd = [ '-imapd', "--stdout=$out", "--stderr=$err", '-W0' ];
- push @$cmd, '-limap://'.$imap->sockhost.':'.$imap->sockport;
+ push @$cmd, '-limap://'.tcp_host_port($imap);
if ($test_tls) {
my $imaps = tcp_server();
$rdr->{4} = $imaps;
- push @$cmd, '-limaps://'.$imaps->sockhost.':'.$imaps->sockport;
+ push @$cmd, '-limaps://'.tcp_host_port($imaps);
push @$cmd, "--cert=$cert", "--key=$key";
my $tls_opt = [
SSL_hostname => 'server.local',