X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=xt%2Flei-auth-fail.t;fp=xt%2Flei-auth-fail.t;h=06cb853353bb828eb34a7799cb0a9250b00a61a9;hb=5b90219609fb672d7bcbb5661305ae9c3a91e4f1;hp=e352aab3e1252d3778ae17c81c7fce146f62fd10;hpb=8325452970650c12c857a9ff858a0bbcb3a34f6d;p=public-inbox.git diff --git a/xt/lei-auth-fail.t b/xt/lei-auth-fail.t index e352aab3..06cb8533 100644 --- a/xt/lei-auth-fail.t +++ b/xt/lei-auth-fail.t @@ -2,17 +2,20 @@ # Copyright (C) 2021 all contributors # License: AGPL-3.0+ use strict; use v5.10.1; use PublicInbox::TestCommon; -require_mods(qw(Mail::IMAPClient)); +require_mods(qw(Mail::IMAPClient lei)); # TODO: mock IMAP server which fails at authentication so we don't # have to make external connections to test this: my $imap_fail = $ENV{TEST_LEI_IMAP_FAIL_URL} // 'imaps://AzureDiamond:Hunter2@public-inbox.org:994/INBOX'; +my ($ro_home, $cfg_path) = setup_public_inboxes; test_lei(sub { - for my $pfx ([qw(convert -o mboxrd:/dev/stdout)], ['import'], - [qw(tag +L:INBOX)]) { + for my $pfx ([qw(q z:0.. --only), "$ro_home/t1", '-o'], + [qw(convert -o mboxrd:/dev/stdout)], + [qw(convert t/utf8.eml -o), $imap_fail], + ['import'], [qw(tag +L:INBOX)]) { ok(!lei(@$pfx, $imap_fail), "IMAP auth failure on @$pfx"); - like($lei_err, qr!\bE:.*?imaps://.*?!sm, 'error shown'); + like($lei_err, qr!\bE:.*?imaps?://.*?!sm, 'error shown'); unlike($lei_err, qr!Hunter2!s, 'password not shown'); is($lei_out, '', 'nothing output'); }