X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fimapd-tls.t;h=73f5112fcb7275e672be10a944f4c143e9a2be16;hb=20c940a876728fe91892200dd874dd917cd677ac;hp=72ba8769610a90db756fb20d6773e090e010abb6;hpb=207f0f93632e26818f2ed3b9d78bf3251b5a69b3;p=public-inbox.git diff --git a/t/imapd-tls.t b/t/imapd-tls.t index 72ba8769..73f5112f 100644 --- a/t/imapd-tls.t +++ b/t/imapd-tls.t @@ -1,8 +1,8 @@ +#!perl -w # Copyright (C) 2020-2021 all contributors # License: AGPL-3.0+ use strict; -use warnings; -use Test::More; +use v5.10.1; use Socket qw(IPPROTO_TCP SOL_SOCKET); use PublicInbox::TestCommon; # IO::Poll is part of the standard library, but distros may split it off... @@ -155,6 +155,13 @@ for my $args ( ok(sysread($slow, my $end, 4096) > 0, 'got end'); is(sysread($slow, my $eof, 4096), 0, 'got EOF'); + test_lei(sub { + lei_ok qw(ls-mail-source), "imap://$starttls_addr", + \'STARTTLS not used by default'; + ok(!lei(qw(ls-mail-source -c imap.starttls=true), + "imap://$starttls_addr"), 'STARTTLS verify fails'); + }); + SKIP: { skip 'TCP_DEFER_ACCEPT is Linux-only', 2 if $^O ne 'linux'; my $var = eval { Socket::TCP_DEFER_ACCEPT() } // 9;